Point Cloud Library (PCL)  1.7.1
kld_adaptive_particle_filter_omp.h
1 #ifndef PCL_TRACKING_KLD_ADAPTIVE_PARTICLE_FILTER_OMP_H_
2 #define PCL_TRACKING_KLD_ADAPTIVE_PARTICLE_FILTER_OMP_H_
3 
4 #include <pcl/tracking/tracking.h>
5 #include <pcl/tracking/kld_adaptive_particle_filter.h>
6 #include <pcl/tracking/coherence.h>
7 
8 namespace pcl
9 {
10  namespace tracking
11  {
12  /** \brief @b KLDAdaptiveParticleFilterOMPTracker tracks the PointCloud which is given by
13  setReferenceCloud within the measured PointCloud using particle filter method.
14  The number of the particles changes adaptively based on KLD sampling [D. Fox, NIPS-01], [D.Fox, IJRR03].
15  and the computation of the weights of the particles is parallelized using OpenMP.
16  * \author Ryohei Ueda
17  * \ingroup tracking
18  */
19  template <typename PointInT, typename StateT>
21  {
22  public:
43  //using KLDAdaptiveParticleFilterTracker<PointInT, StateT>::calcLikelihood;
47 
49 
53 
57 
59  typedef boost::shared_ptr< Coherence > CoherencePtr;
60  typedef boost::shared_ptr< const Coherence > CoherenceConstPtr;
61 
63  typedef boost::shared_ptr< CloudCoherence > CloudCoherencePtr;
64  typedef boost::shared_ptr< const CloudCoherence > CloudCoherenceConstPtr;
65 
66  /** \brief Initialize the scheduler and set the number of threads to use.
67  * \param nr_threads the number of hardware threads to use (0 sets the value back to automatic)
68  */
69  KLDAdaptiveParticleFilterOMPTracker (unsigned int nr_threads = 0)
70  : KLDAdaptiveParticleFilterTracker<PointInT, StateT> ()
71  , threads_ (nr_threads)
72  {
73  tracker_name_ = "KLDAdaptiveParticleFilterOMPTracker";
74  }
75 
76  /** \brief Initialize the scheduler and set the number of threads to use.
77  * \param nr_threads the number of hardware threads to use (0 sets the value back to automatic)
78  */
79  inline void
80  setNumberOfThreads (unsigned int nr_threads = 0) { threads_ = nr_threads; }
81 
82  protected:
83  /** \brief The number of threads the scheduler should use. */
84  unsigned int threads_;
85 
86  /** \brief weighting phase of particle filter method.
87  calculate the likelihood of all of the particles and set the weights.
88  */
89  virtual void weight ();
90 
91  };
92  }
93 }
94 
95 //#include <pcl/tracking/impl/particle_filter_omp.hpp>
96 #ifdef PCL_NO_PRECOMPILE
97 #include <pcl/tracking/impl/kld_adaptive_particle_filter_omp.hpp>
98 #endif
99 
100 #endif