chapulina / dolly

🤖🐑 It's a sheep, it's a dolly, it's a following robot. Dolly was born to be cloned.
Apache License 2.0
226 stars 66 forks source link

Publishing static transforms via Robot State Publisher #27

Open ruffsl opened 3 years ago

ruffsl commented 3 years ago

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 commented 3 years ago

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

chapulina commented 2 years ago

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.

hardesh commented 2 years ago

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

chapulina commented 2 years ago

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

hardesh commented 2 years ago

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

hardesh commented 2 years ago

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 commented 2 years ago

Here's the parameter bridge node:

bridge = Node(
        package='ros_ign_bridge',
        executable='parameter_bridge',
        arguments=['/cmd_vel@geometry_msgs/msg/Twist@ignition.msgs.Twist',
                   '/scan@sensor_msgs/msg/LaserScan@ignition.msgs.LaserScan',
                   '/odometry@nav_msgs/msg/Odometry@ignition.msgs.Odometry',
                   '/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 commented 2 years ago

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