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

(ronodejs) Listening "/tf" topic doesn't provide 'base_footprint' child

asked 2019-10-02 14:56:49 -0600

mayice gravatar image

updated 2020-06-24 05:03:41 -0600

gvdhoorn gravatar image

Hi guys, I'm trying to save robots location on the my by using 'base_footprint' which comes from "/tf" topic. It works fine on gazebo simulation and turtlebot3_fake but when I try to run my code on real Turtlebot3 Burger it doesn't give me 'base_footprint' child. When I try to log what comes to me from that topic I just only see wheel_left_link and wheel_right_link. Here is my code:


    .then((rosNode) => {
        let subTf = rosNode.subscribe('/tf', tf2_msgs.TFMessage, (data) => {
            if(data.transforms[0].child_frame_id == "base_footprint") {
                pose = data.transforms[0];
                msg = pose.transform.translation.x + " ; " +
                pose.transform.translation.y + " ; " +
                pose.transform.translation.z + "\n"

that if condition never happens on real robot. And when I run my node it gives me this error message first but then continues to listen topic =>

[ERROR] [1570042491.165] (ros.rosnodejs): Unable to validate subscriber /tf connection header {"callerid":"/turtlebot3_core","latching":"0","md5sum":"94810edda583a504dfda3829e70d7eec","message_definition":"geometry_msgs/TransformStamped[] transforms\n\n================================================================================\nMSG: geometry_msgs/TransformStamped\n# This expresses a transform from coordinate frame header.frame_id\n# to the coordinate frame child_frame_id\n#\n# This message is mostly used by the \n# <a href=\"\">tf</a> package. \n# See its documentation for more information.\n\nHeader header\nstring child_frame_id # the frame id of the child frame\nTransform transform\n\n================================================================================\nMSG: std_msgs/Header\n# Standard metadata for higher-level stamped data types.\n# This is generally used to communicate timestamped data \n# in a particular coordinate frame.\n# \n# sequence ID: consecutively increasing ID \nuint32 seq\n#Two-integer timestamp that is expressed as:\n# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n# time-handling sugar is provided by the client library\ntime stamp\n#Frame this data is associated with\n# 0: no frame\n# 1: global frame\nstring frame_id\n\n================================================================================\nMSG: geometry_msgs/Transform\n# This represents the transform between two coordinate frames in free space.\n\nVector3 translation\nQuaternion rotation\n\n================================================================================\nMSG: geometry_msgs/Vector3\n# This represents a vector in free space. \n# It is only meant to represent a direction. Therefore, it does not\n# make sense to apply a translation to it (e.g., when applying a \n# generic rigid transformation to a Vector3, tf2 will only apply the\n# rotation). If you want your data to be translatable too, use the\n# geometry_msgs/Point message instead.\n\nfloat64 x\nfloat64 y\nfloat64 z\n================================================================================\nMSG: geometry_msgs/Quaternion\n# This represents an orientation in free space in quaternion form.\n\nfloat64 x\nfloat64 y\nfloat64 z\nfloat64 w\n","topic":"/tf","type":"tf/tfMessage"}

Thanks for your time.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-06-23 18:00:10 -0600

I had a similar issue and added some debugging code to rosnodejs to get a more descriptive error. In my case it was

Got incorrect message type [tf/tfMessage] expected [tf2_msgs/TFMessage]

So I suspect in your case the turtlebot3_core node might be publishing tf/tfMessage type messages, rather then tf2. If not that, then check the md5 checksum the two nodes expect the message to have. I think it's possible for them to be different if they have (very) different devel environments sourced for some reason.

edit flag offensive delete link more

Question Tools


Asked: 2019-10-02 14:56:49 -0600

Seen: 379 times

Last updated: Jun 24 '20