Point Cloud Library (PCL)  1.10.0-dev
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
typename PointCloudState::Ptr PointCloudStatePtr
typename Tracker< PointInT, StateT >::PointCloudState PointCloudState
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
typename CloudCoherence::Ptr CloudCoherencePtr
typename Coherence::ConstPtr CoherenceConstPtr
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
typename PointCloudIn::ConstPtr PointCloudInConstPtr
void weight() override
weighting phase of particle filter method.
typename Coherence::Ptr CoherencePtr
ParticleFilterTracker tracks the PointCloud which is given by setReferenceCloud within the measured P...
ParticleFilterOMPTracker(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
shared_ptr< PointCoherence< PointInT > > Ptr
Definition: coherence.h:19
shared_ptr< const PointCoherence< PointInT > > ConstPtr
Definition: coherence.h:20
typename Tracker< PointInT, StateT >::PointCloudIn PointCloudIn
PointCoherence is a base class to compute coherence between the two points.
Definition: coherence.h:16
shared_ptr< PointCloudCoherence< PointInT > > Ptr
Definition: coherence.h:62
ParticleFilterOMPTracker tracks the PointCloud which is given by setReferenceCloud within the measure...
PointCloudCoherence is a base class to compute coherence between the two PointClouds.
Definition: coherence.h:59
typename CloudCoherence::ConstPtr CloudCoherenceConstPtr
typename PointCloudIn::Ptr PointCloudInPtr
typename PointCloudState::ConstPtr PointCloudStateConstPtr
Tracker represents the base tracker class.
Definition: tracker.h:56
unsigned int threads_
The number of threads the scheduler should use.
shared_ptr< const PointCloudCoherence< PointInT > > ConstPtr
Definition: coherence.h:63
std::string tracker_name_
The tracker name.
Definition: tracker.h:92