Simulations for mobile robots

Gaurav Gupta
March 14, 2023
Read time 5 mins

What I like the most about robotic simulations is their sheer ability to make software development and testing process time-efficient. Working with robots (to a large extent on prototypes, and often remotely) over the last decade has helped me come up with a simple rule — do as much as you can with the simulation, use the actual robot hardware when you absolutely have to.

Software for robots HAS TO run on robots, there is no way around it. However, there is plenty of simulation-based testing that can expedite your route to software deployment on the robot, and robot deployment on-site. I’ve spent the bulk of my time working with wheeled mobile robots and my choice of simulators for application development and testing is centered around that. Without further ado, let me introduce some of the simulators that have helped me rapidly prototype some of the applications.

Stage

A lightweight 2.5D simulator designed specifically for wheeled mobile robots, Stage comes with seamless ROS integration. Stage provides ROS APIs to command velocities, returns the ground truth pose of the robot, and comes with a 2D-LiDAR plugin to emulate laser scans. The limited set of perception-oriented features and minimal compute requirements make Stage a great choice for multi-agent systems.

Limitations of Stage, as one would expect lie in emulating Cameras, 3D LiDARs, and non-wheeled robots. It simply isn’t built for that.

Multi-robot simulation in a Stage-2D world

Gazebo

Perhaps the most famous robotics simulator out there, Gazebo provides a 3D physics engine and rendering to support near enough all robot types — land, air, and water. Gazebo provides users the ability to use a range of sensor plugins such as RGB-D cameras, 3D LiDARs, GPS, IMU, and several others. In addition to its features, Gazebo comes with the support of a really large user/developer community and provides easy resolution to most issues you’re likely to run into.

You may want to use Gazebo if you’re dealing with outdoor robots, non-wheeled robots. It also has a more sophisticated physics engine making it more “real” than Stage. The challenge lies in computational burden that come with the introduction of a higher number of robots, and the limitation that comes with using camera data —Gazebo worlds aren’t a very accurate representation of reality so it becomes difficult to test vision based algorithms.

One robot simulation in a warehouse like Gazebo world

Unity

While not strictly a “robotics” simulator, Unity has gained recent popularity in the world of robotics simulators. Functionality-wise Unity finds its edge in high fidelity rendering, physics engine, and the ability to model any robot type.

Unity also comes with an existing developer community and software resources. However, since much of existing Unity development is based around gaming, most of the available assets (environment, objects, etc) are not a ready-made representation of a real world scenario where a robot would find itself in. The Unity-Robotics community is still growing, and as a result, not many robot platform vendors have released official models of their robots compatible with unity. The primary challenge with using Unity is the need for high processing power to truly leverage the aesthetic benefits.

Simulating a factory floor with robot fleets in Unity

What simulator should you be using?

If your objective is to model complex environments with “real looking” graphics or want to demonstrate your work to potential customers — go for Unity. Be ready for the initial learning curve, ROS integration efforts, and the processing power you’d need. Consider using Stage if your robot application is based on indoor mobile robots and the focus of your development lies on path planning, controls, or multi-robot systems. Gazebo is an interesting middle ground, it is supremely convenient to set up, comes with an ample repository of simulation resources and community support. If you’re not sure what all sensors you’ll end up simulating or want a bit of everything, Gazebo might be your best bet.

Note on some other simulators

The above discussion is non-exhaustive and doesn’t cover all the robotics simulators out there. CARLA and LGSVL are some of the simulators developed with a focus on self-driving cars. They aren’t well suited to work with off-road applications or indoor environments like factories/warehouses etc. AirSim is an interesting alternative to Unity-based robotics simulation, this is definitely on my watch-list for the next few projects I’ll be working on. Webots is another robotics-oriented simulator that has been open source over the last 4 years making it more accessible than before. CoppeliaSim (formerly known as V-Rep) is another popular robotics simulator that can be worth checking out if you’re looking for simulators in the mold of Gazebo.

Read more
Careers
| Copyright © 2023 Black Coffee Robotics