Tf Streamer¶
Tf Streamer ROS¶
This script allows you to stream TF frames back to ROS on /tf topic.
Add Tf Streamer ROS script to a child object of the tf transform you want to publish. To create transformation chose Parent Transform and Parent Frame Id. In the image below the object is called Vehicle and frame is set to /Vehicle. In the image the Tf Streamer ROS script is added to an object that represents LiDAR on a Vehicle object, therefore Frame Id parameter in the inspector is set to /Lidar.
To remove dependency on the Unity frame positions it is possible to set offset of the frame using Translation Offset and Rotation Offset parameters. This feature was added because frames of our vehicle models in Unity are not always positioned the way we want in ROS.
Frames will be published to ROS with frequency set in Update Frequency parameter.
To get transform back to ROS make sure ROS server is launched. This is included in grps_ros_adapter (link) package and can be called from terminal with roslaunch grpc_ros_adapter launch_server.launch.
Server should be live when simulation is started. At this point you should be able to see your transformation being published to the /tf topic in ROS.