Point Cloud Library (PCL)  1.11.0
particle_filter_omp.h
1 #pragma once
2 
3 #include <pcl/tracking/tracking.h>
4 #include <pcl/tracking/particle_filter.h>
5 #include <pcl/tracking/coherence.h>
6 
7 namespace pcl
8 {
9  namespace tracking
10  {
11  /** \brief @b ParticleFilterOMPTracker tracks the PointCloud which is given by
12  setReferenceCloud within the measured PointCloud using particle filter method
13  in parallel, using the OpenMP standard.
14  * \author Ryohei Ueda
15  * \ingroup tracking
16  */
17  template <typename PointInT, typename StateT>
18  class ParticleFilterOMPTracker: public ParticleFilterTracker<PointInT, StateT>
19  {
20  public:
38  //using ParticleFilterTracker<PointInT, StateT>::calcLikelihood;
42 
44 
46  using PointCloudInPtr = typename PointCloudIn::Ptr;
47  using PointCloudInConstPtr = typename PointCloudIn::ConstPtr;
48 
50  using PointCloudStatePtr = typename PointCloudState::Ptr;
51  using PointCloudStateConstPtr = typename PointCloudState::ConstPtr;
52 
54  using CoherencePtr = typename Coherence::Ptr;
56 
60 
61  /** \brief Initialize the scheduler and set the number of threads to use.
62  * \param nr_threads the number of hardware threads to use (0 sets the value back to automatic)
63  */
64  ParticleFilterOMPTracker (unsigned int nr_threads = 0)
65  : ParticleFilterTracker<PointInT, StateT> ()
66  {
67  tracker_name_ = "ParticleFilterOMPTracker";
68 
69  setNumberOfThreads(nr_threads);
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  void
76  setNumberOfThreads (unsigned int nr_threads = 0);
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  void weight () override;
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
pcl
Definition: convolution.h:46
pcl::tracking::ParticleFilterTracker
ParticleFilterTracker tracks the PointCloud which is given by setReferenceCloud within the measured P...
Definition: particle_filter.h:24
pcl::tracking::PointCloudCoherence::ConstPtr
shared_ptr< const PointCloudCoherence< PointInT > > ConstPtr
Definition: coherence.h:63
pcl::tracking::ParticleFilterTracker::CloudCoherenceConstPtr
typename CloudCoherence::ConstPtr CloudCoherenceConstPtr
Definition: particle_filter.h:54
pcl::tracking::PointCoherence::Ptr
shared_ptr< PointCoherence< PointInT > > Ptr
Definition: coherence.h:19
pcl::tracking::ParticleFilterOMPTracker
ParticleFilterOMPTracker tracks the PointCloud which is given by setReferenceCloud within the measure...
Definition: particle_filter_omp.h:19
pcl::PointCloud< PointInT >
pcl::tracking::Tracker::tracker_name_
std::string tracker_name_
The tracker name.
Definition: tracker.h:93
pcl::tracking::ParticleFilterTracker::PointCloudIn
typename Tracker< PointInT, StateT >::PointCloudIn PointCloudIn
Definition: particle_filter.h:40
pcl::tracking::PointCoherence::ConstPtr
shared_ptr< const PointCoherence< PointInT > > ConstPtr
Definition: coherence.h:20
pcl::tracking::ParticleFilterTracker::CloudCoherencePtr
typename CloudCoherence::Ptr CloudCoherencePtr
Definition: particle_filter.h:53
pcl::tracking::ParticleFilterOMPTracker::setNumberOfThreads
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
Definition: particle_filter_omp.hpp:8
pcl::tracking::ParticleFilterTracker::PointCloudInConstPtr
typename PointCloudIn::ConstPtr PointCloudInConstPtr
Definition: particle_filter.h:42
pcl::tracking::ParticleFilterTracker::PointCloudState
typename Tracker< PointInT, StateT >::PointCloudState PointCloudState
Definition: particle_filter.h:44
pcl::tracking::ParticleFilterTracker::PointCloudInPtr
typename PointCloudIn::Ptr PointCloudInPtr
Definition: particle_filter.h:41
pcl::tracking::ParticleFilterTracker::CoherencePtr
typename Coherence::Ptr CoherencePtr
Definition: particle_filter.h:49
pcl::tracking::ParticleFilterOMPTracker::threads_
unsigned int threads_
The number of threads the scheduler should use.
Definition: particle_filter_omp.h:80
pcl::tracking::PointCloudCoherence
PointCloudCoherence is a base class to compute coherence between the two PointClouds.
Definition: coherence.h:60
pcl::tracking::PointCoherence
PointCoherence is a base class to compute coherence between the two points.
Definition: coherence.h:17
pcl::tracking::ParticleFilterTracker::CoherenceConstPtr
typename Coherence::ConstPtr CoherenceConstPtr
Definition: particle_filter.h:50
pcl::tracking::ParticleFilterOMPTracker::weight
void weight() override
weighting phase of particle filter method.
Definition: particle_filter_omp.hpp:22
pcl::tracking::PointCloudCoherence::Ptr
shared_ptr< PointCloudCoherence< PointInT > > Ptr
Definition: coherence.h:62
pcl::tracking::ParticleFilterTracker::PointCloudStatePtr
typename PointCloudState::Ptr PointCloudStatePtr
Definition: particle_filter.h:45
pcl::tracking::ParticleFilterTracker::PointCloudStateConstPtr
typename PointCloudState::ConstPtr PointCloudStateConstPtr
Definition: particle_filter.h:46
pcl::tracking::ParticleFilterOMPTracker::ParticleFilterOMPTracker
ParticleFilterOMPTracker(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
Definition: particle_filter_omp.h:64
pcl::tracking::Tracker
Tracker represents the base tracker class.
Definition: tracker.h:58