ros_gz icon indicating copy to clipboard operation
ros_gz copied to clipboard

sdformat_urdf parser demo

Open quarkytale opened this issue 2 years ago • 2 comments

🎉 New demo

Summary

Demonstrating SDFormat XML as a robot description format instead of URDF XML using sdformat_urdf plugin. The parser takes the SDF file published on /robot_description topic by robot_state_publisher and converts it to URDF C++ DOM structures. Joint states and TFs are bridged using ros_ign_bridge enabling RViz to visualize the RobotModel and odometry simulated by a Gazebo world. Also demonstrates a use-case of #259.

Changes made

  • Parser compatible SDF model
  • Gazebo world with required plugins (JointStatePublisher, PosePublisher, OdometryPublisher)
  • Launch file bringing up launch arguments, Gazebo, ros_ign_bridge, robot_state_publisher and RViz
  • RViz config
  • Installation framework for the new model and world

Snapshots

vehicle

https://user-images.githubusercontent.com/24695820/176565497-80414260-f958-44cc-8323-673077fad3d8.mp4

Test it

In a colcon workspace, install ros_gz and sdformat_urdf from source. Make sure you have the latest Gazebo fortress release. Run the demo launch file with the rviz launch argument set.

ros2 launch ros_ign_gazebo_demos sdf_parser.launch.py rviz:=True

Start the simulation in Gazebo and wait a second for TFs to be published. Send commands for the vehicle to move in circles, matching its trajectory in Gazebo and RViz.

ign topic -t "/model/vehicle/cmd_vel" -m ignition.msgs.Twist -p "linear: {x: 1.0}, angular: {z: -0.1}"
ros2 topic pub /model/vehicle/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 5.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: -0.1}}

Checklist

  • [x] Signed all commits for DCO
  • [x] Added tests
  • [x] Added example and/or tutorial
  • [ ] Updated documentation (as needed)
  • [x] Updated migration guide (as needed)
  • [x] Consider updating Python bindings (if the library has them)
  • [ ] codecheck passed (See contributing)
  • [ ] All tests passed (See test coverage)
  • [x] While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

quarkytale avatar Jun 24 '22 05:06 quarkytale

I'm pretty sure CI is consistently broken on the ros2 branch.

mjcarroll avatar Jul 08 '22 14:07 mjcarroll

test_launch_test_ros_subscriber.launch.py is failing for fortress+humble

quarkytale avatar Aug 01 '22 06:08 quarkytale