The Duke Robotics Club is a student organization of Duke University that develops Autonomous Underwater Vehicles (AUVs) for the RoboSub competition. Check out our website for more information about our club and projects.
This repository contains all code required for running and testing our AUVs. The code is built on the Robot Operating System (ROS) 2 framework. We use the Jazzy Jalisco distribution of ROS 2.
We are currently in the process of migrating our codebase from ROS 1 to ROS 2. The ROS 1 codebase can be found in the robosub-ros repository.
Setting up the repository and development enviornment is an involved process. The full process is documented in the SETUP.md file.
- Open a terminal in the Docker container.
- Navigate to the root of the repository
/root/dev/robosub-ros2
. - Run the following command to build all packages:
source build.sh
- This command builds all packages in the
core
andonboard
workspaces.
- This command builds all packages in the
- You are now ready to run the code!
See SCRIPTS.md for more information about how to use build.sh
and other scripts at the root of the repository.
We use Foxglove Studio for visualizing and debugging our code. Foxglove Studio is a web-based tool that allows you to visualize ROS 2 topics and services in real-time.
To use Foxglove Studio:
- Open a terminal in the Docker container.
- Run the following command to start the Foxglove bridge:
fg-ws
- This is an alias that starts the Foxglove bridge, which enables Foxglove Studio to connect to the ROS 2 network.
- The bridge opens a WebSocket on port
28765
. This port is mapped to port28765
on the host machine, so you can connect to the WebSocket from your host machine.
- Open Foxglove Studio and connect to the WebSocket at
ws://IP_ADDRESS:28765
.- Replace
IP_ADDRESS
with the IP address of the host machine. If you are running the Docker container locally, you can uselocalhost
as the IP address.
- Replace
To ensure code quality and consistent formatting, we use the following linters:
- Python: Ruff
- C++: ClangFormat
- Bash: ShellCheck
The linters can be accessed via the CLI provided by lint.py
. This CLI is also used by the GitHub Actions build-and-lint
workflow.
To lint all code in the repository:
- Open a terminal in the Docker container.
- Navigate to the root of the repository
/root/dev/robosub-ros2
. - Run the following command:
./lint.py
- This command lints all Python, C++, and Bash code in the repository.
- Any linting errors or warnings will be displayed in the terminal.
See
lint.py
in SCRIPTS.md for more information about the CLI provided bylint.py
.