Skip to content

verlab/ros1_devcontainer_docker_compose

Repository files navigation

ROS1 Noetic VScode devcontainer with docker-compose for development

A simple way to run ROS1 Noetic for DEVELOPMENT using https://containers.dev/

This repo contains a simple way to delevop locally in a ROS1 Noetic docker container using the VScode devcontainers. A development container (or dev container for short) allows you to use a container as a full-featured development environment. It can be used to run an application, to separate tools, libraries, or runtimes needed for working with a codebase, and to aid in continuous integration and testing.

Details of the services in this container
  • ROS1 noetic with a base workspace /home/ubuntu/ros_ws/;
  • Support for arm64 (jetson orin nano) and amd64 architectures;
  • Support for NVIDIA Docker runtime for linux hosts;
  • VNC server that allows direct browser access (http://localhost:3080/), so nothing is required to install and use it;
  • A ssh server, to allow direct access from outside (ssh ubuntu@localhost -p 3022);
  • A web vscode server for easy remote access when deploying it on the robot (http://localhost:3081/);
  • Automatic xcode + command executed on each attachment for local X forwarding;
  • Custom environment and VScode configurations:
    • Open split terminals on launch;
    • Setup all environments variables automatically for running ROS;
    • Automatically open the VNC interface in a ROS tab;
    • Custom .vscode tasks to deploy roscore/rviz;
    • Custom PS1 (terminal shell);
Fully loaded interface with the VNC client and multiple terminals on the bottom panel
Fully loaded interface with the VNC client and multiple terminals on the bottom panel.

How to use?

To develop locally, using devcontainers (local VScode)

Recommended for local development, with X11 sharing, etc.
  • git clone [email protected]:verlab/ros1_devcontainer_docker_compose.git
  • Verify the compose file used in the container used in .devcontainer/devcontaoiner.json, given your operative system:
    "dockerComposeFile": [
          "../compose_linux_host.yaml"
      ],
    • Can also be ../compose_macos_host.yaml if you use MacOS
  • Open folder with VScode using the dev containers plugin (https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
    • control + shift + p
    • Write Dev Containers: Reopen in Container or Dev Containers: Rebuild and Reopen in Container
Fully loaded interface with the VNC client and multiple terminals on the bottom panel
How to open the repo using the Dev Containers plugin in VScode.

Headless run with docker compose (remote Jetson headless)

Recommended for remote development, as for example, deploying a dev machine on the robot.
  • git clone [email protected]:verlab/ros1_devcontainer_docker_compose.git
  • cd ros1_devcontainer_docker_compose
  • BUILDKIT_PROGRESS=plain docker compose -f compose_jetson_host.yaml up --build

BUILDKIT_PROGRESS=plain helps to visualize step by step output of each of the commands.

Access to services

Once the container is up, the you can access the services via:

Know issues

  • The live preview opens a terminal with a message "cannot find shell for command XXXX". This can be safely ignored.
  • The live preview will show a small box with a message "Please reopen the preview". This is fixed in the newest version of the live preview plugin.

Links/References:

License

MIT

Free Software, Hell Yeah!

About

A simple way to develop with ROS1 Noetic using devcontainer and docker compose

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published