How do i use tf2 to get the transformation between husky's base_link and odom

asked 2020-05-17 22:32:22 -0600

JoshuaSiy gravatar image

updated 2020-05-17 22:33:37 -0600

Hello,

I have been getting errors every time i try to use tf_listener

  listener.lookupTransform("base_link", "odom",ros::Time(0), transform);
  robot_position.x=transform.getOrigin().x();
  robot_position.y=transform.getOrigin().y();
  robot_position.z=transform.getOrigin().z();
  tf::Quaternion q = transform.getRotation(); 
  this->robot_orientation= tf::getYaw(q);

The error i get is : Terminate called after throwing an instance of 'tf2::LookupException' what(): "base_link" passed to lookupTransform argument target_frame does not exist. image description

edit retag flag offensive close merge delete