Point Cloud Library (PCL)  1.9.1-dev
particle_filter.h
1 #pragma once
2 
3 #include <pcl/pcl_macros.h>
4 #include <pcl/gpu/containers/device_array.h>
5 
6 #include <pcl/point_types.h>
7 #include <pcl/point_cloud.h>
8 #include <pcl/PointIndices.h>
9 #include <pcl/pcl_macros.h>
10 
11 #include <pcl/gpu/kinfu/pixel_rgb.h>
12 #include <pcl/tracking/particle_filter.h>
13 
14 #include <Eigen/Dense>
15 
16 #include "internal.h"
17 
18 namespace pcl
19 {
20  namespace gpu
21  {
23  {
24  public:
25  /** \brief Point type supported */
27  //using NormalType = pcl::Normal;
28  using PixelRGB = pcl::RGB;
29 
32 
34 
35  /** \brief Empty constructor. */
37  //: ParticleFilterTracker<PointInT, StateT> ()
38  {
39  tracker_name_ = "ParticleFilterGPUTracker";
40  }
41 
42  /** \brief set the number of the particles.
43  * \param particle_num the number of the particles.
44  */
45  inline void
46  setParticleNum (const int particle_num) { particle_num_ = particle_num; }
47 
48  /** \brief get the number of the particles. */
49  inline int
50  getParticleNum () const { return particle_num_; }
51 
52  /** \brief set a pointer to a reference dataset to be tracked.
53  * \param ref a pointer to a PointCloud message
54  */
55  inline void
57 
58  /** \brief get a pointer to a reference dataset to be tracked. */
59  inline DeviceArray2D<PointType> const
60  getReferenceCloud () { return ref_; }
61 
62  int
63  cols ();
64 
65  int
66  rows ();
67 
68  virtual bool
70  {
71 
72  }
73 
74  virtual void
76  { motion_ = motion; }
77 
78  virtual StateType
79  getResult();
80 
81  protected:
82  std::string tracker_name_;
83 
84  virtual bool
86  {
87 
88  //pcl::device::initParticles(particle_num_, particle_xyz_, particle_rpy_, particle_weight_ );
89  }
90 
91  virtual void
93  {
94 
95  }
96 
97  virtual void
99  {
100  particles_.create( particle_num_ );
101 
102  random_number_generator_.create( particle_num_ );
103 
104  }
105 
106  // reference point cloud
108 
110 
111  //DeviceArray2D<NormalType> ref_normals_;
112 
113  // input point cloud
115 
117 
118  //DeviceArray2D<NormalType> input_normals_;
119 
120  //StateCloud particles_;
122 
123  // random number generate state
125 
127 
128  std::vector<float> step_noise_covariance_;
129 
130  std::vector<float> initial_noise_covariance_;
131 
132  std::vector<float> initial_noise_mean_;
133 
135 
137 
139 
141 
142  /** \brief Height of input depth image. */
143  int rows_;
144  /** \brief Width of input depth image. */
145  int cols_;
146 
147  };
148  }
149 }
virtual bool operator()(const DeviceArray2D< PointType > &input, const DeviceArray2D< PixelRGB > &input_colors)
void setReferenceCloud(const DeviceArray2D< PointType > &ref)
set a pointer to a reference dataset to be tracked.
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
DeviceArray< StateType > particles_
void setParticleNum(const int particle_num)
set the number of the particles.
DeviceArray2D class
Definition: device_array.h:153
std::vector< float > initial_noise_mean_
int getParticleNum() const
get the number of the particles.
DeviceArray2D< PixelRGB > input_colors_
DeviceArray2D< PointType > input_
A structure representing RGB color information.
DeviceArray class
Definition: device_array.h:56
A point structure representing Euclidean xyz coordinates.
DeviceArray2D< PointType > ref_
int cols_
Width of input depth image.
int rows_
Height of input depth image.
DeviceArray2D< PixelRGB > ref_colors_
std::vector< float > initial_noise_covariance_
virtual void setMotion(StateType motion)
std::vector< float > step_noise_covariance_
DeviceArray< curandState > rng_states
ParticleFilterGPUTracker()
Empty constructor.
DeviceArray2D< PointType > const getReferenceCloud()
get a pointer to a reference dataset to be tracked.