A Portable ROS Development Environment

Sometimes when developing research software we depend on old software, yet we want to run it on new modern hardware that requires a new kernel, or perhaps we just want a modern desktop experience. It can be challenging to maintain both environments. Using containers is a way to run up-to-date software on the host, while keeping the essential dependencies in a high performance, compartmentalised and portable container. We demonstrate the use of Distrobox for quick and easy setup of a portable development environment for Robot Operating System (ROS).

Using an immutable desktop OS as a base, such as Fedora Silvelblue, is recommended due to the stability and ease of rollback, but any modern Linux distribution that can install Distrobox should work.

1. Create a new distrobox based on Ubuntu 18.04 and name it “ros”

At the time of writing the latest ROS1-supported distribution is Ubuntu 18.04.

distrobox create --image ubuntu:18.04 ros

2. Open a shell in the container

distrobox enter ros

The container will finish setup, which includes installing basic packages. From there you can continue ROS1 Setup as usual.

3. Install the packages required to complete ROS1 setup

sudo apt install -y vim nano emacs lsb-release

4. Complete the official ROS1 setup

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt update
sudo apt install -y ros-melodic-desktop-full
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install -y python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
sudo rosdep init
rosdep update

At this point you can clone your project code and continue its setup and build.

About NB Embedded Pty Ltd

NB Embedded Pty Ltd specialises in smart electronic devices for commercial and industrial organisations in Australia, Europe, and Asia. Based in Brisbane, Australia, we have the expertise to turn your concept into a product ready for the market, enhance your current product range, or provide customised smart devices to improve your internal processes. Contact us for a fixed cost consultation to get practical advice on your project. Talk with us today.