Getting Started with Ubuntu OS for Robotics
This article explores a couple of ways to get started with installing Ubuntu OS to use for robotics development. Each approach will have advantages and trade-offs. Simply put, installing Ubuntu is well-documented with a wealth of resources online for any scenario. This article will not prescribe actions to be taken, but rather the trade-offs and decision-making needed to decide which path is right for the given scenario.
Instructions
There are three typical installation scenarios for use in robotics development (or other software development). As a developer, it is common to use all these approaches in different contexts. These approaches include:
- Bare metal
- Virtual machine
- Container
The choice between these technologies can depend on a number of factors such as resource availability, multi-tasking needs, network security constraints and whether the machine controls a real or development robot.
Development Environment
The dev environment is primarily designed to the preferences of a developer. This means that tasks such as day-to-day computing (web browsing, email, etc), as well as code or text editing, need to be as user-friendly as possible. In this scenario, it can be advantageous to use containers to install ubuntu as this will integrate seamlessly with a developer’s current computing usage. For example:
- You may own a MacBook, in this case, you could install Docker and then subsequently - an Ubuntu container.
- You may own a PC with Windows, in this case, a small container-like system called WSL(1/2) - the Windows Subsystem for Linux can be installed natively which will provide a Linux (Ubuntu) kernel alongside your standard OS.
The best practice for working with containers is to use VSCode to develop in the container directly, from your normal computer environment. This gives you tight control over your development without losing access to your daily computing needs.
Development Trade-offs
- Direct hardware access can be limited (for example: getting access to the network, USB, or camera present on the computer). This can prevent development and testing on real hardware such as a motor controller plugged into the USB port.
- Limited resources/management - as this is shared with the host operating system.
Staging Environment
To overcome the trade-offs made in the development environment, it is common to create a Separate staging environment. Consider this approach like going to the gym and using the treadmill, rather than running outside during an upcoming race. It is like the real thing only it has some training wheels attached to allow testing before the main event.
A staging environment is often designed to be as close as possible to the production environment with additional testing and safety features, or relaxed security. This makes the robotics staging environment better for hardware development and testing.
A typical staging environment will be either a desktop-based computer (screen, keyboard, mouse, IDE, etc.) with a bare-metal or virtual machine installation of Ubuntu Desktop. Virtual Box can be a good place to start with virtual machines on an existing laptop and OS.
Staging Trade-offs
- Bare-metal installations often lose the normal office computing environment.
- virtualisation can have a significant effect on performance.
Production Environment
This environment is often restricted to a smaller set of necessary tasks to reduce the chances of failures occurring in normal use. It is often not necessary to install office features such as graphical tools, web browsing or email in this environment as they will not be used to operate the robot. An example may include installing Ubuntu Server - Bare metal on an Embedded or Industrial computer such as the one shown below available from Adlink:
The production set-up is often designed to make use of security and performance best practices to achieve a safe and high-quality product.
Production Trade-offs
- It is often harder to develop in a production environment as there are intentional barriers to modification. testing and developer facilities may be limited or simplified to prevent tampering.
- Access to production systems is often intentionally locked to prevent breaches in security.
Recommendations for Early Developmers
Use what is familiar
-
Since less than 2% of the OS market share is represented by Linux, it is more likely for most people to have access to a computer running either Windows or OSX. As such, the early developer experience would be better if it was integrated into these platforms - causing minimal disruption due to re-training.
-
Therefore it is recommended for early developers to use the Container based approach to get started with Linux.
-
However, in robotics development, it is important to consider the accessibility of hardware resources such as cameras, sensors, actuators, etc. This can precipitate the need for a separate staging environment early in the development lifecycle.
-
Therefore It is recommended to consider acquiring another low-cost embedded solution that is operated by bare-metal Linux - with access to the necessary hardware interfaces.