ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
tf::StampedTransform base_link_to_odom_tf;
tfListener_.waitForTransform("/odom", "/base_link", ros::Time(0), ros::Duration(0.1));
try {
      tfListener_.lookupTransform("/odom", "/base_link", ros::Time(0), base_link_to_odom_tf);
} catch (tf::TransformException ex) {
    return false;
 }

tf::Vector3 point, new_pose_v; point.setZ(0.0); point.setX(x); point.setY(y); new_pose_v = base_link_to_odom_tf * point;

Hi, I wrote an example in C++

Hope it can help you.

tf::StampedTransform base_link_to_odom_tf;
tfListener_.waitForTransform("/odom", "/base_link", ros::Time(0), ros::Duration(0.1));
try {
      tfListener_.lookupTransform("/odom", "/base_link", ros::Time(0), base_link_to_odom_tf);
} catch (tf::TransformException ex) {
    return false;
 }

tf::Vector3 point, new_pose_v; point.setZ(0.0); point.setX(x); point.setY(y); new_pose_v = base_link_to_odom_tf * point;

point;