dolly icon indicating copy to clipboard operation
dolly copied to clipboard

Publishing static transforms via Robot State Publisher

Open ruffsl opened this issue 3 years ago • 8 comments

It would be nice if this demo also published the TF tree for the dolly robot so the sensor feedback from for things like odomity and laser scans from different reference frames could be jointly visualized together in rviz.

Visualizing the mesh geometry of the platform in rviz would also be helpful, as well a provide a good reference for how to juggle and integrate urdf/sdf for making a simulation package for a ros2 robot.

I really like how this demo is sort of like a rosetta stone between classic gazebo and ignition, and would like to reference it to students on how to write their own. So it'd be great if this had the same polish as say the old TB3 demos, but while still being a minimal yet complete reference example to fork from.

ruffsl avatar Sep 19 '20 18:09 ruffsl

FYI, some relevant discussion on integrating SDFormat with ros2: https://github.com/ros/robot_state_publisher/issues/144

ruffsl avatar Sep 22 '20 03:09 ruffsl

I played a bit with the sdformat_urdf package to see if I could use robot_state_publisher without changing the robot description from SDF to URDF. That package isn't released for Foxy though (https://github.com/ros/sdformat_urdf/issues/3), so I tried compiling the galactic branch from source, as well as urdf_parser_plugin, but didn't get it to work :confused: It will be a bummer not to be able to do this on Foxy...

I'll try this on Galactic later. I'm still working on Dolly's Galactic migration on branch galactic_dev.

chapulina avatar Sep 27 '21 04:09 chapulina

Hi @chapulina, Is there any update on this?

I've been trying to find a way to publish TFs with SDF, but have not found any way so far

hardesh avatar Apr 05 '22 06:04 hardesh

a way to publish TFs with SDF

You could add the PosePublisher plugin and start a ros_ign_bridge from /model/model_name/pose@geometry_msgs/TransformStamped[ignition.msgs.Pose.

It would be nice to add an example like this to ros_ign_gazebo_demos

chapulina avatar Apr 05 '22 15:04 chapulina

Interesting! Thanks for sharing. Will try this out and will raise a PR after that

hardesh avatar Apr 05 '22 17:04 hardesh

Hi @chapulina, I tried this today. But it's not working. I added the plugin in the SDF of robot

<plugin filename="libignition-gazebo-pose-publisher-system.so" name="ignition::gazebo::systems::PosePublisher">
      <publish_link_pose>true</publish_link_pose>
      <publish_collision_pose>false</publish_collision_pose>
      <publish_visual_pose>false</publish_visual_pose>
      <publish_sensor_pose>false</publish_sensor_pose>
      <publish_nested_model_pose>true</publish_nested_model_pose>
      <update_frequency>20</update_frequency>
    </plugin>

When I echo the ign topic using ign topic -e --topic /robot/pose it's showing the data. But after adding the topic in parameter_bridge i'm not able to see the data on ROS2 topic

hardesh avatar Apr 07 '22 12:04 hardesh

Here's the parameter bridge node:

bridge = Node(
        package='ros_ign_bridge',
        executable='parameter_bridge',
        arguments=['/cmd_vel@geometry_msgs/msg/[email protected]',
                   '/scan@sensor_msgs/msg/[email protected]',
                   '/odometry@nav_msgs/msg/[email protected]',
                   '/model/movus/pose@tf2_msgs/msg/TFMessage[ignition.msgs.Pose_V',
                   '/world/station/model/movus/link/camera_front/sensor/color/camera_info@sensor_msgs/msg/CameraInfo[ignition.msgs.CameraInfo',
                   '/world/station/model/movus/link/camera_front/sensor/depth/camera_info@sensor_msgs/msg/CameraInfo[ignition.msgs.CameraInfo',
                   '/world/station/model/movus/link/camera_front/sensor/color/image@sensor_msgs/msg/Image[ignition.msgs.Image',
                   '/world/station/model/movus/link/camera_front/sensor/depth/depth_image/points@sensor_msgs/msg/PointCloud2[ignition.msgs.PointCloudPacked'],
        output='screen',
        remappings=[
            ('/world/station/model/movus/link/camera_front/sensor/color/camera_info', '/camera/color/camera_info'),
            ('/world/station/model/movus/link/camera_front/sensor/color/image', '/camera/color/image'),
            ('/world/station/model/movus/link/camera_front/sensor/depth/camera_info', '/camera/depth/camera_info'),
            ('/world/station/model/movus/link/camera_front/sensor/depth/depth_image/points', '/camera/depth/points')
        ]
    )

hardesh avatar Apr 07 '22 12:04 hardesh

Also I think I should create an issue in ros_ign :sweat:

hardesh avatar Apr 07 '22 12:04 hardesh