MultiJointTracker.h
Go to the documentation of this file.
1 /*
2  * MultiJointTracker.h
3  *
4  * Author: roberto
5  *
6  * This is a modified implementation of the method for online estimation of kinematic structures described in our paper
7  * "Online Interactive Perception of Articulated Objects with Multi-Level Recursive Estimation Based on Task-Specific Priors"
8  * (Martín-Martín and Brock, 2014).
9  * This implementation can be used to reproduce the results of the paper and to be applied to new research.
10  * The implementation allows also to be extended to perceive different information/models or to use additional sources of information.
11  * A detail explanation of the method and the system can be found in our paper.
12  *
13  * If you are using this implementation in your research, please consider citing our work:
14  *
15 @inproceedings{martinmartin_ip_iros_2014,
16 Title = {Online Interactive Perception of Articulated Objects with Multi-Level Recursive Estimation Based on Task-Specific Priors},
17 Author = {Roberto {Mart\'in-Mart\'in} and Oliver Brock},
18 Booktitle = {Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems},
19 Pages = {2494-2501},
20 Year = {2014},
21 Location = {Chicago, Illinois, USA},
22 Note = {http://www.robotics.tu-berlin.de/fileadmin/fg170/Publikationen_pdf/martinmartin_ip_iros_2014.pdf},
23 Url = {http://www.robotics.tu-berlin.de/fileadmin/fg170/Publikationen_pdf/martinmartin_ip_iros_2014.pdf},
24 Projectname = {Interactive Perception}
25 }
26  * If you have questions or suggestions, contact us:
27  * roberto.martinmartin@tu-berlin.de
28  *
29  * Enjoy!
30  */
31 
32 #ifndef JOINT_TRACKER_H_
33 #define JOINT_TRACKER_H_
34 
36 
37 #include "omip_msgs/RigidBodyPosesAndVelsMsg.h"
38 #include "omip_msgs/RigidBodyPoseAndVelMsg.h"
39 
40 #include "omip_msgs/RigidBodyTwistsWithCovMsg.h"
41 
43 
45 
46 namespace omip
47 {
48 
50 {
54 };
55 
56 typedef std::map<std::pair<int, int>, JointCombinedFilterPtr> joint_combined_filters_map;
57 
61 class MultiJointTracker : public RecursiveEstimatorFilterInterface<ks_state_t, ks_measurement_t>
62 {
63 public:
64  MultiJointTracker(double loop_period_ns, ks_analysis_t ks_analysis_type, double dj_ne);
65 
66  virtual ~MultiJointTracker();
67 
72  virtual void predictState(double time_interval_ns);
73 
78  virtual void predictMeasurement();
79 
83  virtual void setMeasurement(const ks_measurement_t & poses_and_vels, const double& measurement_timestamp_ns);
84 
90  virtual void correctState();
91 
92  virtual void addPredictedState(const ks_state_t &predicted_state , const double& predicted_state_timestamp_ns)
93  {
94  std::cout << "Not implemented" << std::endl;
95  }
96 
97  virtual void setNumSamplesLikelihoodEstimation(int likelihood_sample_num)
98  {
99  this->_likelihood_sample_num = likelihood_sample_num;
100  }
101 
102  virtual void setSigmaDeltaMeasurementUncertaintyLinear(double sigma_delta_meas_uncertainty_linear)
103  {
104  this->_sigma_delta_meas_uncertainty_linear = sigma_delta_meas_uncertainty_linear;
105  }
106 
107  virtual void setSigmaDeltaMeasurementUncertaintyAngular(double sigma_delta_meas_uncertainty_angular)
108  {
109  this->_sigma_delta_meas_uncertainty_angular = sigma_delta_meas_uncertainty_angular;
110  }
111 
112  virtual void setPrismaticPriorCovarianceVelocity(const double& value)
113  {
114  this->_prism_prior_cov_vel = value;
115  }
116 
117  virtual void setPrismaticSigmaSystemNoisePhi(const double& value)
118  {
119  this->_prism_sigma_sys_noise_phi = value;
120  }
121 
122  virtual void setPrismaticSigmaSystemNoiseTheta(const double& value)
123  {
124  this->_prism_sigma_sys_noise_theta = value;
125  }
126 
127  virtual void setPrismaticSigmaSystemNoisePV(const double& value)
128  {
129  this->_prism_sigma_sys_noise_pv = value;
130  }
131 
132  virtual void setPrismaticSigmaSystemNoisePVd(const double& value)
133  {
134  this->_prism_sigma_sys_noise_pvd = value;
135  }
136 
137  virtual void setPrismaticSigmaMeasurementNoise(const double& value)
138  {
139  this->_prism_sigma_meas_noise = value;
140  }
141 
142  virtual void setRevolutePriorCovarianceVelocity(const double& value)
143  {
144  this->_rev_prior_cov_vel = value;
145  }
146 
147  virtual void setRevoluteSigmaSystemNoisePhi(const double& value)
148  {
149  this->_rev_sigma_sys_noise_phi = value;
150  }
151 
152  virtual void setRevoluteSigmaSystemNoiseTheta(const double& value)
153  {
154  this->_rev_sigma_sys_noise_theta = value;
155  }
156 
157  virtual void setRevoluteSigmaSystemNoisePx(const double& value)
158  {
159  this->_rev_sigma_sys_noise_px = value;
160  }
161 
162  virtual void setRevoluteSigmaSystemNoisePy(const double& value)
163  {
164  this->_rev_sigma_sys_noise_py = value;
165  }
166 
167  virtual void setRevoluteSigmaSystemNoisePz(const double& value)
168  {
169  this->_rev_sigma_sys_noise_pz = value;
170  }
171 
172  virtual void setRevoluteSigmaSystemNoiseRV(const double& value)
173  {
174  this->_rev_sigma_sys_noise_rv = value;
175  }
176 
177  virtual void setRevoluteSigmaSystemNoiseRVd(const double& value)
178  {
179  this->_rev_sigma_sys_noise_rvd = value;
180  }
181 
182  virtual void setRevoluteSigmaMeasurementNoise(const double& value)
183  {
184  this->_rev_sigma_meas_noise = value;
185  }
186 
187  virtual void setRevoluteMinimumRotForEstimation(const double& value)
188  {
189  this->_rev_min_rot_for_ee = value;
190  }
191 
192  virtual void setRevoluteMaximumJointDistanceForEstimation(const double& value)
193  {
194  this->_rev_max_joint_distance_for_ee = value;
195  }
196 
197  virtual void setMinimumJointAgeForEE(const int& value)
198  {
199  this->_min_joint_age_for_ee = value;
200  }
201 
202  virtual void setRigidMaxTranslation(const double& value)
203  {
204  this->_rig_max_translation = value;
205  }
206 
207  virtual void setRigidMaxRotation(const double& value)
208  {
209  this->_rig_max_rotation = value;
210  }
211 
212  virtual void setMinimumNumFramesForNewRB(const int& value)
213  {
214  this->_min_num_frames_for_new_rb = value;
215  }
216 
218 
219  virtual void estimateJointFiltersProbabilities();
220 
221 protected:
222 
229  virtual void _reflectState();
230 
233 
234  // One filter for each pair of RBs
235  joint_combined_filters_map _joint_combined_filters;
236 
237  // Reject the first transformations so that the RBM is more stable
238  std::map<std::pair<int, int>, int> _precomputing_counter;
239 
240  // Save the pose of the RRB in the SF when the SRB was born
241  std::map<std::pair<int, int>, Eigen::Twistd > _rrb_pose_at_srb_birthday_in_sf;
242 
243  // Save the pose of the SRB in the SF when the SRB was born
244  std::map<std::pair<int, int>, Eigen::Twistd > _srb_pose_at_srb_birthday_in_sf;
245 
246  omip_msgs::RigidBodyPosesAndVelsMsgPtr _last_rcvd_poses_and_vels;
247 
248 
249  omip_msgs::RigidBodyPosesAndVelsMsgPtr _previous_rcvd_poses_and_vels;
250  // New: 9.8.2016: With the new trajectory initialization of the rigid bodies the first time we receive
251  // the pose of a new rigid body, this rigid body is already min_num_frames_for_new_rb frames old
252  // Therefore, the previous pose of the other rigid bodies is not equal to their pose when the new rigid body was born
253  // CHANGE: we accumulate a vector of poses with maximum lenght min_num_frames_for_new_rb
254  std::list<omip_msgs::RigidBodyPosesAndVelsMsgPtr> _n_previous_rcvd_poses_and_vels;
255 
259 
266 
276 
279 
282 
284 
286 };
287 }
288 
289 #endif /* JOINT_TRACKER_H_ */
virtual void setMinimumJointAgeForEE(const int &value)
virtual void setRevoluteSigmaSystemNoiseRVd(const double &value)
virtual void setPrismaticSigmaSystemNoisePVd(const double &value)
omip_msgs::RigidBodyPosesAndVelsMsg ks_measurement_t
MultiJointTracker(double loop_period_ns, ks_analysis_t ks_analysis_type, double dj_ne)
omip_msgs::RigidBodyPosesAndVelsMsgPtr _last_rcvd_poses_and_vels
virtual JointCombinedFilterPtr getCombinedFilter(int n)
virtual void estimateJointFiltersProbabilities()
joint_combined_filters_map _joint_combined_filters
virtual void setPrismaticSigmaSystemNoisePV(const double &value)
virtual void setPrismaticSigmaSystemNoiseTheta(const double &value)
virtual void setSigmaDeltaMeasurementUncertaintyAngular(double sigma_delta_meas_uncertainty_angular)
omip_msgs::RigidBodyPosesAndVelsMsgPtr _previous_rcvd_poses_and_vels
virtual void setRigidMaxTranslation(const double &value)
virtual void setRevoluteSigmaMeasurementNoise(const double &value)
virtual void setRevoluteMaximumJointDistanceForEstimation(const double &value)
virtual void setRevoluteSigmaSystemNoiseTheta(const double &value)
std::map< std::pair< int, int >, Eigen::Twistd > _srb_pose_at_srb_birthday_in_sf
virtual void predictState(double time_interval_ns)
First step when updating the filter. The next state is predicted from current state and system model...
virtual void setRevoluteMinimumRotForEstimation(const double &value)
virtual void _reflectState()
Prepares the state variable to be returned (getState is constant and we cannot change the state there...
virtual void setRigidMaxRotation(const double &value)
virtual void setSigmaDeltaMeasurementUncertaintyLinear(double sigma_delta_meas_uncertainty_linear)
virtual void setMeasurement(const ks_measurement_t &poses_and_vels, const double &measurement_timestamp_ns)
virtual void setRevoluteSigmaSystemNoisePhi(const double &value)
virtual void setRevoluteSigmaSystemNoisePx(const double &value)
virtual void addPredictedState(const ks_state_t &predicted_state, const double &predicted_state_timestamp_ns)
virtual void predictMeasurement()
Second step when updating the filter. The next measurement is predicted from the predicted next state...
virtual void setRevoluteSigmaSystemNoiseRV(const double &value)
std::list< omip_msgs::RigidBodyPosesAndVelsMsgPtr > _n_previous_rcvd_poses_and_vels
virtual void setPrismaticSigmaMeasurementNoise(const double &value)
virtual void correctState()
Third and final step when updating the filter. The predicted next state is corrected based on the dif...
virtual void setNumSamplesLikelihoodEstimation(int likelihood_sample_num)
virtual void setMinimumNumFramesForNewRB(const int &value)
virtual void setRevoluteSigmaSystemNoisePy(const double &value)
std::map< std::pair< int, int >, int > _precomputing_counter
virtual void setPrismaticSigmaSystemNoisePhi(const double &value)
std::map< std::pair< int, int >, JointCombinedFilterPtr > joint_combined_filters_map
std::map< std::pair< int, int >, Eigen::Twistd > _rrb_pose_at_srb_birthday_in_sf
virtual void setPrismaticPriorCovarianceVelocity(const double &value)
virtual void setRevoluteSigmaSystemNoisePz(const double &value)
virtual void setRevolutePriorCovarianceVelocity(const double &value)
KinematicModel ks_state_t


joint_tracker
Author(s): Roberto Martín-Martín
autogenerated on Mon Jun 10 2019 14:06:16