Best way to broadcast the entire scene as a TF2 tree

Typically: "How do I... ", "How can I... " questions
Post Reply
Pouya
Posts: 13
Joined: 15 Feb 2013, 11:19

Best way to broadcast the entire scene as a TF2 tree

Post 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!

fferri
Posts: 1297
Joined: 09 Sep 2013, 19:28

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

Post 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.

Post Reply