types_declaration.h
Go to the documentation of this file.
1 /**************************************************************************************************
2  Software License Agreement (BSD License)
3 
4  Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt
5  All rights reserved.
6 
7  Redistribution and use in source and binary forms, with or without modification, are permitted
8  provided that the following conditions are met:
9 
10  *Redistributions of source code must retain the above copyright notice, this list of
11  conditions and the following disclaimer.
12  *Redistributions in binary form must reproduce the above copyright notice, this list of
13  conditions and the following disclaimer in the documentation and/or other materials provided
14  with the distribution.
15  *Neither the name of the University of Aveiro nor the names of its contributors may be used to
16  endorse or promote products derived from this software without specific prior written permission.
17 
18  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 ***************************************************************************************************/
33 #ifndef _TYPES_DECLARATION_H_
34 #define _TYPES_DECLARATION_H_
35 
36 #error This file should not be used, DEPRECATED
37 
38 #include <ros/ros.h>
39 
40 #include <kfilter/ekfilter.hpp>
41 
42 #include <Eigen/Dense>
43 #include <Eigen/Cholesky>
44 
45 #include <visualization_msgs/Marker.h>
46 #include <visualization_msgs/MarkerArray.h>
47 
48 using namespace std;
49 using namespace ros;
50 using namespace Kalman;
51 
52 using Eigen::Matrix4d;
53 using Eigen::Matrix2d;
54 using Eigen::Vector2d;
55 using Eigen::Vector4d;
56 using Eigen::MatrixXd;
57 using Eigen::VectorXd;
58 
74 class constant_velocity_ekfilter:public EKFilter<double,0,false,false,false>
75 {
76  public:
77 
87  void SetIdentity(Matrix& M,int size,double value=1);
88 
97  void SetZero(Matrix& M,int size);
98 
105  void InitFilter(Vector4d& x_init);
106 
107  protected:
108 
110  double dt;
112  Time lt;
113 
114  Vector4d x_predicted;
115  Vector2d z_measured;
116  Vector2d inovation_error;
117 
123  void makeCommonProcess();
124 
128  void makeBaseA();
129 
133  void makeA();
134 
138  void makeBaseH();
139 
143  void makeBaseW();
144 
148  void makeBaseV();
149 
153  void makeR();
154 
158  void makeQ();
159 
163  void makeProcess();
164 
168  void makeMeasure();
169 };
170 
177 
184 
186 typedef boost::shared_ptr<constant_velocity_ekfilter> constant_velocity_ekfilterPtr;
187 
188 class t_cluster;/*this declaration has been pulled up because class t_point needs it*/
190 typedef boost::shared_ptr<t_cluster> t_clusterPtr;
191 
195 class t_point
196 {
197  public:
198 
199  t_point();
200 
204  void SetZero();
205 
209  t_point& operator+=(const t_point &rhs);
210 
216  void Scale(double val);
217 
219  double x;
221  double y;
223  double z;
225  double r;
227  double t;
229  double n;
231  double ni;
232 
234  private:
235 };
236 
238 typedef boost::shared_ptr<t_point> t_pointPtr;
239 
244 {
245  public:
247  vector<t_pointPtr> points;
251  double id;
253  vector<int> associations;
254 
255  t_cluster();
256 
257  t_cluster & operator=(const t_cluster &rhs);
258 
266  bool BreakPointDetector(t_pointPtr&pt,t_pointPtr&pt_m1);
267 
271  void CalculateCentroid(void);
272 
273  private:
274 };
275 
282 class t_node
283 {
284  //nodes will use IMM to predict and estimate positions, maybe even using kalman smother
285 
286  public:
292  Vector4d x;
294  Vector4d x_p;
296  Vector2d z;
298  Matrix4d P;
304  long age;
306  enum e_mode {NEW,MAIN,SIBLING,FAILED,TEST} mode;
308  long id;
311 
313  visualization_msgs::Marker marker;
314 
321  void IncreaseAge(int increment=1);
322 
326  void Step();
327 
335  t_node(t_cluster&cluster,long iteration);
336 
345  t_node(t_node&node,t_cluster&cluster,long iteration);
346 
354  t_node(t_node&node,long iteration);
355 
359  void CommonConstructor();
360 
364  ~t_node(void);
365 
369  string GetName();
370 
371  private:
372 };
373 
375 typedef boost::shared_ptr<t_node> t_nodePtr;
376 
384 ostream& operator<< (ostream &o, const t_nodePtr &i);
385 
386 
387 #endif
EKFilter< double, 0, false, false, false >::Matrix Matrix
EKfilter matrix type.
Constant velocity Kalman filter.
constant_velocity_ekfilter estimator
Local estimator for process, Kalman filter with a constant velocity.
double n
auxiliary identifier
t_clusterPtr cl
long id
Id of the node.
boost::shared_ptr< constant_velocity_ekfilter > constant_velocity_ekfilterPtr
Shared pointer to the Kalman constant velocity filter.
long iteration
Current iteration counter, used in the naming of tree nodes.
Definition: pmht.cpp:61
long data_iteration
Iteration from the data used in its creation.
Time lt
Time of the last call to the makeCommonProcess function.
vector< int > associations
Association vector, multiple associations maybe possible.
boost::shared_ptr< t_node > t_nodePtr
Shared pointer to the t_node class.
t_point centroid
Centroid of the cluster.
double ni
auxiliary identifier 2
double x
x coordinate (Cartesian)
vector< NodePtr > & operator+=(vector< NodePtr > &a, vector< NodePtr > &b)
Definition: k_best.cpp:149
vector< t_pointPtr > points
Vector of the support points of the cluster.
double z
z coordinate (Cartesian)
long age
Number of iterations that this node suffered.
t_cluster local_cluster
Support points for this node.
double dt
Time interval between measurements.
Timer t
Definition: k_best.cpp:34
Definition: matrix.h:32
double y
y coordinate (Cartesian)
Cluster type class, clusters are groups of points in close proximity.
Vector2d z
Measurement vector.
boost::shared_ptr< t_point > t_pointPtr
Shared pointer to the t_point class.
Class handler for tree nodes.
visualization_msgs::Marker marker
Marker for rviz.
boost::shared_ptr< t_cluster > t_clusterPtr
Shared pointer to the t_cluster class.
int failed_associations_counter
Number of iterations with failed associations.
EKFilter< double, 0, false, false, false >::Vector Vector
EKfilter vector type.
Matrix4d P
Posteriori error covariance.
st_cluster t_cluster
Definition: mtt_common.h:109
Vector4d x_p
Predicted x.
double id
Id of the cluster.
Vector4d x
Estimated state.
Polar point structure.
Definition: mtt_common.h:126
int successful_association_counter
Number of iterations with successful associations.
ostream & operator<<(ostream &o, const t_nodePtr &i)
Overload of the operator << for the t_nodePtr typedef.
e_mode
associations


mtt
Author(s): Jorge Almeida
autogenerated on Mon Mar 2 2015 01:32:18