Point Cloud Library (PCL)  1.14.1-dev
particle_filter_omp.h
1 #pragma once
2 
3 #include <pcl/tracking/coherence.h>
4 #include <pcl/tracking/particle_filter.h>
5 #include <pcl/tracking/tracking.h>
6 
7 namespace pcl {
8 namespace tracking {
9 /** \brief @b ParticleFilterOMPTracker tracks the PointCloud which is given by
10  * setReferenceCloud within the measured PointCloud using particle filter method in
11  * parallel, using the OpenMP standard. \author Ryohei Ueda \ingroup tracking
12  */
13 template <typename PointInT, typename StateT>
14 class ParticleFilterOMPTracker : public ParticleFilterTracker<PointInT, StateT> {
15 public:
33  // using ParticleFilterTracker<PointInT, StateT>::calcLikelihood;
37 
39 
41  using PointCloudInPtr = typename PointCloudIn::Ptr;
42  using PointCloudInConstPtr = typename PointCloudIn::ConstPtr;
43 
45  using PointCloudStatePtr = typename PointCloudState::Ptr;
46  using PointCloudStateConstPtr = typename PointCloudState::ConstPtr;
47 
49  using CoherencePtr = typename Coherence::Ptr;
51 
55 
56  /** \brief Initialize the scheduler and set the number of threads to use.
57  * \param nr_threads the number of hardware threads to use (0 sets the value
58  * back to automatic)
59  */
60  ParticleFilterOMPTracker(unsigned int nr_threads = 0)
61  : ParticleFilterTracker<PointInT, StateT>()
62  {
63  tracker_name_ = "ParticleFilterOMPTracker";
64 
65  setNumberOfThreads(nr_threads);
66  }
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  void
73  setNumberOfThreads(unsigned int nr_threads = 0);
74 
75 protected:
76  /** \brief The number of threads the scheduler should use. */
77  unsigned int threads_;
78 
79  /** \brief weighting phase of particle filter method. calculate the likelihood of all
80  * of the particles and set the weights.
81  */
82  void
83  weight() override;
84 };
85 } // namespace tracking
86 } // namespace pcl
87 
88 //#include <pcl/tracking/impl/particle_filter_omp.hpp>
89 #ifdef PCL_NO_PRECOMPILE
90 #include <pcl/tracking/impl/particle_filter_omp.hpp>
91 #endif
ParticleFilterOMPTracker tracks the PointCloud which is given by setReferenceCloud within the measure...
void weight() override
weighting phase of particle filter method.
ParticleFilterOMPTracker(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
unsigned int threads_
The number of threads the scheduler should use.
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
ParticleFilterTracker tracks the PointCloud which is given by setReferenceCloud within the measured P...
typename Coherence::Ptr CoherencePtr
typename PointCloudIn::ConstPtr PointCloudInConstPtr
typename Coherence::ConstPtr CoherenceConstPtr
typename CloudCoherence::Ptr CloudCoherencePtr
typename PointCloudState::Ptr PointCloudStatePtr
typename PointCloudState::ConstPtr PointCloudStateConstPtr
typename PointCloudIn::Ptr PointCloudInPtr
typename Tracker< PointInT, StateT >::PointCloudState PointCloudState
typename CloudCoherence::ConstPtr CloudCoherenceConstPtr
typename Tracker< PointInT, StateT >::PointCloudIn PointCloudIn
PointCloudCoherence is a base class to compute coherence between the two PointClouds.
Definition: coherence.h:59
shared_ptr< PointCloudCoherence< PointInT > > Ptr
Definition: coherence.h:61
shared_ptr< const PointCloudCoherence< PointInT > > ConstPtr
Definition: coherence.h:62
PointCoherence is a base class to compute coherence between the two points.
Definition: coherence.h:15
shared_ptr< const PointCoherence< PointInT > > ConstPtr
Definition: coherence.h:18
shared_ptr< PointCoherence< PointInT > > Ptr
Definition: coherence.h:17
Tracker represents the base tracker class.
Definition: tracker.h:55
std::string tracker_name_
The tracker name.
Definition: tracker.h:90