-
Notifications
You must be signed in to change notification settings - Fork 4
4. Learning ROS through Simulation
Author: Brandon Rice
The full, original tutorial can be found here.
Preface: Robots are expensive, and it's difficult to test code when the bot is in the lab and you're at home...
I wrote this tutorial (or rather adapted an existing tutorial) on July 31, 2021. COVID-19 had physically removed our team from using our lab for over one full year. One full year of trying to figure out how a team could write software for a robot that was locked away in an nearly inaccessible room. No more "let's meet next week and test the code (physically on the rover)."
As SDRC's software team lead, one leadership role was particularly tricky: how can I get new members up to speed and teach them ROS (already a difficult task under normal circumstances) without actually running code on a physical device?
It was a problem I didn't know how to solve. Instead of gaining new members interested in software throughout the 2020-21 academic year, we lost nearly our entire team. Such an avoidable mistake if only I or anyone else on our team had experience in simulation-based software development and testing, what I now know and what you too can learn from this tutorial. Don't let working remotely halt your productivity!
No!!! Everything* software related can be virtually simulated on your computer.
I put an asterisk (*) on "everything" because simulations are not real, meaning:
- No simulation is 100% accurate because of how complex and random the universe is,
- A realistically modeled (i.e. correct dimensions, material properties, and joints) CAD model of the assembly you are wanting to simulate is needed for accurate results, and
- You'll want to eventually test your code on a physical robot to confirm that your code works, the simulation is close, and you can celebrate a job well done!
Luckily, in this tutorial, everything (including the model of the robot) is provided in the install of the software package we will use!
We will use a model of a robot called Turtlebot and a prebuilt simulator called Gazebo that ships with the Desktop-Full Install of ROS.
The (real) Turtlebot family.
The Turtlebot2 and Turtlebot3 models released with a full ROS library, including the properly defined 3D models of the robots. Because we are using ROS Melodic Morenia, we will use Turtlebot3.