Porting Gazebo to ROS2

I am trying to create a gazebo simulation for the stretch 2 in ros2. First of all, is there any particular reason as to why the stretch_gazebo package hasn’t been ported to ros2? If not, how would I go about implementing the simulation?

Hi @mlalji, it’s great to hear you’re working on this. We haven’t tackled porting Stretch Gazebo to ROS2 because we’re currently focused on improving the support for the core Stretch ROS2 packages. If you wanted to implement a Gazebo ROS2 implementation of Stretch, here’s a few things to note:

  • URDFs for Stretch 2 are available in the Stretch Description package. STL meshes are in the stretch_ros2/stretch_description/meshes/ folder and they’ve been optimized to remove internal geometry which should make simulation faster. XACROs are in the stretch_ros2/stretch_description/urdf folder and you’ll want to use to edit the stretch_description.xacro to include the tool you are using (e.g. Standard Gripper vs Dex Wrist) before compiling it to a URDF.
  • Despite being called “Gazebo”, the new Gazebo (previously called Ignition) is different from the Gazebo Classic simulator used in ROS1’s Stretch Gazebo package. The physics engine is different, so you will see different physics behavior (might be better, might be worse). The rendering engine is different, so the graphics will look different. The assert library is upgraded and called Fuel. The API is different, so any Gazebo Classic plugins will need to be ported forward.

Happy to answer any questions that come up as you make progress on your implementation.

1 Like

Hi @bshah. I’ve been going through the process of just being able to vizualize the stretch in gazebo using ros2. I am getting this error when trying to run the entity spawner through gazebo:

[gzclient-2] [Err] [InsertModelWidget.cc:403] Missing model.config for model “/home/hello-robot/ament_ws/install/stretch_gazebo/share/stretch_gazebo/…/ament_index”
[gzclient-2] [Err] [InsertModelWidget.cc:403] Missing model.config for model “/home/hello-robot/ament_ws/install/stretch_gazebo/share/stretch_gazebo/…/colcon-core”
[gzclient-2] [Err] [InsertModelWidget.cc:403] Missing model.config for model “/home/hello-robot/ament_ws/install/stretch_gazebo/share/stretch_gazebo/…/stretch_gazebo”
[spawn_entity.py-3] [INFO] [1702484354.468531980] [urdf_spawner]: Calling service /spawn_entity
[spawn_entity.py-3] [INFO] [1702484354.808944571] [urdf_spawner]: Spawn status: SpawnEntity: Successfully spawned entity [stretch]
[gzserver-1] [Msg] Waiting for master.
[gzserver-1] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
[gzserver-1] [Msg] Publicized address: 192.168.1.120
[gzserver-1] [Msg] Loading world file [/usr/share/gazebo-11/worlds/empty.world]
[gzserver-1] [Wrn] [FuelModelDatabase.cc:313] URI not supported by Fuel [$(find stretch_gazebo)/meshes/base_link.STL]
[gzserver-1] [Wrn] [SystemPaths.cc:459] File or path does not exist [“”] [$(find stretch_gazebo)/meshes/base_link.STL]
[gzserver-1] [Err] [MeshShape.cc:64] Failed to find mesh file [$(find stretch_gazebo)/meshes/base_link.STL]
[gzserver-1] [Wrn] [FuelModelDatabase.cc:313] URI not supported by Fuel [$(find stretch_gazebo)/meshes/link_mast.STL]
[gzserver-1] [Wrn] [SystemPaths.cc:459] File or path does not exist [“”] [$(find stretch_gazebo)/meshes/link_mast.STL]
[gzserver-1] [Err] [MeshShape.cc:64] Failed to find mesh file [$(find stretch_gazebo)/meshes/link_mast.STL]
[gzserver-1] [Wrn] [FuelModelDatabase.cc:313] URI not supported by Fuel [$(find stretch_gazebo)/meshes/link_head.STL]
[gzserver-1] [Wrn] [SystemPaths.cc:459] File or path does not exist [“”] [$(find stretch_gazebo)/meshes/link_head.STL]
[gzserver-1] [Err] [MeshShape.cc:64] Failed to find mesh file [$(find stretch_gazebo)/meshes/link_head.STL]
[gzserver-1] [Wrn] [FuelModelDatabase.cc:313] URI not supported by Fuel [$(find stretch_gazebo)/meshes/link_left_wheel.STL]
[gzserver-1] [Wrn] [SystemPaths.cc:459] File or path does not exist [“”] [$(find stretch_gazebo)/meshes/link_left_wheel.STL]
[gzserver-1] [Err] [MeshShape.cc:64] Failed to find mesh file [$(find stretch_gazebo)/meshes/link_left_wheel.STL]
[gzserver-1] [Wrn] [FuelModelDatabase.cc:313] URI not supported by Fuel [$(find stretch_gazebo)/meshes/link_head_pan.STL]
[gzserver-1] [Wrn] [SystemPaths.cc:459] File or path does not exist [“”] [$(find stretch_gazebo)/meshes/link_head_pan.STL]
[gzserver-1] [Err] [MeshShape.cc:64] Failed to find mesh file [$(find stretch_gazebo)/meshes/link_head_pan.STL]
[gzserver-1] [Wrn] [FuelModelDatabase.cc:313] URI not supported by Fuel [$(find stretch_gazebo)/meshes/link_head_tilt.STL]
[gzserver-1] [Wrn] [SystemPaths.cc:459] File or path does not exist [“”] [$(find stretch_gazebo)/meshes/link_head_tilt.STL]
[gzserver-1] [Err] [MeshShape.cc:64] Failed to find mesh file [$(find stretch_gazebo)/meshes/link_head_tilt.STL]
[gzserver-1] [Wrn] [FuelModelDatabase.cc:313] URI not supported by Fuel [$(find stretch_gazebo)/meshes/link_lift.STL]
[gzserver-1] [Wrn] [SystemPaths.cc:459] File or path does not exist [“”] [$(find stretch_gazebo)/meshes/link_lift.STL]
[gzserver-1] [Err] [MeshShape.cc:64] Failed to find mesh file [$(find stretch_gazebo)/meshes/link_lift.STL]
[gzserver-1] [Wrn] [FuelModelDatabase.cc:313] URI not supported by Fuel [$(find stretch_gazebo)/meshes/link_arm_l4.STL]
[gzserver-1] [Wrn] [SystemPaths.cc:459] File or path does not exist [“”] [$(find stretch_gazebo)/meshes/link_arm_l4.STL]
[gzserver-1] [Err] [MeshShape.cc:64] Failed to find mesh file [$(find stretch_gazebo)/meshes/link_arm_l4.STL]
[gzserver-1] [Wrn] [FuelModelDatabase.cc:313] URI not supported by Fuel [$(find stretch_gazebo)/meshes/link_arm_l3.STL]
[gzserver-1] [Wrn] [SystemPaths.cc:459] File or path does not exist [“”] [$(find stretch_gazebo)/meshes/link_arm_l3.STL]
[gzserver-1] [Err] [MeshShape.cc:64] Failed to find mesh file [$(find stretch_gazebo)/meshes/link_arm_l3.STL]
[gzserver-1] [Wrn] [FuelModelDatabase.cc:313] URI not supported by Fuel [$(find stretch_gazebo)/meshes/link_arm_l2.STL]
[gzserver-1] [Wrn] [SystemPaths.cc:459] File or path does not exist [“”] [$(find stretch_gazebo)/meshes/link_arm_l2.STL]
[gzserver-1] [Err] [MeshShape.cc:64] Failed to find mesh file [$(find stretch_gazebo)/meshes/link_arm_l2.STL]
[gzserver-1] [Wrn] [FuelModelDatabase.cc:313] URI not supported by Fuel [$(find stretch_gazebo)/meshes/link_arm_l1.STL]
[gzserver-1] [Wrn] [SystemPaths.cc:459] File or path does not exist [“”] [$(find stretch_gazebo)/meshes/link_arm_l1.STL]
[gzserver-1] [Err] [MeshShape.cc:64] Failed to find mesh file [$(find stretch_gazebo)/meshes/link_arm_l1.STL]
[gzserver-1] [Wrn] [FuelModelDatabase.cc:313] URI not supported by Fuel [$(find stretch_gazebo)/meshes/link_arm_l0.STL]
[gzserver-1] [Wrn] [SystemPaths.cc:459] File or path does not exist [“”] [$(find stretch_gazebo)/meshes/link_arm_l0.STL]
[gzserver-1] [Err] [MeshShape.cc:64] Failed to find mesh file [$(find stretch_gazebo)/meshes/link_arm_l0.STL]

This repeats for all of the mesh files used in the urdf. Can you help me with this issue?