Repository navigation
Getting Started
This page covers the basic setup needed to build, run, and begin developing the Snappy2027 software.
Snappy2027 is AUVic's ROS 2 software stack for the 2027 RoboSub competition cycle. The project uses ROS 2 Humble. See the ROS2 page for more information about ROS 2 and how we use it on Snappy.
Development and deployment are handled using Docker so that everyone can work with a consistent ROS 2 environment and dependency setup.
For the current development setup you will need:
- Git
- Docker
- Docker Compose
Clone Snappy2027:
git clone https://github.com/uvic-auvic/Snappy2027.gitEnter the repository:
cd Snappy2027Switch to the current development branch:
git checkout devYou can verify your current branch with:
git branch --show-currentYou should see:
dev
The repository is roughly organized as:
Snappy2027/
├── docker/
├── docs/
├── scripts/
└── src/
├── autonomy/
├── common/
├── control/
├── drivers/
├── estimation/
├── launch/
└── vision/
The src/ directory contains the ROS 2 packages used by the Snappy software stack.
The main software areas currently include:
- Autonomy - mission and autonomy logic
- Control - vehicle control
- Drivers - sensor and hardware interfaces
- Estimation - vehicle state estimation
- Launch - whole-vehicle ROS 2 launch configuration
- Vision - computer vision
- Common - shared code used by other parts of the system
See Software Subsystems (Nodes) for more information about each subsystem.
Snappy2027 uses Docker to provide the ROS 2 development environment.
./scripts/setup_docker.shThe setup script:
- Starts the Snappy development container.
- Imports pinned external repositories.
- Installs ROS dependencies using
rosdep. - Builds the ROS 2 workspace.
- Opens a Bash shell inside the container.
Inside the container, the repository is mounted at:
/ros2_ws
This is the root of the ROS 2 workspace.
The best way to re enter the docker container is by running
./scripts/run_docker.shThis script does the following
starts it with:
docker compose -f docker/docker-compose.yml up -d snappy-devThen enters it with:
docker compose -f docker/docker-compose.yml exec snappy-dev bashMost ROS 2 development commands should be run inside the Docker container.
Once inside the container, move to the workspace root:
cd /ros2_wsROS 2 Humble can be sourced with:
source /opt/ros/humble/setup.bashAfter Snappy has been built, source the Snappy workspace with:
source /ros2_ws/install/setup.bashBuilding a ROS 2 workspace creates an install/ directory containing environment setup files.
Sourcing install/setup.bash tells ROS 2 where to find the packages that were built in the Snappy workspace.
If ROS 2 reports that a Snappy package cannot be found after building, make sure you have sourced:
source install/setup.bashYou generally need to do this again after opening a new shell.
The initial Docker setup automatically builds Snappy.
For normal development, you can rebuild the entire workspace manually.
From /ros2_ws:
colcon buildAfter the build finishes:
source install/setup.bashWhile developing one subsystem, it is often faster to build only the package you are working on.
The general command is:
colcon build --packages-select <package_name>For example:
colcon build --packages-select snappy_controlAfter building, source the workspace again:
source install/setup.bashTo see the packages detected by colcon:
colcon listThis is useful if you are unsure of the exact package name.
You can also inspect the packages ROS 2 currently knows about with:
ros2 pkg listTo show only Snappy packages:
ros2 pkg list | grep snappyROS 2 builds produce three main directories:
build/
install/
log/
In the Docker setup, these are stored using Docker volumes rather than directly in the host checkout.
If you are debugging a build problem, avoid deleting build data unless necessary. A clean build can take significantly longer because all packages must be rebuilt.
The current whole-vehicle ROS 2 launch package is:
snappy_launch
The current launch file is (More launch files will be made):
snappy_realsense.launch.py
After building and sourcing the workspace:
ros2 launch snappy_launch snappy_realsense.launch.pyLaunch files for Snappy are currently stored under:
src/launch/launch/
At the moment, the repository contains:
snappy_realsense.launch.py
As the launch system changes, check this directory for the current available launch files.
The following commands are useful when developing or debugging Snappy.
See ROS2 for a more detailed explanation of ROS 2 concepts and commands.
ros2 node listA node is an individual ROS 2 program or component currently running.
This is one of the first commands to run when checking whether the system launched correctly.
ros2 node info <node_name>For example:
ros2 node info /some_nodeThis shows information such as:
- Publishers
- Subscribers
- Services
- Actions
ros2 topic listTopics are one of the main ways ROS 2 nodes communicate.
If a sensor or subsystem is expected to be running, checking the topic list can help confirm whether it is publishing data.
ros2 topic echo <topic_name>For example:
ros2 topic echo /example_topicros2 topic info <topic_name>Some parts of the development workflow are still being improved. The commands on this page reflect the current workflow, but some of them are expected to become simpler over time.
Checkout open Issue to see what we are currently working on!
Once your development environment is working, the following wiki pages provide more detail:
- Docker Setup - Docker development and Jetson setup
- Build & Run - More detailed build and launch information
- Git Workflow - Branches, Pull Requests, and development workflow
- ROS2 - ROS 2 concepts and useful commands
- Software Subsystems (Nodes) - Overview of the individual Snappy software subsystems
- Hardware - Hardware and sensors used on Snappy