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

Your base_link and map are in the wrong place. StampedTransform is defined as:

StampedTransform (const tf::Transform &input, const ros::Time &timestamp, const std::string &frame_id, const std::string &child_frame_id)

So try this:

 broadcaster.sendTransform(tf::StampedTransform(transform, ros::Time::now(),  "map", "base_link"));

Your base_link and map are in the wrong place. StampedTransform is defined as:

StampedTransform (const tf::Transform &input, const ros::Time &timestamp, const std::string &frame_id, const std::string &child_frame_id)

So I think base_link should be the child_frame, so try this:

 broadcaster.sendTransform(tf::StampedTransform(transform, ros::Time::now(),  "map", "base_link"));

Your base_link and map are in the wrong place. StampedTransform is defined as:

StampedTransform (const tf::Transform &input, const ros::Time &timestamp, const std::string &frame_id, const std::string &child_frame_id)

I think base_link should be the child_frame, so try this:

 broadcaster.sendTransform(tf::StampedTransform(transform, ros::Time::now(),  "map", "base_link"));

EDIT

I guess maybe you should check if your orientation msg is right. I mean, the orientation is represented by quaternion(x,y,z,w), and x*x + y*y + z*z + w*w = 1.