00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00033 #ifndef _TYPES_DECLARATION_H_
00034 #define _TYPES_DECLARATION_H_
00035
00036 #error This file should not be used, DEPRECATED
00037
00038 #include <ros/ros.h>
00039
00040 #include <kfilter/ekfilter.hpp>
00041
00042 #include <Eigen/Dense>
00043 #include <Eigen/Cholesky>
00044
00045 #include <visualization_msgs/Marker.h>
00046 #include <visualization_msgs/MarkerArray.h>
00047
00048 using namespace std;
00049 using namespace ros;
00050 using namespace Kalman;
00051
00052 using Eigen::Matrix4d;
00053 using Eigen::Matrix2d;
00054 using Eigen::Vector2d;
00055 using Eigen::Vector4d;
00056 using Eigen::MatrixXd;
00057 using Eigen::VectorXd;
00058
00074 class constant_velocity_ekfilter:public EKFilter<double,0,false,false,false>
00075 {
00076 public:
00077
00087 void SetIdentity(Matrix& M,int size,double value=1);
00088
00097 void SetZero(Matrix& M,int size);
00098
00105 void InitFilter(Vector4d& x_init);
00106
00107 protected:
00108
00110 double dt;
00112 Time lt;
00113
00114 Vector4d x_predicted;
00115 Vector2d z_measured;
00116 Vector2d inovation_error;
00117
00123 void makeCommonProcess();
00124
00128 void makeBaseA();
00129
00133 void makeA();
00134
00138 void makeBaseH();
00139
00143 void makeBaseW();
00144
00148 void makeBaseV();
00149
00153 void makeR();
00154
00158 void makeQ();
00159
00163 void makeProcess();
00164
00168 void makeMeasure();
00169 };
00170
00176 typedef EKFilter<double,0,false,false,false>::Vector Vector;
00177
00183 typedef EKFilter<double,0,false,false,false>::Matrix Matrix;
00184
00186 typedef boost::shared_ptr<constant_velocity_ekfilter> constant_velocity_ekfilterPtr;
00187
00188 class t_cluster;
00190 typedef boost::shared_ptr<t_cluster> t_clusterPtr;
00191
00195 class t_point
00196 {
00197 public:
00198
00199 t_point();
00200
00204 void SetZero();
00205
00209 t_point& operator+=(const t_point &rhs);
00210
00216 void Scale(double val);
00217
00219 double x;
00221 double y;
00223 double z;
00225 double r;
00227 double t;
00229 double n;
00231 double ni;
00232
00233 t_clusterPtr cl;
00234 private:
00235 };
00236
00238 typedef boost::shared_ptr<t_point> t_pointPtr;
00239
00243 class t_cluster
00244 {
00245 public:
00247 vector<t_pointPtr> points;
00249 t_point centroid;
00251 double id;
00253 vector<int> associations;
00254
00255 t_cluster();
00256
00257 t_cluster & operator=(const t_cluster &rhs);
00258
00266 bool BreakPointDetector(t_pointPtr&pt,t_pointPtr&pt_m1);
00267
00271 void CalculateCentroid(void);
00272
00273 private:
00274 };
00275
00282 class t_node
00283 {
00284
00285
00286 public:
00288 t_cluster local_cluster;
00290 constant_velocity_ekfilter estimator;
00292 Vector4d x;
00294 Vector4d x_p;
00296 Vector2d z;
00298 Matrix4d P;
00300 int failed_associations_counter;
00302 int successful_association_counter;
00304 long age;
00306 enum e_mode {NEW,MAIN,SIBLING,FAILED,TEST} mode;
00308 long id;
00310 long data_iteration;
00311
00313 visualization_msgs::Marker marker;
00314
00321 void IncreaseAge(int increment=1);
00322
00326 void Step();
00327
00335 t_node(t_cluster&cluster,long iteration);
00336
00345 t_node(t_node&node,t_cluster&cluster,long iteration);
00346
00354 t_node(t_node&node,long iteration);
00355
00359 void CommonConstructor();
00360
00364 ~t_node(void);
00365
00369 string GetName();
00370
00371 private:
00372 };
00373
00375 typedef boost::shared_ptr<t_node> t_nodePtr;
00376
00384 ostream& operator<< (ostream &o, const t_nodePtr &i);
00385
00386
00387 #endif