Point Cloud Library (PCL)  1.9.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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  {
72  tracker_name_ = "KLDAdaptiveParticleFilterOMPTracker";
73 
74  setNumberOfThreads(nr_threads);
75  }
76 
77  /** \brief Initialize the scheduler and set the number of threads to use.
78  * \param nr_threads the number of hardware threads to use (0 sets the value back to automatic)
79  */
80  void
81  setNumberOfThreads (unsigned int nr_threads = 0);
82 
83  protected:
84  /** \brief The number of threads the scheduler should use. */
85  unsigned int threads_;
86 
87  /** \brief weighting phase of particle filter method.
88  calculate the likelihood of all of the particles and set the weights.
89  */
90  virtual void weight ();
91 
92  };
93  }
94 }
95 
96 //#include <pcl/tracking/impl/particle_filter_omp.hpp>
97 #ifdef PCL_NO_PRECOMPILE
98 #include <pcl/tracking/impl/kld_adaptive_particle_filter_omp.hpp>
99 #endif
100 
101 #endif
boost::shared_ptr< PointCloud< PointInT > > Ptr
Definition: point_cloud.h:428
KLDAdaptiveParticleFilterTracker tracks the PointCloud which is given by setReferenceCloud within the...
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
KLDAdaptiveParticleFilterOMPTracker tracks the PointCloud which is given by setReferenceCloud within ...
boost::shared_ptr< const PointCloud< PointInT > > ConstPtr
Definition: point_cloud.h:429
boost::shared_ptr< const CloudCoherence > CloudCoherenceConstPtr
PointCoherence is a base class to compute coherence between the two points.
Definition: coherence.h:17
Tracker< PointInT, StateT >::PointCloudState PointCloudState
PointCloudCoherence is a base class to compute coherence between the two PointClouds.
Definition: coherence.h:60
Tracker represents the base tracker class.
Definition: tracker.h:56
unsigned int threads_
The number of threads the scheduler should use.
virtual void weight()
weighting phase of particle filter method.
KLDAdaptiveParticleFilterOMPTracker(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
std::string tracker_name_
The tracker name.
Definition: tracker.h:92