-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Following up @knmcguire and @gftabor hints to currently install and running Gazebo on Wiindows I've tried to setup a ROS 2 Jazzy that can communicate Gazebo with ROS 2 by spawing the ros_gz bridge.
The robostack conda packages and its installation are plain simple using their instructions (I recommend using the Pixi package manager). I've selected ROS 2 Jazzy since it is the first ROS 2 version that ships the ROS Gazebo vendor packages meaning that we can obtain Gazebo directly from ROS packages so we do not need to install the Gazebo packages from the usual conda-forge channel.
Instead of installing the all the ROS versions in the toml file we can use:
pixi install -e jazzyThat should bring the ros-jazzy-desktop to the directory. We still need to install the Gazebo packages and the ros_gz bridge. That can be done using
pixi add -f jazzy ros-jazzy-ros-gz
And we are ready to go into the the pixi enviroment and start executing commands.
Important
Be careful here, it is really important to use -e jazzy to use the jazzy environment since the toml file has a default environment with a minimum setup.
pixi shell -e jazzy
# List Gazebo packages and the bridge
(robostack:jazzy) > ros2 pkg list | findstr gz
gz_cmake_vendor
gz_common_vendor
gz_dartsim_vendor
gz_fuel_tools_vendor
gz_gui_vendor
gz_math_vendor
gz_msgs_vendor
gz_ogre_next_vendor
gz_physics_vendor
gz_plugin_vendor
gz_rendering_vendor
gz_sensors_vendor
gz_sim_vendor
gz_tools_vendor
gz_transport_vendor
gz_utils_vendor
ros_gz
ros_gz_bridge
ros_gz_image
ros_gz_interfaces
ros_gz_sim
ros_gz_sim_demos
Given that the gz sim call can not be used yet (until we solve gazebosim/gz-sim#168 (comment)) to launch the Gazebo server and the client, we need a couple of Windows terminals to run the server and the client separately.
:: Launch the gazebo server
pixi shell -e jazzy
(robostack:jazzy) > gz sim --verbose -s
In a new terminal
:: Launch the gazebo client
pixi shell -e jazzy
(robostack:jazzy) > gz sim --verbose -g
From here we can now use the ros_gz_bridge to pass messages between Gazebo and ROS 2 as detailed in the bridge.
In a new terminal
:: Launch the gazebo client
pixi shell -e jazzy
(robostack:jazzy) > ros2 run ros_gz_bridge parameter_bridge /clock@rosgraph_msgs/msg/Clock@gz.msgs.Clock
In a new terminal
:: Map the gazebo clock as a test to ROS 2
pixi shell -e jazzy
(robostack:jazzy) > ros2 topic echo /clock
:: Press the play button in the Gazebo GUI if you want to see the time running
The mandatory image of the whole thing together:
Known problems
- From this environment we can not use out of the box the ROS 2 launch files that usually spawn Gazebo from ROS. Mainly because we need to release OS agnostic 'which' command gazebosim/ros_gz#762 and probably because the
gz simunified call for the GUI and the server won't work in Jazzy and will require Windows runtime problems on Gz gazebosim/gz-sim#168 (comment) to work in newer Gazebo versions (hopefully with Standalone gz sim executable (Jetty) gazebosim/gz-sim#2849 that should appear in Gazebo Jetty and ROS-L).
