Skip to content

Connect demos to the selfpatch platform through the agent - #80

Merged
mfaferek93 merged 3 commits into
mainfrom
feat/connect-demos-to-platform
Oct 12, 2026
Merged

mfaferek93 merged 3 commits into
mainfrom
feat/connect-demos-to-platform

Conversation

@mfaferek93

@mfaferek93 mfaferek93 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What this adds

The demos can now show up in the selfpatch platform as robots. The connection goes through the selfpatch agent, which opens an outbound connection to the platform and lets it read the demo's gateway.

  • lib/connect-platform.sh <gateway container>: pairs the agent with a pairing code from the platform, then runs it as selfpatch-agent-<container> on the demo's Docker network, with its credential in a volume of the same name. --disconnect removes the container and the volume. Takes PLATFORM_URL, PAIRING_CODE, SELFPATCH_AGENT_IMAGE and PLATFORM_INSECURE_HTTP (for a platform on your own machine).
  • connect-platform.sh wrappers in sensor_diagnostics, ota_nav2_sensor_fix and turtlebot3_integration.
  • sensor_diagnostics/docker-compose.yml: container names, ports and ROS_DOMAIN_ID come from environment variables with the current values as defaults, so several robots can run side by side. Nothing changes for ./run-demo.sh.
  • PLATFORM.md: setup, several robots, a local platform, how to trigger faults per demo, what the gateway exposes and the rule to build UI on real responses rather than mocks. Written to be pasted into an AI assistant's context too.
  • A short section in the root README.

No demo compose file gets an agent service, so a demo without the platform runs exactly as before.

Tested

On an arm64 Mac against a staging deployment of the platform:

  • sensor_diagnostics and ota_nav2_sensor_fix connected, online, entity tree and faults visible in the platform.
  • A second sensor instance (COMPOSE_PROJECT_NAME=robot2, port 8082, ROS_DOMAIN_ID=41) connected with GATEWAY_CONTAINER=robot2 ./connect-platform.sh: its own device, online, and a fault injected on it (LIDAR_SIM) showed on that device only.
  • --disconnect removed the agent container and its volume.
  • shellcheck clean, docker compose config valid.

The agent image ghcr.io/selfpatch/agent:0.1 is public (amd64 and arm64), pulled without login.

lib/connect-platform.sh pairs a running demo with the platform and runs
the agent next to its gateway. Wrappers for sensor_diagnostics,
ota_nav2_sensor_fix and turtlebot3_integration. The sensor demo can run
several instances side by side. PLATFORM.md covers the setup for people
and AI assistants.
Comment thread lib/connect-platform.sh Outdated
Comment thread lib/connect-platform.sh Outdated
Comment thread demos/turtlebot3_integration/connect-platform.sh Outdated
Comment thread PLATFORM.md Outdated
Comment thread PLATFORM.md
Stopped gateway containers no longer pass the check, the disconnect hint
names the gateway container, and the turtlebot3 wrapper picks the nvidia
container. PLATFORM.md adds clear-fault and how to stop a second robot.
@mfaferek93
mfaferek93 merged commit 7a194cb into main Oct 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants