Resource Monitor by Freedom Robotics is now live! As part of the launch, we are making it so that anyone can test out our platform free for a whole year. Use code "MONITOR" (case sensitive) to access it today!

Sign Up for a 1 Year Free Trial X

How to Build Stable ROS Development and Test Environments with Docker

We have been talking for a while now about logging data so you can view it in realtime, historically or use it to save data like images along with events that occur on robots (related topics include: cloud logging and remotely logging images). This is all great for detecting issues and fixing them, but there is an elephant in the room. None of this matters if you have an unstable development environment.

Typical ROS Development Environment

Most ROS development environments are set up by hand and then patched together to allow them to function.

I can’t count how many times I go to test a new package or replicate a robotics bug only to find out it has nothing to do with the code, but rather the surrounding development environment. “Wait - is this because of that navigation/depth camera bug I fixed by updating the dependency on the other robot last week?” It doesn’t have to be like this - tools like Docker allow you to maintain a static environment and version it like code. We just created a tutorial sharing with you our go-to Docker setup. I'd like to share how we came to it and why we’ve seen it improve both our teams development velocity and the companies we work with.


The Pain of Development Without Docker

Before I started using Docker I usually had a few different robots and computers during development and did one off actions on one and not the others. I tracked it manually and took notes. I did one-off actions like updating a dependency, resetting a UDev rule, or setting custom environment variables. Things would mostly work, it wasn’t THAT bad, until it was. I’d get late night phone calls when things didn't work in one place and manually patch things over. It wasn’t fun. Enter Docker!

ROS Development Comic (ROSCON 2015)

This is an all-too-familiar scenario for anyone developing ROS. (From ROSCON 2015)

 

What we want out of our ROS Docker setup

There are a lot of ways people use Docker and it can be overwhelming - most Docker users are not Roboticists. Here are the things we focused on that matter the most for robotics:

  • Reproducible environment for testing
  • Enable at least simple simulations in addition to live robots
  • Headless development - don’t rely on a monitor plugged into every robot
  • Enable full logging for replays
  • Create unit tests or scenarios developers target
  • Shorten the deploy cycle

It’s important to match the level of complexity of the setup to the size of your team and robot fleet. Ask yourself what you need out of a setup ahead of time. It can help ensure you strike a good balance between the overhead of creating infrastructure vs the speed of development.

Freedom Robotics Docker Playground

You can easily run a ROS-enabled Docker on your dev computer and mount your code directory so that you can code in your favorite editor but execute on Ubuntu.

 

Diving into our Docker Setup Tutorial 🤿

Our tutorial goes over simplifying 80% of your development cycle by allowing you to run full Ubuntu ROS implementations on your local Windows or Mac machine:

  • Run development on any OS - Mac/Windows etc.
  • Enable at least simple simulations in addition to live robots
  • Code on your computer, run in Ubuntu
  • Full ROS 1, 2 without the install each time
  • Stays around after you close the terminal
  • Reset it in one command

Here is a link to the tutorial in the Freedom Robotics docs on how to set up the docker on your development computer in just a few lines of code. Please try it out and let me know what you think!

your time is valuable
Use it wisely.

Mission critical software infrastructure to enable the next generation of
robotics companies to build, operate, and scale robots and robotic fleets.