ros_gz icon indicating copy to clipboard operation
ros_gz copied to clipboard

configure ros_gz_bridge to modify frame_ids

Open 0x4d494b opened this issue 2 years ago • 4 comments

I am inserting a robot model into Gazebo 7 using robot_state_publisher. Then, I am bridging sensors back to ROS2. The sensor IDs have a compound frame_id name (model_name/base_frame/sensor_name) that don't match link names in URDF. That causes all kinds of issues if I try launching RVIZ with the simulation.

This also applies to pose publisher plugin in Gazebo, so getting transformations for everything that I need by modifying link names, for example (sensors, poses, etc) so it would match the robot_state_publisher model becomes tricky.

Desired behavior

ros_gz_bridge could have a config parameter to strip the names up to last "::" instead of replacing those with a '/'. Thoughts?

0x4d494b avatar Jan 04 '23 23:01 0x4d494b

I believe you can set the frame_id of the sensor to whatever you want with gz_frame_id (see https://github.com/gazebosim/gz-sensors/pull/195)

azeey avatar Jan 06 '23 18:01 azeey

I believe you can set the frame_id of the sensor to whatever you want with gz_frame_id (see gazebosim/gz-sensors#195)

Thank you very much for the info. It works for sensors and is exactly what I needed. However, the pose publisher doesn't seem to have the same feature.

0x4d494b avatar Jan 17 '23 23:01 0x4d494b

This doesn't seem to be working with Gazebo Garden and ROS2 Humble. As mentionned in gazebosim/gz-sensors#195, Gazebo throws a warning and the published frame_id is still the original one. I may be doing something wrong though.

samprt-heracles avatar Feb 10 '23 06:02 samprt-heracles

This doesn't seem to be working with Gazebo Garden and ROS2 Humble.

If you use packages from ubuntu then they don't include the latest changes, but if you use ign_frame_id it should work

0x4d494b avatar Feb 11 '23 20:02 0x4d494b