ODRI Development Machine

In an effort to create an ODRI development machine for the development of my BOLT, I have tried the path of a local development environment on Ubuntu 18.04. However, even with the setup scripts I have found dealing with the nuances between python 3.6 and 3.8 when compiling the master SDK as well as an outdated version of CMAKE and BOOST to create a number of issues as I worked through flashing Masterboards, Micro boards, and compiling software.

As such I decided to start fresh by reformatting and installing a fresh full copy of Ubuntu 20.04 on my Dell Latitude from which I will do all of my development.

Focal Fossa Backgroud
Focal Fossa

Setup Local Machine

Once my installation was finished I installed git and Docker to further control and containerize my development environment. Machines-in-Motion has an image you can build for Ubuntu 20.04 but I found the image failed to build in 20.04 as some of the packages and applications (like ROS) were still pointing to Ubuntu 18.04 versions. The specific steps I took to set up the development environment are as follows.

Install Docker using these instructions, and add user to docker group so that Docker can be run with VS Code without root privileges:

sudo usermod -aG docker $USER
su - $USER

Install Git:

sudo apt install git

Compile and Install Real-Time Kernel

Next I patched the kernel to be real-time. It takes a while, and if there is any error the causes me to want to reformat, I wanted to know about it before setting up the rest of the machine. The first time I tried compiling the kernel, the process ran out of memory. I only have four gigabytes of ram on my laptop. I used this article to increase swap space and re-compiled it successfully after deleting the downloads folder where the kernel was built.

Whether or not you increase swap space the next step is to create a setup folder and clone the machines-in-motion repository containing the setup script:

mkdir devel
cd devel
git clone https://github.com/machines-in-motion/ubuntu_installation_scripts.git

Change the directory to rt-preempt for Ubuntu 20.04, and add execute permissions (Edit: subsequent to posting this I found ODRI has produced a guide here Open Dynamic Robot Initiative Real Time Kernel Guide):

cd /rt-preempt/ubuntu20.04
chmod x+ enable_kernel_sources.sh
chmod x+ install_rt_preempt_kernel.sh
./install_rt_preempt_kernel.sh

While configuring you will receive a series of prompts, for package configuration choose keep local:

Package Configuration

Next you will be asked to take notes and apply some general configuration steps, make sure you write down the version to append:

Version to Append and Kernel Preemption Selection

Press enter and then press enter again to select general setup:

Select General Setup

Navigate to the Local Version append to kernel release, do not add quotes:

Append release

Then navigate to preemption model settings and select Fully Preemptible:

Select Fully Preemptible
Save Configuration Changes

If successful you should receive a similar message:

What Success Looks Like

Finally, setup grub so that you can select your new kernel on the next boot:

sudo usermod -a -G realtime root 
sudo nano /etc/default/grub

In the file change:

GRUB_TIMEOUT_STYLE=hidden -> GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=0 -> GRUB_TIMEOUT=10

Exit and save, then update grub:

sudo update-grub

Lastly, restart and select your new kernel.

From the terminal, if you run

uname -r

You should see a response with rt-preempt in the name such as "5.14.2-rt21-preempt-rt"

Setup Ubuntu 20.04 Container for Development

I was not able to build Machines-in-Motion’s Ubuntu’s 20.04 Docekrfile as the script seems to try to install a version of ROS that does not work in 20.04. Pull a fresh Ubuntu Focal Fossa image and run it with a shared folder docker_share locally and /tmp in the container:

docker pull ubuntu:20.04
docker run -it -v ~/devel/:/tmp ubuntu:20.04 /bin/bash

Once running your command line prompt should look something like this:

Example of Docker Command Prompt
Docker Command Line Prompt

Now inside the container install lsb-release and git, otherwise, Machines-in-Motions setup script won’t work.

apt install lsb-release
apt install git

Then run the setup script:

cd official
./setup_ubuntu install all

Then save your container as an image by first looking up the container id in a separate terminal:

$ sudo docker ps

Which should return a result similar to this:

Then commit as your new Ubuntu image for ODRI development:

sudo docker commit <container name from above here> ubuntu_odri

And that is it, you have a fresh Ubuntu 20.04 container all set up for ODRI development machine with your Bolt Biped.

One Reply to “ODRI Development Machine”

Comments are closed.