Skip to content

Latest commit

 

History

History
134 lines (94 loc) · 3.97 KB

File metadata and controls

134 lines (94 loc) · 3.97 KB

Development Guide

Using Dev Containers

This project includes VS Code dev container configurations for easy ROS2 development across different distributions.

Prerequisites

  • Docker installed and running
  • VS Code with the "Dev Containers" extension installed

Getting Started

  1. Choose ROS distribution:

    • Press Ctrl+Shift+P and run "Tasks: Run Task"
    • Select "Setup Devcontainer (CPU Only)" or "Setup Devcontainer (GPU)" and follow prompts
  2. Rebuild and open in container:

    • Press Ctrl+Shift+P and run "Dev Containers: Rebuild and Reopen in Container" or the other variants
    • The container will automatically rebuild and reopen with your selected ROS version

Container Features

  • Workspace: Your code is mounted at /deep_ros_ws
  • ROS sourcing: ROS is automatically sourced in your shell
  • Build tools: Includes colcon and rosdep for ROS development
  • Extensions: C++, CMake, Python, and XML support pre-installed

Stopping Containers

After using "Rebuild and Reopen in Container", you can stop containers using:

Method 1: VS Code Command (Recommended)

  • Press Ctrl+Shift+P (or Cmd+Shift+P on Mac)
  • Type: Dev Containers: Reopen Folder Locally
  • This closes the container and returns to local mode

Method 2: Stop Container

  • Press Ctrl+Shift+P
  • Type: Dev Containers: Stop Container
  • This stops the container but keeps it available for later use

Method 3: Using Docker Commands From a terminal (outside the container):

# List running containers
docker ps

# Stop a specific container by name
docker stop <container_name>

# Stop all dev containers
docker ps -q --filter "name=vsc-deep_ros" | xargs -r docker stop

# Stop and remove containers
docker stop <container_name>
docker rm <container_name>

Method 4: Close VS Code Window

  • Simply closing the VS Code window will stop the container when you exit
  • The container will remain stopped until you reopen the folder in container mode

Restarting Containers

After stopping a container, you can restart it using:

Method 1: VS Code Command (Recommended)

  • Press Ctrl+Shift+P (or Cmd+Shift+P on Mac)
  • Type: Dev Containers: Reopen in Container
  • This will start the existing container or create a new one if needed

Method 2: Rebuild and Reopen

  • Press Ctrl+Shift+P
  • Type: Dev Containers: Rebuild and Reopen in Container
  • Use this if you want to rebuild the container from scratch (e.g., after Dockerfile changes)

Method 3: Using Docker Commands From a terminal (outside the container):

# List all containers (including stopped)
docker ps -a

# Start a stopped container by name
docker start <container_name>

# Start and attach to container
docker start <container_name>
docker attach <container_name>

Method 4: Reopen Folder in VS Code

  • If VS Code detects a devcontainer configuration, it will prompt you to "Reopen in Container"
  • Click the notification or use the command palette option

Common Commands

Inside the container, you can do ros2 commands, colcon commands, rosdep, etc.

Testing

CI Testing (CPU Only)

export IS_CI=1
colcon build
source install/setup.bash && colcon test
colcon test-result --verbose

GPU backends are automatically skipped when IS_CI=1.

Local GPU Testing

Requires: NVIDIA container with GPU access (Runtime Libraries and CuDNN) Testing with GPU can be done using one of the support GPU devcontainers.

export IS_CI=0  # or unset IS_CI
colcon build
source install/setup.bash && colcon test
colcon test-result --verbose

Testing Philosophy

Given that access to GPU runners are limited, we settled on a testing procedure to test GPU-related software locally. The codebase is designed such that if a backend works with deep_sample, it works everywhere.

  • CPU backends: Tested in CI automatically
  • GPU backends: Must be tested locally with GPU before release
  • deep_sample validates all backend plugins end-to-end
  • Other packages tested with CPU only in CI