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