1#ifndef PCL_TRACKING_IMPL_KLD_ADAPTIVE_PARTICLE_FILTER_H_
2#define PCL_TRACKING_IMPL_KLD_ADAPTIVE_PARTICLE_FILTER_H_
4#include <pcl/tracking/kld_adaptive_particle_filter.h>
8template <
typename Po
intInT,
typename StateT>
13 PCL_ERROR(
"[pcl::%s::initCompute] Init failed.\n",
getClassName().c_str());
36template <
typename Po
intInT,
typename StateT>
39 std::vector<int>&& new_bin, std::vector<std::vector<int>>& bins)
41 for (
auto& existing_bin : bins) {
45 bins.push_back(std::move(new_bin));
49template <
typename Po
intInT,
typename StateT>
56 std::vector<std::vector<int>> bins;
63 const std::vector<double> zero_mean(StateT::stateDimension(), 0.0);
68 StateT x_t = (*particles_)[j_n];
75 S->points.push_back(x_t);
77 std::vector<int> new_bin(StateT::stateDimension());
78 for (
int i = 0; i < StateT::stateDimension(); i++)
79 new_bin[i] =
static_cast<int>(x_t[i] /
bin_size_[i]);
93#define PCL_INSTANTIATE_KLDAdaptiveParticleFilterTracker(T, ST) \
94 template class PCL_EXPORTS pcl::tracking::KLDAdaptiveParticleFilterTracker<T, ST>;
PointCloudConstPtr input_
Octree pointcloud change detector class
virtual double calcKLBound(int k)
calculate K-L boundary.
void resample() override
resampling phase of particle filter method.
unsigned int maximum_particle_number_
the maximum number of the particles.
virtual bool insertIntoBins(std::vector< int > &&new_bin, std::vector< std::vector< int > > &bins)
insert a bin into the set of the bins.
typename Tracker< PointInT, StateT >::PointCloudIn PointCloudIn
typename PointCloudIn::Ptr PointCloudInPtr
StateT bin_size_
the size of a bin.
typename PointCloudState::Ptr PointCloudStatePtr
typename Tracker< PointInT, StateT >::PointCloudState PointCloudState
bool initCompute() override
This method should get called before starting the actual computation.
virtual bool equalBin(const std::vector< int > &a, const std::vector< int > &b)
return true if the two bins are equal.
void genAliasTable(std::vector< int > &a, std::vector< double > &q, const PointCloudStateConstPtr &particles)
Generate the tables for walker's alias method.
double motion_ratio_
Ratio of hypothesis to use motion model.
void initParticles(bool reset)
Initialize the particles.
CloudCoherencePtr coherence_
A pointer to PointCloudCoherence.
int sampleWithReplacement(const std::vector< int > &a, const std::vector< double > &q)
Implementation of "sample with replacement" using Walker's alias method.
pcl::octree::OctreePointCloudChangeDetector< PointInT >::Ptr change_detector_
Change detector used as a trigger to track.
double change_detector_resolution_
Resolution of change detector.
std::vector< double > step_noise_covariance_
The diagonal elements of covariance matrix of the step noise.
std::vector< PointCloudInPtr > transed_reference_vector_
A list of the pointers to pointclouds.
PointCloudStatePtr particles_
A pointer to the particles.
int particle_num_
The number of the particles.
StateT motion_
Difference between the result in t and t-1.
const std::string & getClassName() const
Get a string representation of the name of this class.
virtual bool initCompute()
This method should get called before starting the actual computation.