Skip to content

Commit 43a66e3

Browse files
committed
feat(demos/ota): bake foxglove_bridge into gateway image (port 8765)
Without foxglove_bridge there is nothing for Foxglove Studio to subscribe to - no /scan, no /tf, no 3D visual story. The Updates panel itself is just the SOVD HTTP client and works without it, but the broader demo narrative (phantom obstacle visible, robot stuck) needs the topic stream. Adds ros-jazzy-foxglove-bridge to the runtime stage of Dockerfile.gateway, launches it from entrypoint.sh on port 8765 (0.0.0.0), and maps the port through compose with OTA_FOXGLOVE_BRIDGE_PORT override. Verified live: 'Server listening on port 8765' and channels for /scan, /rosout, /fault_manager/events advertised at startup.
1 parent e89628e commit 43a66e3

5 files changed

Lines changed: 32 additions & 10 deletions

File tree

demos/ota_nav2_sensor_fix/Dockerfile.gateway

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
5959
ros-jazzy-visualization-msgs \
6060
ros-jazzy-launch-ros \
6161
ros-jazzy-test-msgs \
62+
ros-jazzy-foxglove-bridge \
6263
libcpp-httplib-dev \
6364
libsystemd-dev \
6465
nlohmann-json3-dev \
@@ -73,5 +74,5 @@ RUN chmod +x /usr/local/bin/entrypoint.sh
7374

7475
ENV ROS_DOMAIN_ID=42
7576

76-
EXPOSE 8080
77+
EXPOSE 8080 8765
7778
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

demos/ota_nav2_sensor_fix/README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,25 @@ If host port 8080 is taken, override with `OTA_GATEWAY_PORT=8081 ./run-demo.sh`.
4646

4747
Tear down: `docker compose down`.
4848

49-
## Adding a Foxglove visualization
50-
51-
Install the `ros2_medkit_foxglove_extension` (which now ships an Updates
52-
panel - see https://github.com/selfpatch/ros2_medkit_foxglove_extension)
53-
in your local Foxglove Studio, then point it at
54-
`http://localhost:8080/api/v1`. The Updates panel exposes Prepare and
55-
Execute buttons next to each catalog entry.
49+
## Foxglove Studio visualization
50+
51+
The gateway container also runs `foxglove_bridge` on port `8765` so
52+
Foxglove Studio can subscribe to ROS 2 topics (e.g. `/scan` from
53+
broken_lidar / fixed_lidar).
54+
55+
1. Open Foxglove Studio -> **Open connection** -> **Foxglove WebSocket** ->
56+
`ws://localhost:8765`. You should see `/scan` and other topics in the
57+
Topics panel.
58+
2. Install the [`ros2_medkit_foxglove_extension`](https://github.com/selfpatch/ros2_medkit_foxglove_extension)
59+
(`npm run local-install` in that repo, or drag-and-drop the `.foxe`
60+
onto Foxglove). It ships three panels: Entity Browser, Faults Dashboard,
61+
and **ros2_medkit Updates**.
62+
3. Add the **ros2_medkit Updates** panel and set its `baseUrl` to
63+
`http://localhost:8080/api/v1` (or the port you picked via
64+
`OTA_GATEWAY_PORT`).
65+
4. Click **Prepare** and **Execute** in the Updates panel - the same SOVD
66+
endpoints `trigger-update.sh` hits, with progress feedback in the panel
67+
and live `/scan` updates in the 3D scene.
5668

5769
## Adding nav2 / a sim
5870

demos/ota_nav2_sensor_fix/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ services:
1616
networks: [otanet]
1717
ports:
1818
- "${OTA_GATEWAY_PORT:-8080}:8080"
19+
- "${OTA_FOXGLOVE_BRIDGE_PORT:-8765}:8765"
1920
environment:
2021
ROS_DOMAIN_ID: 42
2122
depends_on:

demos/ota_nav2_sensor_fix/entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ source /ws/install/setup.bash
1818
ros2 run broken_lidar broken_lidar_node &
1919
ros2 run broken_lidar_legacy broken_lidar_legacy &
2020

21+
# foxglove_bridge: WebSocket server on :8765 so Foxglove Studio can
22+
# subscribe to /scan, /tf, and any topic the demo nodes publish. Required
23+
# for the visual narrative (3D scene + phantom obstacle); the SOVD Updates
24+
# panel itself only needs the gateway HTTP API.
25+
ros2 run foxglove_bridge foxglove_bridge \
26+
--ros-args -p port:=8765 -p address:=0.0.0.0 &
27+
2128
# Foreground gateway. Pass the config file directly to the gateway_node
2229
# executable (the gateway.launch.py wrapper does not expose a config_file
2330
# argument, so we invoke the executable directly to thread our YAML in).

demos/ota_nav2_sensor_fix/run-demo.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@ fi
119119
echo ""
120120
echo "Demo is up."
121121
echo ""
122-
echo " Gateway HTTP API: ${GATEWAY_URL}/api/v1/"
123-
echo " Update server: http://localhost:9000/catalog"
122+
echo " Gateway HTTP API: ${GATEWAY_URL}/api/v1/"
123+
echo " Foxglove WebSocket: ws://localhost:${OTA_FOXGLOVE_BRIDGE_PORT:-8765}"
124+
echo " Update server: http://localhost:9000/catalog"
124125
echo ""
125126
echo "Registered updates:"
126127
if command -v jq >/dev/null 2>&1; then

0 commit comments

Comments
 (0)