detector_particle.h
Go to the documentation of this file.
1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2008, Willow Garage, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17 * * Neither the name of the Willow Garage nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *********************************************************************/
34 
35 /* Author: Wim Meeussen */
36 
37 #ifndef PEOPLE_TRACKING_FILTER_DETECTOR_PARTICLE_H
38 #define PEOPLE_TRACKING_FILTER_DETECTOR_PARTICLE_H
39 
41 
42 // bayesian filtering
43 #include <bfl/filter/bootstrapfilter.h>
47 
48 // TF
49 #include <tf/tf.h>
50 
51 // msgs
52 #include <sensor_msgs/PointCloud.h>
53 
54 // log files
55 #include <fstream>
56 
57 namespace estimation
58 {
59 
61 {
62 public:
64  explicit DetectorParticle(unsigned int num_particles);
65 
68 
70  void initialize(const tf::Vector3& mu, const tf::Vector3& size, const double time);
71 
73  bool isInitialized() const
74  {
75  return detector_initialized_;
76  };
77 
79  double getQuality() const
80  {
81  return quality_;
82  };
83 
85  bool updatePrediction(const double dt);
86  bool updateCorrection(const tf::Vector3& meas,
87  const MatrixWrapper::SymmetricMatrix& cov,
88  const double time);
89 
91  void getEstimate(tf::Vector3& est) const;
92  void getEstimate(people_msgs::PositionMeasurement& est) const;
93 
94  // get evenly spaced particle cloud
95  void getParticleCloud(const tf::Vector3& step, double threshold, sensor_msgs::PointCloud& cloud) const;
96 
98  MatrixWrapper::Matrix getHistogram(const tf::Vector3& min, const tf::Vector3& max, const tf::Vector3& step) const;
99 
100 private:
101  // pdf / model / filter
106 
107  // vars
110  unsigned int num_particles_;
111 }; // class
112 } // namespace estimation
113 #endif // PEOPLE_TRACKING_FILTER_DETECTOR_PARTICLE_H
void getParticleCloud(const tf::Vector3 &step, double threshold, sensor_msgs::PointCloud &cloud) const
bool isInitialized() const
return if detector was initialized
double getQuality() const
return measure for detector quality: 0=bad 1=good
void getEstimate(tf::Vector3 &est) const
get filter posterior
DetectorParticle(unsigned int num_particles)
constructor
BFL::BootstrapFilter< tf::Vector3, tf::Vector3 > * filter_
Class representing a vector mcpdf.
Definition: mcpdf_vector.h:47
BFL::MeasModelVector meas_model_
bool updatePrediction(const double dt)
update detector
MatrixWrapper::Matrix getHistogram(const tf::Vector3 &min, const tf::Vector3 &max, const tf::Vector3 &step) const
Get histogram from certain area.
unsigned int step
int min(int a, int b)
bool updateCorrection(const tf::Vector3 &meas, const MatrixWrapper::SymmetricMatrix &cov, const double time)
void initialize(const tf::Vector3 &mu, const tf::Vector3 &size, const double time)
initialize detector
BFL::SysModelVector sys_model_


people_tracking_filter
Author(s): Caroline Pantofaru
autogenerated on Sun Feb 21 2021 03:56:47