Running ROS1 and ROS2 robots on the same gazebo simulation
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.
Could you clarify what a "ROS 1" or a "ROS 2" robot is?
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.
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.
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_pkgs
and the ignition bridge. That would probably be a requirement.Otherwise using the
ros1_bridge
might 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).