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

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

mayice gravatar image

updated 2019-10-02 15:03:58 -0500

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: rosnodejs .initNode('/listen_rssi_node_write') .then((rosNode) => { let subTf = rosNode.subscribe('/tf', tf2_msgs.TFMessage, (data) => { console.log(data.transforms[0].child_frame_id); 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" serviceRequest() } }); });

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# tf 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