Intro to gazebo ros2

I am currently working on Intro to gazebo ros2. I have encountered an issue that I encountered multiple times, not only in this course or other courses, but also in my own systems. I would create a publisher and subscriber system using terminals - in my case here it is using the gazebo ros bridge - It would not work at first multiple times until I would refresh the terminals or maybe turn off and on my robot.

The main asset of a robot is its repeatability and I believe that having this in the long run would not result in a proper integration. What is creating these unpredictable issues? How can we make sure that we have a good repeatable system?

Thank you,
Omar

Hi,
Sadly working with GAzebo is not something its very stable and combining it with the ROS bridge even worse. My recommendations are:

  1. When launching the simulations an the bridge, do it with a script to avoid any sourcing issues.
  2. When launching, create a sanity check system that checks if the simulation ha launched properly, all the topics are available and so forth. If not, it relaunches the sim until it works.
  3. If possible, work directly with ROS2 natively in the simulation.