Add dev container
This commit is contained in:
@@ -16,6 +16,7 @@ ROS 2 robot platform based on the Yahboom Raspbot V2. Multiple services run as D
|
||||
| [webrtc_streamer/](webrtc_streamer/README.md) | WebRTC browser stream server |
|
||||
| [webui/](webui/README.md) | Browser-based robot controller |
|
||||
| [ansible/](ansible/README.md) | Provisioning playbook for the Raspberry Pi |
|
||||
| [teleop/](teleop/README.md) | Keyboard and joystick teleoperation container |
|
||||
|
||||
---
|
||||
|
||||
@@ -108,6 +109,32 @@ docker compose logs -f # follow logs
|
||||
docker compose down # stop and remove containers
|
||||
```
|
||||
|
||||
### Dev container
|
||||
|
||||
An interactive ROS desktop environment (`osrf/ros:kilted-desktop-full`) is provided for development, visualisation, and ad-hoc `ros2` commands. It shares the host network so it participates in the same DDS domain as the robot.
|
||||
|
||||
Allow X11 forwarding from Docker (required once per session):
|
||||
|
||||
```bash
|
||||
xhost +local:docker
|
||||
```
|
||||
|
||||
Then launch the container:
|
||||
|
||||
```bash
|
||||
docker compose -f docker-compose.dev.yml run --rm dev
|
||||
```
|
||||
|
||||
The container drops you into a bash shell with the ROS underlay sourced. Set `FASTDDS_INTERFACE` in your `.env` (or inline) to bind DDS traffic to the correct network interface when connecting over Wi-Fi:
|
||||
|
||||
```bash
|
||||
FASTDDS_INTERFACE=wlp195s0 docker compose -f docker-compose.dev.yml run --rm dev
|
||||
```
|
||||
|
||||
See [teleop/README.md](teleop/README.md#working-out-the-network-interface-to-bind-to) for instructions on identifying the correct interface name.
|
||||
|
||||
---
|
||||
|
||||
### Environment variables
|
||||
|
||||
Create a `.env` file alongside `docker-compose.yml` to override defaults:
|
||||
@@ -135,13 +162,15 @@ WIFI_SSID=MyNetwork
|
||||
```
|
||||
.
|
||||
├── docker-compose.yml
|
||||
├── docker-compose.dev.yml # Interactive dev/visualisation container
|
||||
├── docker-entrypoint.sh
|
||||
├── robot/ # Motor controller, pan/tilt, ultrasonic
|
||||
├── raspbot_v2/ # ROS 2 packages (control, description, hardware interface)
|
||||
├── lidar/ # RPLIDAR A1
|
||||
├── oled/ # OLED display dashboard
|
||||
├── wifi/ # Wi-Fi hotspot fallback
|
||||
├── camera_publisher/ # V4L2 camera → ROS 2 topic
|
||||
├── webrtc_streamer/ # WebRTC browser stream
|
||||
├── webui/ # Browser-based controller UI
|
||||
├── teleop/ # Keyboard and joystick teleoperation
|
||||
└── ansible/ # Raspberry Pi provisioning
|
||||
```
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# Dev container — interactive ROS desktop environment.
|
||||
# Launch with: docker compose -f docker-compose.dev.yml run --rm dev
|
||||
#
|
||||
# Requires X11 forwarding to be allowed on the host:
|
||||
# xhost +local:docker
|
||||
|
||||
services:
|
||||
dev:
|
||||
image: osrf/ros:kilted-desktop-full
|
||||
network_mode: host
|
||||
ipc: host
|
||||
stdin_open: true
|
||||
tty: true
|
||||
environment:
|
||||
- DISPLAY
|
||||
- QT_X11_NO_MITSHM=1
|
||||
- ROS_DOMAIN_ID=${ROS_DOMAIN_ID:-0}
|
||||
- FASTDDS_BUILTIN_TRANSPORTS=LARGE_DATA
|
||||
# Restrict DDS traffic to a single network interface (same profile as teleop).
|
||||
# Note: the XML profile sets useBuiltinTransports=false, which overrides
|
||||
# FASTDDS_BUILTIN_TRANSPORTS above. Remove the two lines below if you need
|
||||
# large-data transport (e.g. for local camera streaming without interface binding).
|
||||
- FASTDDS_DEFAULT_PROFILES_FILE=/fastdds_wifi.xml
|
||||
- FASTDDS_INTERFACE=${FASTDDS_INTERFACE:-wlan0}
|
||||
volumes:
|
||||
- /tmp/.X11-unix:/tmp/.X11-unix:rw
|
||||
- ./teleop/src/fastdds_wifi.xml:/fastdds_wifi.xml:ro
|
||||
cap_add:
|
||||
- SYS_PTRACE
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
privileged: true
|
||||
Reference in New Issue
Block a user