Running ROS1 and ROS2 robots on the same gazebo simulation

asked 2021-08-10 10:54:59 -0500

lkw303 gravatar image

updated 2021-08-11 03:10:22 -0500

Is there any way I could run ROS1 and ROS2 robots in the same gazebo simulation?

For example running two turtlebot3s in the same gazebo simulation, wherby one of which is running on ROS2 packages and the other is running off ROS1 packages.

edit retag flag offensive close merge delete

Comments

1

Could you clarify what a "ROS 1" or a "ROS 2" robot is?

gvdhoorn gravatar image gvdhoorn  ( 2021-08-11 01:32:36 -0500 )edit

Hi sorry for being vague. To clarify, I meant running robots that are running ROS1 and ROS2 in the same simulation. So for example running two turtlebot3s in the same gazebo simulation, wherby one of which is running on ROS2 packages and the other is running off ROS1 packages.

lkw303 gravatar image lkw303  ( 2021-08-11 03:07:13 -0500 )edit

I am pretty sure gazebo itself runs in ROS 1 or ROS 2, but not both at the same time.

You might be able to get away with using the ros1_bridge if you are trying to test software in ROS2 with one robot, and then ROS1 with another.

404RobotNotFound gravatar image 404RobotNotFound  ( 2021-08-11 06:07:49 -0500 )edit
1

Gazebo doesn't "run in ROS" actually. It's stand-alone program which just loads a few plugins. Those plugins then add ROS 1 communication infrastructure. For ROS 2, there is a "bridge" which translates between Gazebo/Ignition messages and ROS 2 messages.

I haven't checked whether there is a version of Gazebo which supports gazebo_ros_pkgsand the ignition bridge. That would probably be a requirement.

Otherwise using the ros1_bridgemight be an option, but it won't be exactly the same setup as @lkw303 describes (as you wouldn't be using "the ROS 2 packages" with your simulated robot (just the stuff which interfaces with that robot).

gvdhoorn gravatar image gvdhoorn  ( 2021-08-11 10:18:14 -0500 )edit