Page 1 of 1

Best way to broadcast the entire scene as a TF2 tree

Posted: 08 Aug 2024, 10:10
by Pouya
Dear CoppeliSim team,

I have a question and need a general advice here. I would like to have all the object poses to be broadcast/appear in the /tf. Right now, if I loadPlugin('simROS2') an empty /tf topic appears in ROS2 context which I can see coming from CoppeliaSim

Code: Select all

ros2 topic info --verbose /tf 
Type: tf2_msgs/msg/TFMessage

Publisher count: 1

Node name: sim_ros2_interface
Node namespace: /
Topic type: tf2_msgs/msg/TFMessage
My question is, what would be the best way to populate this topic with all the scene hierarchy object poses? Are there already any mechanism built-in to make this happen out-of-the-box? I assume I need to parse the entire scene, is that right?

For information, I don't mind writing a cpp plugin or python script, I just need it to be high performance.

Thank you!

Re: Best way to broadcast the entire scene as a TF2 tree

Posted: 14 Aug 2024, 17:01
by fferri
Function simROS2.sendTransform (to send just one geometry_msgs/msg/TransformStamped) or simROS2.sendTransforms (to send multiple at once as an array of geometry_msgs/msg/TransformStamped messages) is the way to go; it uses the tf2_ros::TransformBroadcaster class of ROS2.