StaticEnvironmentFilter.cpp
Go to the documentation of this file.
3 #include <boost/foreach.hpp>
4 #include <boost/numeric/ublas/matrix.hpp>
5 
6 using namespace omip;
7 
8 using namespace MatrixWrapper;
9 using namespace BFL;
10 
11 tf::Transform Eigen2Tf(Eigen::Matrix4f trans)
12 {
13  tf::Matrix3x3 btm;
14  btm.setValue(trans(0,0),trans(0,1),trans(0,2),
15  trans(1,0),trans(1,1),trans(1,2),
16  trans(2,0),trans(2,1),trans(2,2));
17  tf::Transform ret;
18  ret.setOrigin(tf::Vector3(trans(0,3),trans(1,3),trans(2,3)));
19  ret.setBasis(btm);
20  return ret;
21 }
22 
23 tf::Transform Eigen2Tf(Eigen::Matrix4d trans)
24 {
25  tf::Matrix3x3 btm;
26  btm.setValue(trans(0,0),trans(0,1),trans(0,2),
27  trans(1,0),trans(1,1),trans(1,2),
28  trans(2,0),trans(2,1),trans(2,2));
29  tf::Transform ret;
30  ret.setOrigin(tf::Vector3(trans(0,3),trans(1,3),trans(2,3)));
31  ret.setBasis(btm);
32  return ret;
33 }
34 
36  double environment_motion_threshold) :
37  RBFilter()
38 {
39  this->_loop_period_ns = loop_period_ns;
40  this->_id = 0;
41  this->_features_database = feats_database;
42  this->_estimation_error_threshold = environment_motion_threshold;
43 
44  this->_tf_epsilon_linear = 1e-8;
45  this->_tf_epsilon_angular = 1.7e-9;
46  this->_max_iterations = 100;
47 
48  this->_pose = Eigen::Matrix4d::Identity();
49  this->_velocity = Eigen::Twistd(0.,0.,0.,0.,0.,0);
50 
52 
54 
55  // To avoid segmentation fault because the features are as old as the rigid body
56  this->_trajectory.push_back(this->_pose);
57  this->_trajectory.push_back(this->_pose);
58  this->_trajectory.push_back(this->_pose);
59  this->_trajectory.push_back(this->_pose);
60 }
61 
63 {
65  _pose_covariance.setZero();
66  _velocity_covariance.setZero();
67 }
68 
69 void StaticEnvironmentFilter::predictState(double time_interval_ns)
70 {
71  if(this->_motion_constraint == NO_MOTION)
72  {
73  this->_predicted_pose_vh = _pose;
74  this->_predicted_pose_bh = _pose;
75  return;
76  }
77 
78  switch(this->_computation_type)
79  {
80 
82  {
83  Eigen::Twistd predicted_delta_pose_vh = (this->_velocity*time_interval_ns/1e9);
84  this->_predicted_pose_vh = predicted_delta_pose_vh.exp(1e-12).toHomogeneousMatrix()*_pose;
85  this->_predicted_pose_bh = _pose;
86  }
87  break;
89  {
90  RBFilter::predictState(time_interval_ns);
91  }
92  break;
93 
94  default:
95  ROS_ERROR_STREAM_NAMED("StaticEnvironmentFilter.predictState","Wrong StaticEnvironment computation_type!");
96  break;
97  }
98 }
99 
101 {
102  // The problem is that the StaticEnvironmentFilter is created at the beggining when only one location per feature is available
103  // There is no way to correct the state with only one location per feature
104  static bool first_time = true;
105  if(first_time)
106  {
107  this->_trajectory.push_back(this->_pose);
108  first_time = false;
109  return;
110  }
111 
112  if(this->_motion_constraint == NO_MOTION)
113  {
114  this->_velocity = Eigen::Twistd(0,0,0,0,0,0);
115  this->_trajectory.push_back(_pose);
116  return;
117  }
118 
119  switch(this->_computation_type)
120  {
121 
123  {
124  // I follow the convention of "Introduction to robotics" by Craig
125  // The first fram is the reference (left upper index) and the second frame is the referred (left lower index)
126  // se -> static environment
127  // set -> static environment at time t
128  // Example: setnext_set_T is describes the frame "static environment at time t" wrt the frame "static environment at time tnext"
129  tf::Transform set_setnext_Tf;
130  this->estimateDeltaMotion(this->_supporting_features_ids, set_setnext_Tf);
131 
132  Eigen::Matrix4d set_setnext_T;
133  set_setnext_Tf.getOpenGLMatrix(set_setnext_T.data());
134 
135  Eigen::Twistd set_setnext_Twist;
136  TransformMatrix2Twist(set_setnext_T, set_setnext_Twist);
137 
138  this->_velocity = set_setnext_Twist/(this->_loop_period_ns/1e9);
139 
140  // Accumulate the new delta into the absolute pose of the static environment wrt the camera
141  this->_pose = this->_pose*set_setnext_T;
142 
143  this->_trajectory.push_back(this->_pose);
144 
145  constrainMotion();
146  }
147  break;
149  {
151 
152  constrainMotion();
153  }
154  break;
155 
156  default:
157  ROS_ERROR_STREAM_NAMED("StaticEnvironmentFilter.correctState","Wrong StaticEnvironment computation_type!");
158  break;
159  }
160 }
161 
163 {
164  this->_motion_constraint = (MotionConstraint)motion_constraint;
165 }
166 
168 {
169  this->_computation_type = computation_type;
170 }
171 
173 {
174  this->_supporting_features_ids.push_back(supporting_feat_id);
175 
176  Feature::Location predicted_location_velocity;
177  Feature::Location predicted_location_brake;
178  FeaturePCLwc predicted_feature_pcl;
179  // Predict feature location based on velocity hypothesis
180 
181  predicted_location_velocity = this->_features_database->getFeatureLastLocation(supporting_feat_id);
182  LocationAndId2FeaturePCLwc(predicted_location_velocity, supporting_feat_id, predicted_feature_pcl);
183  this->_predicted_measurement_pc_vh->points.push_back(predicted_feature_pcl);
184  this->_predicted_measurement_map_vh[supporting_feat_id] = predicted_location_velocity;
185 
186  // Predict feature location based on brake hypothesis (same as last)
187  predicted_location_brake = this->_features_database->getFeatureLastLocation(supporting_feat_id);
188  LocationAndId2FeaturePCLwc(predicted_location_brake, supporting_feat_id, predicted_feature_pcl);
189  this->_predicted_measurement_pc_bh->points.push_back(predicted_feature_pcl);
190  this->_predicted_measurement_map_bh[supporting_feat_id] = predicted_location_brake;
191 }
192 
193 void StaticEnvironmentFilter::estimateDeltaMotion(std::vector<Feature::Id>& supporting_features_ids, tf::Transform& previous_current_Tf)
194 {
195  // Prepare the 2 point clouds with the locations of the features in current and previous frames
196  pcl::PointCloud<pcl::PointXYZ> previous_locations, current_locations;
197  BOOST_FOREACH(Feature::Id supporting_feat_id, supporting_features_ids)
198  {
199  if (this->_features_database->isFeatureStored(supporting_feat_id) && this->_features_database->getFeatureAge(supporting_feat_id) > 2)
200  {
201  Feature::Location previous_location = this->_features_database->getFeatureNextToLastLocation(supporting_feat_id);
202  Feature::Location current_location = this->_features_database->getFeatureLastLocation(supporting_feat_id);
203  previous_locations.push_back(pcl::PointXYZ(previous_location.get<0>(), previous_location.get<1>() ,previous_location.get<2>()));
204  current_locations.push_back(pcl::PointXYZ(current_location.get<0>(), current_location.get<1>() ,current_location.get<2>()));
205  }
206  }
207 
208  if (previous_locations.size() ==0)
209  {
210  ROS_ERROR_STREAM_NAMED("StaticEnvironmentFilter.estimateDeltaMotion","There are no features supporting the static environment!");
211  previous_current_Tf.setIdentity();
212  }else{
213  iterativeICP(previous_locations, current_locations, previous_current_Tf);
214  }
215 }
216 
217 void StaticEnvironmentFilter::iterativeICP( pcl::PointCloud<pcl::PointXYZ>& previous_locations,
218  pcl::PointCloud<pcl::PointXYZ>& current_locations, tf::Transform& previous_current_Tf)
219 {
220  // initialize the result transform
221  Eigen::Matrix4f previous_current_T;
222  previous_current_T.setIdentity();
223 
224  // create indices
225  std::vector<int> previous_indices, current_indices;
226  for(int i=0; i<previous_locations.size();i++)
227  {
228  previous_indices.push_back(i);
229  current_indices.push_back(i);
230  }
231 
232  for (int iteration = 0; iteration < this->_max_iterations; ++iteration)
233  {
234  // estimate transformation
235  Eigen::Matrix4f previous_current_T_new;
236  _svdecomposer.estimateRigidTransformation (previous_locations, previous_indices,
237  current_locations, current_indices,
238  previous_current_T_new);
239 
240  // transform
241  pcl::transformPointCloud(previous_locations, previous_locations, previous_current_T_new);
242 
243  // accumulate incremental tf
244  previous_current_T = previous_current_T_new * previous_current_T;
245 
246  // check for convergence
247  double linear, angular;
248 
249  previous_current_Tf = Eigen2Tf(previous_current_T);
250  linear = previous_current_Tf.getOrigin().length();
251  double trace = previous_current_Tf.getBasis()[0][0] + previous_current_Tf.getBasis()[1][1] + previous_current_Tf.getBasis()[2][2];
252  angular = acos(std::min(1.0, std::max(-1.0, (trace - 1.0)/2.0)));
253  if (linear < this->_tf_epsilon_linear && angular < this->_tf_epsilon_angular)
254  {
255  break;
256  }
257  }
258 }
259 
261 {
262  // The last estimated and unconstrained pose is contained in the variable _pose = cam_setnext_T
263 
264 // // The previous pose is contained in the vector _trajectory
265 // Eigen::Matrix4d cam_set_T = _trajectory.at(_trajectory.size() - 2);
266 
267 // switch(this->_motion_constraint)
268 // {
269 // case NO_ROLL_PITCH:
270 // {
271 // this->_pose.rz() = cam_set_Twist.rz();
272 // this->_pose.ry() = cam_set_Twist.ry();
273 
274 // this->_velocity.rz() = 0;
275 // this->_velocity.ry() = 0;
276 // }
277 // break;
278 // case NO_ROLL_PITCH_TZ:
279 // {
280 // this->_pose.rz() = cam_set_Twist.rz();
281 // this->_pose.ry() = cam_set_Twist.ry();
282 // this->_pose.vz() = cam_set_Twist.vz();
283 
284 // this->_velocity.rz() = 0;
285 // this->_velocity.ry() = 0;
286 // this->_velocity.vz() = 0;
287 // }
288 // break;
289 // case NO_TRANSLATION:
290 // {
291 // this->_pose.vx() = cam_set_Twist.vx();
292 // this->_pose.vy() = cam_set_Twist.vy();
293 // this->_pose.vz() = cam_set_Twist.vz();
294 
295 // this->_velocity.vx() = 0;
296 // this->_velocity.vy() = 0;
297 // this->_velocity.vz() = 0;
298 // }
299 // break;
300 // case NO_TRANSLATION_ROLL_YAW:
301 // {
302 // this->_pose.vx() = cam_set_Twist.vx();
303 // this->_pose.vy() = cam_set_Twist.vy();
304 // this->_pose.vz() = cam_set_Twist.vz();
305 // this->_pose.rz() = cam_set_Twist.rz();
306 // this->_pose.rx() = cam_set_Twist.rx();
307 
308 // this->_velocity.vx() = 0;
309 // this->_velocity.vy() = 0;
310 // this->_velocity.vz() = 0;
311 // this->_velocity.rz() = 0;
312 // this->_velocity.rx() = 0;
313 // }
314 // break;
315 // case NO_ROTATION:
316 // {
317 // this->_pose.rx() = cam_set_Twist.rx();
318 // this->_pose.ry() = cam_set_Twist.ry();
319 // this->_pose.rz() = cam_set_Twist.rz();\
320 // this->_velocity.rx() = 0;
321 // this->_velocity.ry() = 0;
322 // this->_velocity.rz() = 0;
323 // }
324 // break;
325 // case NO_MOTION:
326 // {
327 // this->_pose.rx() = cam_set_Twist.rx();
328 // this->_pose.ry() = cam_set_Twist.ry();
329 // this->_pose.rz() = cam_set_Twist.rz();
330 // this->_pose.vx() = cam_set_Twist.vx();
331 // this->_pose.vy() = cam_set_Twist.vy();
332 // this->_pose.vz() = cam_set_Twist.vz();
333 // this->_velocity.rx() = 0;
334 // this->_velocity.ry() = 0;
335 // this->_velocity.rz() = 0;
336 // this->_velocity.vx() = 0;
337 // this->_velocity.vy() = 0;
338 // this->_velocity.vz() = 0;
339 // }
340 // break;
341 // case ROBOT_XY_BASELINK_PLANE:
342 // {
343 // // Query the current pose of the camera wrt the baselink frame
344 // tf::StampedTransform bl_cam_TF;
345 // Eigen::Matrix4d bl_cam_T;
346 
347 // try{
348 
349 // this->_tf_listener.lookupTransform("/base_link", "/camera_rgb_optical_frame", ros::Time(0), bl_cam_TF);
350 // bl_cam_TF.getOpenGLMatrix(bl_cam_T.data());
351 // }
352 // catch (tf::TransformException ex)
353 // {
354 // ROS_ERROR("waitForTransform in StaticEnvironmentFilter failed!");
355 // ROS_ERROR("%s",ex.what());
356 // bl_cam_T = Eigen::Matrix4d::Identity();
357 // }
358 
359 // // The matrix of the pose of the static environment to the camera in the next time step
360 // Eigen::Matrix4d cam_se_T;
361 // Twist2TransformMatrix(_pose, cam_se_T);
362 
363 // Eigen::Matrix4d bl_se_T = bl_cam_T * cam_se_T;
364 
365 // Eigen::Matrix4d bl_se_T_constrained = bl_se_T;
366 
367 // // Eliminate translation along the z axis of the base link frame
368 // bl_se_T_constrained(2,3) = bl_cam_T(2,3);
369 
370 // // Restrict the rotation to be only around the z axis of the base link frame
371 // Eigen::Quaterniond bl_se_R(bl_se_T.block<3,3>(0,0));
372 // Eigen::Vector3d bl_se_RPY = bl_se_R.toRotationMatrix().eulerAngles(2, 1, 0);
373 
374 // Eigen::Quaterniond bl_cam_R(bl_cam_T.block<3,3>(0,0));
375 // Eigen::Vector3d bl_cam_RPY = bl_cam_R.toRotationMatrix().eulerAngles(2, 1, 0);
376 
377 // Eigen::Vector3d bl_se_RPY_constrained;
378 
379 // bl_se_RPY_constrained[0] = bl_se_RPY[0]; //Rotation around the baselink_z is the estimated one (unconstrained)
380 // bl_se_RPY_constrained[1] = bl_cam_RPY[1]; //Rotation around the baselink_y is constrained, must be the same as for the cam
381 // bl_se_RPY_constrained[2] = bl_cam_RPY[2]; //Rotation around the baselink_x is constrained, must be the same as for the cam
382 
383 // // Build the constrained rotation matrix
384 // Eigen::Matrix3f bl_se_R_constrained;
385 // bl_se_R_constrained = Eigen::AngleAxisf(bl_se_RPY_constrained[0], Eigen::Vector3f::UnitZ())
386 // *Eigen::AngleAxisf(bl_se_RPY_constrained[1], Eigen::Vector3f::UnitY())
387 // *Eigen::AngleAxisf(bl_se_RPY_constrained[2], Eigen::Vector3f::UnitX());
388 
389 // // Assign the rotation part to the constrained transformation matrix
390 // bl_se_T_constrained.block<3,3>(0,0) = bl_se_R_constrained.cast<double>();
391 
392 // // Calculate the constrained pose of the static environment to the camera
393 // Eigen::Matrix4d cam_se_T_constrained = bl_cam_T.inverse() * bl_se_T_constrained;
394 // TransformMatrix2Twist(cam_se_T_constrained, _pose);
395 
396 // // Calculate the constrained velocity of the static environment to the camera
397 // Eigen::Matrix4d cam_set_T = cam_set_Twist.exp(1e-12).toHomogeneousMatrix();
398 // Eigen::Matrix4d set_setnext_T_constrained = cam_set_T.inverse()*cam_se_T_constrained;
399 // Eigen::Twistd set_setnext_Twist_constrained;
400 // TransformMatrix2Twist(set_setnext_T_constrained, set_setnext_Twist_constrained);
401 
402 // _velocity = set_setnext_Twist_constrained / _loop_period_ns/1e9;
403 // }
404 // break;
405 // default:
406 // break;
407 
408 // }
409 
410 // // Reconfigure the variables in the filters
411 // ColumnVector constrained_state(12);
412 // constrained_state(1) = this->_pose.vx();
413 // constrained_state(2) = this->_pose.vy();
414 // constrained_state(3) = this->_pose.vz();
415 // constrained_state(4) = this->_pose.rx();
416 // constrained_state(5) = this->_pose.ry();
417 // constrained_state(6) = this->_pose.rz();
418 // constrained_state(7) = this->_velocity.vx();
419 // constrained_state(8) = this->_velocity.vy();
420 // constrained_state(9) = this->_velocity.vz();
421 // constrained_state(10) = this->_velocity.rx();
422 // constrained_state(11) = this->_velocity.ry();
423 // constrained_state(12) = this->_velocity.rz();
424 
425 // this->_ekf_velocity->PostGet()->ExpectedValueSet(constrained_state);
426 // this->_ekf_brake->PostGet()->ExpectedValueSet(constrained_state);
427 
428 // // Remove the last estimated pose (unconstrained) from the trajectory vector and replace it with the constrained one
429 // this->_trajectory.pop_back();
430 // this->_trajectory.push_back(this->_pose);
431 }
432 
433 //void StaticEnvironmentFilter::constrainMotion(tf::Transform& motion)
434 //{
435 // // **** degree-of-freedom constraints
436 
437 // switch(this->_motion_constraint)
438 // {
439 // case NO_ROLL_PITCH:
440 // {
441 // tf::Quaternion q;
442 // q.setRPY(0.0, 0.0, tf::getYaw(motion.getRotation()));
443 
444 // motion.setRotation(q);
445 
446 // }
447 // break;
448 // case NO_ROLL_PITCH_TZ:
449 // {
450 // tf::Quaternion q;
451 // q.setRPY(0.0, 0.0, tf::getYaw(motion.getRotation()));
452 
453 // tf::Vector3 p(motion.getOrigin().getX(), motion.getOrigin().getY(), 0.0);
454 
455 // motion.setOrigin(p);
456 // motion.setRotation(q);
457 // }
458 // break;
459 // case NO_TRANSLATION:
460 // {
461 // tf::Vector3 p(0.0,0.0, 0.0);
462 // motion.setOrigin(p);
463 // }
464 // break;
465 // case NO_TRANSLATION_ROLL_YAW:
466 // {
467 // tf::Quaternion q_set;
468 // tf::Quaternion q(motion.getRotation().x(),
469 // motion.getRotation().y(),
470 // motion.getRotation().z(),
471 // motion.getRotation().w());
472 // double roll, pitch, yaw;
473 // tf::Matrix3x3(q).getRPY(roll, pitch, yaw);
474 // q_set.setRPY(0.0, pitch, 0.0);
475 // tf::Vector3 p(0.0,0.0, 0.0);
476 // motion.setOrigin(p);
477 // motion.setRotation(q_set);
478 // }
479 // break;
480 // case NO_ROTATION:
481 // {
482 // tf::Quaternion q;
483 // q.setRPY(0.0, 0.0 , 0.0);
484 // motion.setRotation(q);
485 // }
486 // break;
487 // case NO_MOTION:
488 // {
489 // tf::Vector3 p(0.,0., 0.0);
490 // tf::Quaternion q;
491 // q.setRPY(0.0, 0.0 , 0.0);
492 
493 // motion.setOrigin(p);
494 // motion.setRotation(q);
495 // }
496 // break;
497 // case ROBOT_XY_BASELINK_PLANE:
498 // {
499 // // Query the current pose of the camera wrt the baselink frame
500 // tf::StampedTransform Tf_camt_bl;
501 // Eigen::Matrix4d T_camt_bl;
502 // try{
503 
504 // this->_tf_listener.lookupTransform("/base_link", "/camera_rgb_optical_frame", ros::Time(0), Tf_camt_bl);
505 // Tf_camt_bl.getOpenGLMatrix(T_camt_bl.data());
506 // }
507 // catch (tf::TransformException ex)
508 // {
509 // ROS_ERROR("waitForTransform in StaticEnvironmentICPFilter failed!");
510 // ROS_ERROR("%s",ex.what());
511 // T_camt_bl = Eigen::Matrix4d::Identity();
512 // getchar();
513 // }
514 
515 // // Apply the estimated delta motion to the pose
516 // // Verbose!
517 
518 // Eigen::Matrix4d T_camtnext_camt;
519 // motion.inverse().getOpenGLMatrix(T_camtnext_camt.data());
520 
521 // Eigen::Matrix4d T_camt_camtnext = T_camtnext_camt.inverse();
522 
523 // Eigen::Matrix4d T_camtnext_bl = T_camt_bl*T_camt_camtnext.inverse();
524 
525 // Eigen::Matrix4d T_camtnext_bl_constrained = T_camtnext_bl;
526 
527 // // Eliminate translation along the z axis
528 // T_camtnext_bl_constrained(2,3) = T_camt_bl(2,3);
529 
530 // // Restrict the rotation to be only around the z axis
531 // Eigen::Quaterniond R_camtnext_bl(T_camtnext_bl.block<3,3>(0,0));
532 // Eigen::Vector3d RPY_camtnext_bl = R_camtnext_bl.toRotationMatrix().eulerAngles(2, 1, 0);
533 
534 // Eigen::Quaterniond R_camt_bl(T_camt_bl.block<3,3>(0,0));
535 // Eigen::Vector3d RPY_camt_bl = R_camt_bl.toRotationMatrix().eulerAngles(2, 1, 0);
536 
537 // Eigen::Vector3d RPY_camtnext_bl_constrained;
538 // RPY_camtnext_bl_constrained.x() = RPY_camtnext_bl.x(); //Unconstrained rotation around z
539 // RPY_camtnext_bl_constrained.y() = RPY_camt_bl.y(); // Constrained rotation around y
540 // RPY_camtnext_bl_constrained.z() = RPY_camt_bl.z(); // Constrained rotation around x
541 
542 // // Build the constrained pose
543 // Eigen::Matrix3f R_camtnext_bl_constrained;
544 // R_camtnext_bl_constrained = Eigen::AngleAxisf(RPY_camtnext_bl_constrained[0], Eigen::Vector3f::UnitZ())
545 // *Eigen::AngleAxisf(RPY_camtnext_bl_constrained[1], Eigen::Vector3f::UnitY())
546 // *Eigen::AngleAxisf(RPY_camtnext_bl_constrained[2], Eigen::Vector3f::UnitX());
547 
548 // T_camtnext_bl_constrained.block<3,3>(0,0) = R_camtnext_bl_constrained.cast<double>();
549 
550 // Eigen::Matrix4d T_camt_camtnext_constrained = ((T_camt_bl.inverse())*T_camtnext_bl_constrained).inverse();
551 
552 // Eigen::Matrix4d T_camtnext_camt_constrained = T_camt_camtnext_constrained.inverse();
553 
554 // motion = Eigen2Tf(T_camtnext_camt_constrained);
555 // }
556 // break;
557 // default:
558 // break;
559 
560 // }
561 //}
double _loop_period_ns
Definition: RBFilter.h:536
virtual void iterativeICP(pcl::PointCloud< pcl::PointXYZ > &previous_locations, pcl::PointCloud< pcl::PointXYZ > &current_locations, tf::Transform &previous_current_Tf)
Estimate the transformation between 2 sets of feature locations by iteratively estimating ICP until e...
FeatureCloudPCLwc::Ptr _predicted_measurement_pc_bh
Definition: RBFilter.h:525
std::map< Feature::Id, Feature::Location > _predicted_measurement_map_vh
Definition: RBFilter.h:530
boost::tuple< double, double, double > Location
#define ROS_ERROR_STREAM_NAMED(name, args)
FeatureCloudPCLwc::Ptr _predicted_measurement_pc_vh
Definition: RBFilter.h:524
virtual void estimateDeltaMotion(std::vector< Feature::Id > &supporting_features_ids, tf::Transform &previous_current_Tf)
Estimate the motion between the last 2 frames of the set of supporting features, assuming they are al...
virtual void correctState()
Definition: RBFilter.cpp:191
TFSIMD_FORCE_INLINE Matrix3x3 & getBasis()
STATIC_ENVIRONMENT_ICP_TRACKER
void TransformMatrix2Twist(const Eigen::Matrix4d &transformation_matrix, Eigen::Twistd &twist)
virtual void predictState(double time_interval_ns)
RB_id_t _id
Definition: RBFilter.h:476
void setValue(const tfScalar &xx, const tfScalar &xy, const tfScalar &xz, const tfScalar &yx, const tfScalar &yy, const tfScalar &yz, const tfScalar &zx, const tfScalar &zy, const tfScalar &zz)
tf::Transform Eigen2Tf(Eigen::Matrix4f trans)
void setIdentity()
std::map< Feature::Id, Feature::Location > _predicted_measurement_map_bh
Definition: RBFilter.h:531
void getOpenGLMatrix(tfScalar *m) const
virtual void setMotionConstraint(int motion_constraint)
Set a constraint for the motion of the RB Right now this is only used by the StaticEnvironmentFilter...
Eigen::Matrix4d _pose
Definition: RBFilter.h:479
std::vector< Feature::Id > _supporting_features_ids
Definition: RBFilter.h:495
TFSIMD_FORCE_INLINE void setBasis(const Matrix3x3 &basis)
virtual void addSupportingFeature(Feature::Id supporting_feat_id)
TFSIMD_FORCE_INLINE Vector3 & getOrigin()
static_environment_tracker_t _computation_type
virtual void Init()
Definition: RBFilter.cpp:65
Eigen::Matrix< double, 6, 6 > _pose_covariance
Definition: RBFilter.h:480
Eigen::Twistd _velocity
Definition: RBFilter.h:482
FeaturesDataBase::Ptr _features_database
Definition: RBFilter.h:498
double _estimation_error_threshold
Definition: RBFilter.h:451
virtual void setComputationType(static_environment_tracker_t computation_type)
Set the computation type for the static environment Options: ICP based (t-1 to t) or EKF based (simil...
virtual void predictState(double time_interval_ns=-1.)
Definition: RBFilter.cpp:91
std::vector< Eigen::Matrix4d > _trajectory
Definition: RBFilter.h:493
void LocationAndId2FeaturePCLwc(const Feature::Location &feature_location, const Feature::Id &feature_id, omip::FeaturePCLwc &feature_pcl)
static_environment_tracker_t
pcl::registration::TransformationEstimationSVD< pcl::PointXYZ, pcl::PointXYZ > _svdecomposer
Eigen::Matrix4d _predicted_pose_bh
Definition: RBFilter.h:502
virtual void constrainMotion()
Function that constrains the last estimated pose of the static environment to the camera according to...
Eigen::Matrix4d _predicted_pose_vh
Definition: RBFilter.h:501
TFSIMD_FORCE_INLINE void setOrigin(const Vector3 &origin)
Eigen::Matrix< double, 6, 6 > _velocity_covariance
Definition: RBFilter.h:483
STATIC_ENVIRONMENT_EKF_TRACKER
TFSIMD_FORCE_INLINE tfScalar length() const
StaticEnvironmentFilter(double loop_period_ns, FeaturesDataBase::Ptr feats_database, double environment_motion_threshold)


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