Skip to content

Develop within the onboard user container (ROS2)

The internal Linux computer hosts several Docker containers capturing most of the functionalities of the Origin One platform. The number of containers depends on the specific configuration of the Origin One that you have purchased.

By default, a so-called user container is deployed on the Origin One, providing a dedicated docker environment for users to start interacting with the ROS2 network of the robot. This user container serves as a sandbox where you can develop and test your applications without affecting the core system. It is an ideal starting point for extending the capabilities of the Origin One while maintaining the integrity of the underlying system. In order to work with the user container, you require knowledge of Docker containers and an SSH connection to the Origin One, either over Wi-Fi or via the onboard ethernet port.

Warning

When the Origin One configured with an Autopilot Inference package, you may still develop within the user container. Yet bare in mind that computing resources are required by the Autopilot Inference to fulfill it's functionalities, and that extra computational load from user containers will interfere with the performance of the Autopilot behavior. As there are on guaranteed resources configured for the docker containers of the Autopilot Inference you should keep track whether the Linux computer of the Origin One is still able to support of functionalities, for example by running and assessing the results of htop.

If Autopilot Inference does not receive the computing resources in requires, unexpected and perhaps unsafe behavior by the robot may take place.

Interact with ROS from inside the User container environment

The Origin One comes with a preinstalled and running user (docker) container environment. As ROS2 is not installed on the base-OS of the Linux computer, i.e., CreOS, we have pre-installed ROS2-humble in the user container. Information about the user container that is by default deployed on the Origin One can be found online in the user container repository

To enter any container, you can use the command docker exec -it <container_name> /bin/bash. Since the standard user container is deployed with the container name user you may enter the container by running:

docker exec -it user /bin/bash

You're now inside the user container, you can now interact with the ROS2 network.

ros2 topic list

To exit the container simply run:

exit

The files for the standard user container are located in /data/user/containers. Essentially the folder /data/user is for you to develop on and can create other docker container folders.

You can also run your own container with ROS2 installed, and interact with the ROS2 network from there. You can follow the example from the user container repository. It is important to note that the robots internal ROS2 network runs using ROS2 Humble and the CycloneDDS middleware. CycloneDDS is not the default middleware for every ROS2 version, so you will need to make sure the package ros-humble-rmw-cyclonedds-cpp is installed in your own container as well, and setting the environment variable RMW_IMPLEMENTATION: rmw_cyclonedds_cpp.

Environment variables

The environment variables that are configured in every container are an important part of the configuration. Below is a list of the environment variables that are used in the containers. The variables are divided into two categories: variables that are used in every container and variables that are only used in specific containers.

Variables used in every container

Variable Description
ROS_DOMAIN_ID A unique identifier of the ROS network. This should be a unique number for the robot, and should be exactly the same in every container running on the robot. If a container's ROS_DOMAIN_ID variable differs it will not be able to communicate with the other containers.
CYCLONEDDS_URI The path to the cyclone DDS configuration. This configuration will make the DDS reliable on the robot.
RMW_IMPLEMENTATION The RMW implementation that is used by the ROS2 nodes. This should be set to rmw_cyclonedds_cpp for the cyclone DDS implementation.

Development with user containers

To experience an easy development process it is recommended to use VSCode Remote SSH and VSCode Dev Containers for any development on the Origin One robot using user containers.

  • An example on how to use Remote SSH is shown in the following Youtube video

    For Remote SSH development it is recommended to connect your personal computer to the Origin One access point or ethernet port for minimal latency and connect the Origin One to a local third party Wi-Fi network to access the internet for downloading images, cloning Github repo's, et cetera. Note: the Origin One is equipped with Dual Wi-Fi, so it can be connected to a local Wi-Fi network and enable a Wi-Fi access point simultaneously.

  • An example on how to use Dev Containers is shown in the following Youtube video

    For example, the standard user container can be configured using Dev Containers. First start by creating a folder .devcontainer inside the user container directory.

    cd /data/user/containers
    mkdir .devcontainer
    
    Now, create a devcontainer.json file that can be used with the user container:
    cd .devcontainer
    nano devcontainer.json
    
    Now the nano text-editor creates and opens the file. Paste the following inside the file using ctrl + shift + v:
    // For format details, see https://aka.ms/devcontainer.json. For config options, see the
    // README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
    {
    "name": "User Container",
    // Use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
    "dockerComposeFile": "../docker-compose.yml",
    "service": "user-container",
    "workspaceFolder": "/home/user/ws",
    }
    
    Exit the file with ctrl + x and press enter when prompted to save the file.
    You can now launch the Dev Container as illustrated in the Youtube video.

Continue to development ROS2 API definition