Loading...
Searching...
No Matches
kld_adaptive_particle_filter_omp.h
#pragma once
#include <pcl/tracking/coherence.h>
#include <pcl/tracking/kld_adaptive_particle_filter.h>
#include <pcl/tracking/tracking.h>
namespace pcl {
namespace tracking {
/** \brief @b KLDAdaptiveParticleFilterOMPTracker tracks the PointCloud which is given
* by setReferenceCloud within the measured PointCloud using particle filter method. The
* number of the particles changes adaptively based on KLD sampling [D. Fox, NIPS-01],
* [D.Fox, IJRR03]. and the computation of the weights of the particles is parallelized
* using OpenMP.
* \author Ryohei Ueda
* \ingroup tracking
*/
template <typename PointInT, typename StateT>
class KLDAdaptiveParticleFilterOMPTracker
: public KLDAdaptiveParticleFilterTracker<PointInT, StateT> {
public:
using Tracker<PointInT, StateT>::tracker_name_;
using Tracker<PointInT, StateT>::search_;
using Tracker<PointInT, StateT>::input_;
using Tracker<PointInT, StateT>::indices_;
using Tracker<PointInT, StateT>::getClassName;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::particles_;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::change_detector_;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::change_counter_;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::change_detector_interval_;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::use_change_detector_;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::pass_x_;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::pass_y_;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::pass_z_;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::alpha_;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::changed_;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::coherence_;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::use_normal_;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::particle_num_;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::change_detector_filter_;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::transed_reference_vector_;
// using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::calcLikelihood;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::normalizeWeight;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::normalizeParticleWeight;
using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::calcBoundingBox;
using BaseClass = Tracker<PointInT, StateT>;
using Ptr = shared_ptr<KLDAdaptiveParticleFilterOMPTracker<PointInT, StateT>>;
using ConstPtr =
shared_ptr<const KLDAdaptiveParticleFilterOMPTracker<PointInT, StateT>>;
using PointCloudIn = typename Tracker<PointInT, StateT>::PointCloudIn;
using PointCloudInPtr = typename PointCloudIn::Ptr;
using PointCloudInConstPtr = typename PointCloudIn::ConstPtr;
using PointCloudState = typename Tracker<PointInT, StateT>::PointCloudState;
using PointCloudStatePtr = typename PointCloudState::Ptr;
using PointCloudStateConstPtr = typename PointCloudState::ConstPtr;
using Coherence = PointCoherence<PointInT>;
using CoherencePtr = typename Coherence::Ptr;
using CoherenceConstPtr = typename Coherence::ConstPtr;
using CloudCoherence = PointCloudCoherence<PointInT>;
using CloudCoherencePtr = typename CloudCoherence::Ptr;
using CloudCoherenceConstPtr = typename CloudCoherence::ConstPtr;
/** \brief Initialize the scheduler and set the number of threads to use.
* \param nr_threads the number of hardware threads to use (0 sets the value
* back to automatic)
*/
KLDAdaptiveParticleFilterOMPTracker(unsigned int nr_threads = 0)
: KLDAdaptiveParticleFilterTracker<PointInT, StateT>()
{
tracker_name_ = "KLDAdaptiveParticleFilterOMPTracker";
setNumberOfThreads(nr_threads);
}
/** \brief Initialize the scheduler and set the number of threads to use.
* \param nr_threads the number of hardware threads to use (0 sets the value back to
* automatic)
*/
void
setNumberOfThreads(unsigned int nr_threads = 0);
protected:
/** \brief The number of threads the scheduler should use. */
unsigned int threads_;
/** \brief weighting phase of particle filter method. calculate the likelihood of all
* of the particles and set the weights.
*/
void
weight() override;
};
} // namespace tracking
} // namespace pcl
//#include <pcl/tracking/impl/particle_filter_omp.hpp>
#ifdef PCL_NO_PRECOMPILE
#include <pcl/tracking/impl/kld_adaptive_particle_filter_omp.hpp>
#endif
pcl::PCLBase< PointInT >::input_
PointCloudConstPtr input_
Definition pcl_base.h:147
pcl::PCLBase< PointInT >::indices_
IndicesPtr indices_
Definition pcl_base.h:150
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::Ptr
shared_ptr< KLDAdaptiveParticleFilterOMPTracker< PointInT, StateT > > Ptr
Definition kld_adaptive_particle_filter_omp.h:48
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::PointCloudInConstPtr
typename PointCloudIn::ConstPtr PointCloudInConstPtr
Definition kld_adaptive_particle_filter_omp.h:54
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::CloudCoherence
PointCloudCoherence< PointInT > CloudCoherence
Definition kld_adaptive_particle_filter_omp.h:64
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::CoherenceConstPtr
typename Coherence::ConstPtr CoherenceConstPtr
Definition kld_adaptive_particle_filter_omp.h:62
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::CloudCoherenceConstPtr
typename CloudCoherence::ConstPtr CloudCoherenceConstPtr
Definition kld_adaptive_particle_filter_omp.h:66
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::threads_
unsigned int threads_
The number of threads the scheduler should use.
Definition kld_adaptive_particle_filter_omp.h:89
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::PointCloudStateConstPtr
typename PointCloudState::ConstPtr PointCloudStateConstPtr
Definition kld_adaptive_particle_filter_omp.h:58
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::CoherencePtr
typename Coherence::Ptr CoherencePtr
Definition kld_adaptive_particle_filter_omp.h:61
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::Coherence
PointCoherence< PointInT > Coherence
Definition kld_adaptive_particle_filter_omp.h:60
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::CloudCoherencePtr
typename CloudCoherence::Ptr CloudCoherencePtr
Definition kld_adaptive_particle_filter_omp.h:65
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::KLDAdaptiveParticleFilterOMPTracker
KLDAdaptiveParticleFilterOMPTracker(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
Definition kld_adaptive_particle_filter_omp.h:72
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::setNumberOfThreads
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
Definition kld_adaptive_particle_filter_omp.hpp:11
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::weight
void weight() override
weighting phase of particle filter method.
Definition kld_adaptive_particle_filter_omp.hpp:27
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::ConstPtr
shared_ptr< const KLDAdaptiveParticleFilterOMPTracker< PointInT, StateT > > ConstPtr
Definition kld_adaptive_particle_filter_omp.h:49
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::PointCloudStatePtr
typename PointCloudState::Ptr PointCloudStatePtr
Definition kld_adaptive_particle_filter_omp.h:57
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::PointCloudIn
typename Tracker< PointInT, StateT >::PointCloudIn PointCloudIn
Definition kld_adaptive_particle_filter_omp.h:52
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::PointCloudInPtr
typename PointCloudIn::Ptr PointCloudInPtr
Definition kld_adaptive_particle_filter_omp.h:53
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::PointCloudState
typename Tracker< PointInT, StateT >::PointCloudState PointCloudState
Definition kld_adaptive_particle_filter_omp.h:56
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::BaseClass
Tracker< PointInT, StateT > BaseClass
Definition kld_adaptive_particle_filter_omp.h:46
pcl::tracking::KLDAdaptiveParticleFilterTracker::KLDAdaptiveParticleFilterTracker
KLDAdaptiveParticleFilterTracker()
Empty constructor.
Definition kld_adaptive_particle_filter.h:65
pcl::tracking::ParticleFilterTracker::calcBoundingBox
void calcBoundingBox(double &x_min, double &x_max, double &y_min, double &y_max, double &z_min, double &z_max)
Compute the parameters for the bounding box of hypothesis pointclouds.
Definition particle_filter.hpp:187
pcl::tracking::ParticleFilterTracker::coherence_
CloudCoherencePtr coherence_
A pointer to PointCloudCoherence.
Definition particle_filter.h:556
pcl::tracking::ParticleFilterTracker::changed_
bool changed_
A flag to be true when change of pointclouds is detected.
Definition particle_filter.h:615
pcl::tracking::ParticleFilterTracker::change_detector_filter_
unsigned int change_detector_filter_
Minimum points in a leaf when calling change detector.
Definition particle_filter.h:622
pcl::tracking::ParticleFilterTracker::change_detector_
pcl::octree::OctreePointCloudChangeDetector< PointInT >::Ptr change_detector_
Change detector used as a trigger to track.
Definition particle_filter.h:611
pcl::tracking::ParticleFilterTracker::pass_z_
pcl::PassThrough< PointInT > pass_z_
Pass through filter to crop the pointclouds within the hypothesis bounding box.
Definition particle_filter.h:605
pcl::tracking::ParticleFilterTracker::transed_reference_vector_
std::vector< PointCloudInPtr > transed_reference_vector_
A list of the pointers to pointclouds.
Definition particle_filter.h:608
pcl::tracking::ParticleFilterTracker::pass_y_
pcl::PassThrough< PointInT > pass_y_
Pass through filter to crop the pointclouds within the hypothesis bounding box.
Definition particle_filter.h:602
pcl::tracking::ParticleFilterTracker::change_counter_
unsigned int change_counter_
A counter to skip change detection.
Definition particle_filter.h:618
pcl::tracking::ParticleFilterTracker::alpha_
double alpha_
The weight to be used in normalization of the weights of the particles.
Definition particle_filter.h:579
pcl::tracking::ParticleFilterTracker::use_normal_
bool use_normal_
A flag to use normal or not.
Definition particle_filter.h:589
pcl::tracking::ParticleFilterTracker::particles_
PointCloudStatePtr particles_
A pointer to the particles.
Definition particle_filter.h:553
pcl::tracking::ParticleFilterTracker::change_detector_interval_
unsigned int change_detector_interval_
The number of interval frame to run change detection.
Definition particle_filter.h:626
pcl::tracking::ParticleFilterTracker::normalizeParticleWeight
double normalizeParticleWeight(double w, double w_min, double w_max)
Normalize the weight of a particle using .
Definition particle_filter.h:246
pcl::tracking::ParticleFilterTracker::particle_num_
int particle_num_
The number of the particles.
Definition particle_filter.h:541
pcl::tracking::ParticleFilterTracker::pass_x_
pcl::PassThrough< PointInT > pass_x_
Pass through filter to crop the pointclouds within the hypothesis bounding box.
Definition particle_filter.h:599
pcl::tracking::ParticleFilterTracker::use_change_detector_
bool use_change_detector_
The flag which will be true if using change detection.
Definition particle_filter.h:632
pcl::tracking::ParticleFilterTracker::normalizeWeight
virtual void normalizeWeight()
Normalize the weights of all the particels.
Definition particle_filter.hpp:117
pcl::tracking::PointCloudCoherence
PointCloudCoherence is a base class to compute coherence between the two PointClouds.
Definition coherence.h:59
pcl::tracking::PointCloudCoherence::Ptr
shared_ptr< PointCloudCoherence< PointInT > > Ptr
Definition coherence.h:61
pcl::tracking::PointCloudCoherence::ConstPtr
shared_ptr< const PointCloudCoherence< PointInT > > ConstPtr
Definition coherence.h:62
pcl::tracking::PointCoherence
PointCoherence is a base class to compute coherence between the two points.
Definition coherence.h:15
pcl::tracking::PointCoherence::Ptr
shared_ptr< PointCoherence< PointInT > > Ptr
Definition coherence.h:17
pcl::tracking::PointCoherence::ConstPtr
shared_ptr< const PointCoherence< PointInT > > ConstPtr
Definition coherence.h:18
pcl::tracking::Tracker
Tracker represents the base tracker class.
Definition tracker.h:55
pcl::tracking::Tracker::getClassName
const std::string & getClassName() const
Get a string representation of the name of this class.
Definition tracker.h:97
pcl::tracking::Tracker::search_
SearchPtr search_
A pointer to the spatial search object.
Definition tracker.h:93
pcl::tracking::Tracker::tracker_name_
std::string tracker_name_
The tracker name.
Definition tracker.h:90
pcl::tracking::Tracker::PointCloudIn
pcl::PointCloud< PointInT > PointCloudIn
Definition tracker.h:70
pcl::tracking::Tracker::PointCloudState
pcl::PointCloud< StateT > PointCloudState
Definition tracker.h:74
pcl::tracking
Definition approx_nearest_pair_point_cloud_coherence.h:7
pcl
Definition convolution.h:46