Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 6 additions & 135 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,145 +1,16 @@
# Examples

## BlueROV with ArduSub
- [BlueROV with ArduSub](bluerov/README.md)
- [Multi-vehicle simulation](multivehicle/README.md)

### Quickstart

We assume the ROS workspace is `~/workspaces/bluerov_ws`. Change the paths accordingly if needed.

Clone the repositories:

```bash
cd ~/workspaces/bluerov_ws/src
vcs import --recursive < examples/bluerov_ws.repos
```

> **Note:** `ml_models` is hosted on Hugging Face.
> Install [Git LFS](https://git-lfs.com/) **before** importing.

Build the minimal sim image first:

```bash
cd ~/workspaces/bluerov_ws/src/ardusub_sim
./build.bash
```

Build the examples image with perception and mission-tree dependencies:

```bash
cd ~/workspaces/bluerov_ws/src/examples
./build.bash
```

### Start the container

#### Native Ubuntu with NVIDIA

Install [Rocker](https://github.com/osrf/rocker), then run:

```bash
cd ~/workspaces/bluerov_ws/src/examples
./run.bash bluerov_ws:humble
```

#### WSL 2 with WSLg

```bash
docker run --rm -it \
--gpus all \
--device=/dev/dxg \
--network=host \
--ipc=host \
-e DISPLAY="$DISPLAY" \
-e WAYLAND_DISPLAY="$WAYLAND_DISPLAY" \
-e XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" \
-e PULSE_SERVER="$PULSE_SERVER" \
-e NVIDIA_DRIVER_CAPABILITIES=all \
-e MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA \
-e LD_LIBRARY_PATH=/usr/lib/wsl/lib \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
-v /mnt/wslg:/mnt/wslg \
-v /usr/lib/wsl:/usr/lib/wsl:ro \
-v ~/workspaces/bluerov_ws:/root/HOST/bluerov_ws \
bluerov_ws:humble
```

The WSL command exposes WSLg's X11/Wayland sockets and the `/dev/dxg` virtual
GPU device, allowing Gazebo to use hardware-accelerated rendering.

### Verify GPU rendering

Inside the container, before launching Gazebo:

```bash
glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"
```

On native Linux, the renderer should identify the NVIDIA GPU. Under WSLg, it
should mention D3D12 and the GPU. It should not report `llvmpipe`, which is
software rendering.

### Build the workspace

Inside the container:

```bash
cd /root/HOST/bluerov_ws
source /opt/ros/humble/setup.bash
colcon build --symlink-install \
--packages-up-to bluerov_tasks bluerov_sim bb_worlds
source install/setup.bash
```

### Demo: Square Mission

The square mission is a control smoke test:

1. Arm and enter `GUIDED`.
2. Move 2 m forward.
3. Move 2 m left.
4. Move 2 m backward.
5. Move 2 m right.

Inside the container:

```bash
cd /root/HOST/bluerov_ws
tmuxp load src/examples/bluerov_mission.yaml
```

### Demo: Bin Mission
## BlueROV

https://github.com/user-attachments/assets/6c262df8-bac6-492a-aef1-9e8cfc30d8a8

```bash
tmuxp load src/examples/bluerov_bin_mission.yaml
```

### Demo: Torpedo Mission

https://github.com/user-attachments/assets/9a9c25c5-637a-403a-b34d-4048f9afb5e0

```bash
tmuxp load src/examples/bluerov_torpedo_mission.yaml
```
### Foxglove layouts

Prebuilt Foxglove layouts for the Bin and Torpedo missions are available at
[BumblebeeAS/controlkitv3](https://github.com/BumblebeeAS/controlkitv3/tree/main/foxglove_layouts).
Import them into Foxglove Studio for a ready-made view of the relevant topics,
making it easier to visualize and debug each mission.

## Useful Commands

```bash
ros2 topic echo /bluerov/odom --once
ros2 topic echo /mavros/state --once
ros2 topic echo /mavros/local_position/pose --once
ros2 topic echo /bluerov/controls/_action/feedback --once
ros2 service call /mavros/cmd/arming mavros_msgs/srv/CommandBool "{value: true}"
ros2 service call /mavros/set_mode mavros_msgs/srv/SetMode "{custom_mode: 'GUIDED'}"
```
## Multi-vehicle

## Documentation
## Foxglove Layouts

- [Architecture and conventions](docs/architecture.md)
Import our [Foxglove layouts](https://github.com/BumblebeeAS/controlkitv3/tree/main/foxglove_layouts) for a ready-made view of the relevant topics and services, making it easier to visualize and debug each mission.
137 changes: 137 additions & 0 deletions bluerov/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# BlueROV with ArduSub

## Quickstart

We assume the ROS workspace is `~/workspaces/bluerov_ws`. Change the paths accordingly if needed.

Clone the repositories:

```bash
cd ~/workspaces/bluerov_ws/src
vcs import --recursive < examples/bluerov_ws.repos
```

> **Note:** `ml_models` is hosted on Hugging Face.
> Install [Git LFS](https://git-lfs.com/) **before** importing.

Build the minimal sim image first:

```bash
cd ~/workspaces/bluerov_ws/src/ardusub_sim
./build.bash
```

Build the examples image with perception and mission-tree dependencies:

```bash
cd ~/workspaces/bluerov_ws/src/examples
./build.bash
```

## Start the container

### Native Ubuntu with NVIDIA

Install [Rocker](https://github.com/osrf/rocker), then run:

```bash
cd ~/workspaces/bluerov_ws/src/examples
./run.bash bluerov_ws:humble
```

### WSL 2 with WSLg

```bash
docker run --rm -it \
--gpus all \
--device=/dev/dxg \
--network=host \
--ipc=host \
-e DISPLAY="$DISPLAY" \
-e WAYLAND_DISPLAY="$WAYLAND_DISPLAY" \
-e XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" \
-e PULSE_SERVER="$PULSE_SERVER" \
-e NVIDIA_DRIVER_CAPABILITIES=all \
-e MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA \
-e LD_LIBRARY_PATH=/usr/lib/wsl/lib \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
-v /mnt/wslg:/mnt/wslg \
-v /usr/lib/wsl:/usr/lib/wsl:ro \
-v ~/workspaces/bluerov_ws:/root/HOST/bluerov_ws \
bluerov_ws:humble
```

The WSL command exposes WSLg's X11/Wayland sockets and the `/dev/dxg` virtual
GPU device, allowing Gazebo to use hardware-accelerated rendering.

## Verify GPU rendering

Inside the container, before launching Gazebo:

```bash
glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"
```

On native Linux, the renderer should identify the NVIDIA GPU. Under WSLg, it
should mention D3D12 and the GPU. It should not report `llvmpipe`, which is
software rendering.

## Build the workspace

Inside the container:

```bash
cd /root/HOST/bluerov_ws
source /opt/ros/humble/setup.bash
colcon build --symlink-install \
--packages-up-to bluerov_tasks bluerov_sim bb_worlds
source install/setup.bash
```

## Demo: Square Mission

The square mission is a control smoke test:

1. Arm and enter `GUIDED`.
2. Move 2 m forward.
3. Move 2 m left.
4. Move 2 m backward.
5. Move 2 m right.

Inside the container:

```bash
cd /root/HOST/bluerov_ws
tmuxp load src/examples/bluerov_mission.yaml
```

## Demo: Bin Mission

https://github.com/user-attachments/assets/6c262df8-bac6-492a-aef1-9e8cfc30d8a8

```bash
tmuxp load src/examples/bluerov_bin_mission.yaml
```

## Demo: Torpedo Mission

https://github.com/user-attachments/assets/9a9c25c5-637a-403a-b34d-4048f9afb5e0

```bash
tmuxp load src/examples/bluerov_torpedo_mission.yaml
```

## Useful Commands

```bash
ros2 topic echo /bluerov/odom --once
ros2 topic echo /mavros/state --once
ros2 topic echo /mavros/local_position/pose --once
ros2 topic echo /bluerov/controls/_action/feedback --once
ros2 service call /mavros/cmd/arming mavros_msgs/srv/CommandBool "{value: true}"
ros2 service call /mavros/set_mode mavros_msgs/srv/SetMode "{custom_mode: 'GUIDED'}"
```

## Documentation

- [Architecture and conventions](docs/architecture.md)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion run.bash → bluerov/run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e

IMAGE_NAME="${1:-bluerov_ws:humble}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
WORKSPACE_DIR="$(cd "${SCRIPT_DIR}/../.." && pwd)"
WORKSPACE_DIR="$(cd "${SCRIPT_DIR}/../../.." && pwd)"

rocker \
--devices /dev/dri \
Expand Down
36 changes: 36 additions & 0 deletions multivehicle/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Multi-vehicle examples

Missions and control demos built on
[`multivehicle_sim`](https://github.com/BumblebeeAS/multivehicle_sim).

## Launch files

- BlueROV square mission: run `bluerov_tasks`'s tree launch directly
`ros2 launch bluerov_tasks bluerov_square_bt.launch.py`
- `boat_control.launch.py`: BlueBoat thrust mixer + LOS controller (+ optional mission node)
- `px4_offboard.launch.py`: the `uav2_offboard` `offboard_node` action backend + the
`mission_planner_2` UAV2 offboard demo behaviour tree (`uav2_offboard_demo_main.py`)
driving it (takeoff → standoff → return → land).

## Setup

```bash
cd ~/mvsim_ws
vcs import src < src/examples/multivehicle/examples.repos --recursive

cd src/multivehicle_sim
./build.bash

cd ../examples/multivehicle
./build.bash
./run.bash multivehicle_examples:humble
```

Inside the container:

```bash
cd /root/HOST/mvsim_ws
colcon build --symlink-install --packages-up-to multivehicle_examples microxrcedds_agent bb_robotx_dashboard
source install/setup.bash
tmuxp load src/examples/multivehicle/tmuxp/mvsim_debug.yaml
```
22 changes: 22 additions & 0 deletions multivehicle/build.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -e

image_name=multivehicle_examples
image_tag=humble

if [ ! -f "docker/Dockerfile" ]; then
echo "Err: docker/Dockerfile not found. Run from src/examples/multivehicle."
exit 1
fi

if ! docker image inspect multivehicle_sim:humble >/dev/null 2>&1; then
echo "Err: base image multivehicle_sim:humble not found."
echo "Build it first from src/multivehicle_sim."
exit 1
fi

image_plus_tag=$image_name:$(export LC_ALL=C; date +%Y_%m_%d_%H%M)
docker build --rm -t $image_plus_tag -f docker/Dockerfile docker && \
docker tag $image_plus_tag $image_name:$image_tag && \
echo "Built $image_plus_tag and tagged as $image_name:$image_tag"
20 changes: 20 additions & 0 deletions multivehicle/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM multivehicle_sim:humble

SHELL ["/bin/bash", "-o", "pipefail", "-o", "errexit", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
ARG HOME_DIR=/root

RUN apt-get update && apt-get install -y --no-install-recommends \
ros-humble-navigation2 \
ros-humble-nav2-bringup \
ros-humble-py-trees \
ros-humble-py-trees-ros \
ros-humble-tf-transformations && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN pip3 install --no-cache-dir --ignore-installed "transforms3d>=0.4" "numpy>=1.25,<2"
RUN pip3 install --no-cache-dir mavsdk

WORKDIR ${HOME_DIR}
Loading