Point Cloud Library (PCL)  1.11.1-dev
kld_adaptive_particle_filter_omp.h
1 #pragma once
2 
3 #include <pcl/tracking/coherence.h>
4 #include <pcl/tracking/kld_adaptive_particle_filter.h>
5 #include <pcl/tracking/tracking.h>
6 
7 namespace pcl {
8 namespace tracking {
9 /** \brief @b KLDAdaptiveParticleFilterOMPTracker tracks the PointCloud which is given
10  * by setReferenceCloud within the measured PointCloud using particle filter method. The
11  * number of the particles changes adaptively based on KLD sampling [D. Fox, NIPS-01],
12  * [D.Fox, IJRR03]. and the computation of the weights of the particles is parallelized
13  * using OpenMP.
14  * \author Ryohei Ueda
15  * \ingroup tracking
16  */
17 template <typename PointInT, typename StateT>
19 : public KLDAdaptiveParticleFilterTracker<PointInT, StateT> {
20 public:
41  // using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::calcLikelihood;
45 
47 
48  using Ptr = shared_ptr<KLDAdaptiveParticleFilterOMPTracker<PointInT, StateT>>;
49  using ConstPtr =
50  shared_ptr<const KLDAdaptiveParticleFilterOMPTracker<PointInT, StateT>>;
51 
53  using PointCloudInPtr = typename PointCloudIn::Ptr;
54  using PointCloudInConstPtr = typename PointCloudIn::ConstPtr;
55 
57  using PointCloudStatePtr = typename PointCloudState::Ptr;
58  using PointCloudStateConstPtr = typename PointCloudState::ConstPtr;
59 
61  using CoherencePtr = typename Coherence::Ptr;
63 
67 
68  /** \brief Initialize the scheduler and set the number of threads to use.
69  * \param nr_threads the number of hardware threads to use (0 sets the value
70  * back to automatic)
71  */
72  KLDAdaptiveParticleFilterOMPTracker(unsigned int nr_threads = 0)
73  : KLDAdaptiveParticleFilterTracker<PointInT, StateT>()
74  {
75  tracker_name_ = "KLDAdaptiveParticleFilterOMPTracker";
76 
77  setNumberOfThreads(nr_threads);
78  }
79 
80  /** \brief Initialize the scheduler and set the number of threads to use.
81  * \param nr_threads the number of hardware threads to use (0 sets the value back to
82  * automatic)
83  */
84  void
85  setNumberOfThreads(unsigned int nr_threads = 0);
86 
87 protected:
88  /** \brief The number of threads the scheduler should use. */
89  unsigned int threads_;
90 
91  /** \brief weighting phase of particle filter method. calculate the likelihood of all
92  * of the particles and set the weights.
93  */
94  void
95  weight() override;
96 };
97 } // namespace tracking
98 } // namespace pcl
99 
100 //#include <pcl/tracking/impl/particle_filter_omp.hpp>
101 #ifdef PCL_NO_PRECOMPILE
102 #include <pcl/tracking/impl/kld_adaptive_particle_filter_omp.hpp>
103 #endif
pcl::tracking::KLDAdaptiveParticleFilterTracker::ConstPtr
shared_ptr< const KLDAdaptiveParticleFilterTracker< PointInT, StateT > > ConstPtr
Definition: kld_adaptive_particle_filter.h:46
pcl::tracking::KLDAdaptiveParticleFilterTracker::CoherenceConstPtr
typename Coherence::ConstPtr CoherenceConstPtr
Definition: kld_adaptive_particle_filter.h:58
pcl
Definition: convolution.h:46
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker::weight
void weight() override
weighting phase of particle filter method.
Definition: kld_adaptive_particle_filter_omp.hpp:27
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::PointCloudCoherence::ConstPtr
shared_ptr< const PointCloudCoherence< PointInT > > ConstPtr
Definition: coherence.h:62
pcl::tracking::KLDAdaptiveParticleFilterTracker::PointCloudInPtr
typename PointCloudIn::Ptr PointCloudInPtr
Definition: kld_adaptive_particle_filter.h:49
pcl::tracking::KLDAdaptiveParticleFilterTracker::PointCloudIn
typename Tracker< PointInT, StateT >::PointCloudIn PointCloudIn
Definition: kld_adaptive_particle_filter.h:48
pcl::tracking::PointCoherence::Ptr
shared_ptr< PointCoherence< PointInT > > Ptr
Definition: coherence.h:17
pcl::tracking::KLDAdaptiveParticleFilterTracker::CloudCoherenceConstPtr
typename CloudCoherence::ConstPtr CloudCoherenceConstPtr
Definition: kld_adaptive_particle_filter.h:62
pcl::tracking::KLDAdaptiveParticleFilterTracker::CloudCoherencePtr
typename CloudCoherence::Ptr CloudCoherencePtr
Definition: kld_adaptive_particle_filter.h:61
pcl::PointCloud< PointInT >
pcl::tracking::KLDAdaptiveParticleFilterTracker::PointCloudStatePtr
typename PointCloudState::Ptr PointCloudStatePtr
Definition: kld_adaptive_particle_filter.h:53
pcl::tracking::Tracker::tracker_name_
std::string tracker_name_
The tracker name.
Definition: tracker.h:90
pcl::tracking::KLDAdaptiveParticleFilterTracker::CoherencePtr
typename Coherence::Ptr CoherencePtr
Definition: kld_adaptive_particle_filter.h:57
pcl::tracking::KLDAdaptiveParticleFilterTracker::PointCloudState
typename Tracker< PointInT, StateT >::PointCloudState PointCloudState
Definition: kld_adaptive_particle_filter.h:52
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::PointCoherence::ConstPtr
shared_ptr< const PointCoherence< PointInT > > ConstPtr
Definition: coherence.h:18
pcl::tracking::KLDAdaptiveParticleFilterTracker::PointCloudInConstPtr
typename PointCloudIn::ConstPtr PointCloudInConstPtr
Definition: kld_adaptive_particle_filter.h:50
pcl::tracking::KLDAdaptiveParticleFilterOMPTracker
KLDAdaptiveParticleFilterOMPTracker tracks the PointCloud which is given by setReferenceCloud within ...
Definition: kld_adaptive_particle_filter_omp.h:18
pcl::tracking::PointCloudCoherence
PointCloudCoherence is a base class to compute coherence between the two PointClouds.
Definition: coherence.h:59
pcl::tracking::KLDAdaptiveParticleFilterTracker::Ptr
shared_ptr< KLDAdaptiveParticleFilterTracker< PointInT, StateT > > Ptr
Definition: kld_adaptive_particle_filter.h:45
pcl::tracking::PointCoherence
PointCoherence is a base class to compute coherence between the two points.
Definition: coherence.h:15
pcl::tracking::PointCloudCoherence::Ptr
shared_ptr< PointCloudCoherence< PointInT > > Ptr
Definition: coherence.h:61
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::Tracker
Tracker represents the base tracker class.
Definition: tracker.h:55
pcl::tracking::KLDAdaptiveParticleFilterTracker
KLDAdaptiveParticleFilterTracker tracks the PointCloud which is given by setReferenceCloud within the...
Definition: kld_adaptive_particle_filter.h:18
pcl::tracking::KLDAdaptiveParticleFilterTracker::PointCloudStateConstPtr
typename PointCloudState::ConstPtr PointCloudStateConstPtr
Definition: kld_adaptive_particle_filter.h:54