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