Hi everyone! Over the past few months, I’ve been working on a Micromouse simulation project based on Gazebo, which I’ve made available on GitHub and decided to share with the Gazebo community. I just happened to be in good mood at the same time that a new LTS Ubuntu/ROS2 distribution were released, and thought it 'd be a good opportunity to learn Gazebo and ROS2.
Ratada (GitHub - pedrofza/Ratada: Ratada is a 3D simulation environment for Micromouse robots based on Gazebo and ROS2.) is a collection of Gazebo plugins that make it easy to import mazes and robots into the simulation environment of a micromouse contest. It currently supports classic mazes (16x16).
Micromouse is a competition in which participants have to develop autonomous robots that solve mazes as fast as possible. Veritasium has good introductory video on it: https://www.youtube.com/watch?v=ZMQbHMgK2rw. You can find multiple recordings of past competitions on the internet. Contests often have similar rules, which I won’t cover here and are also not covered by the simulator. At this moment, it allows you to track the time it takes for the robot to go from the starting point to the goal of the maze.
One of the value propositions of the project is to enable users to set up and interact with a micromouse environment without needing a deep understanding of Gazebo internals. I’ve tackled this by providing a GUI that allows the user to import mazes from a human-readable text file format, and its robot from a URDF file. SDF robots are also supported. Some Gazebo knowledge is required for creating your own robot and defining its sensors and actuators. This could be improved by having a repository of micromouse robots! How awesome would that be?
The repository includes an example robot and example ROS2 application for solving the maze.
The biggest challenges were related to defining robot physics parameters. Coming up with suitable inertia matrices don’t seem obvious for a non-physicist or non-roboticist. Also, a lot of guess work went into tuning the wheel’s friction coefficients.
An update to the Gazebo extensions for URDF could possibly leverage the auto inertia parameters functionality that was implemented recently. As for the friction coefficients, I have no clue! It did seem that the small size of the robot made the tuning more difficult.
One of the current limitations is that the Gazebo/ROS2 bridge file is specific to the robot. I haven’t come up a way to abstract that away just yet.
I originally intended that each sensor and actuator would have dedicated ROS2/Gazebo messages, but creating a model for a DC motor turned out to be a bit of a challenge, and it seems that simulations aren’t usually accurate to that level. I see many models that take the twist command inputs and manipulate the physics at a higher level. I went as far as validating and porting the DC motor motor for classic Gazebo I found here GitHub - nilseuropa/gazebo_ros_motors: Motor simulation plugins for Gazebo - ROS , but unfortunately it turned out to be far from realistic (think robot taking off to space as soon as it contacts the ground).
I’d love to hear any comments or feedback about the project. If you find this useful somehow, please let me know by commenting here or in GitHub!