You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add beacon mode switch to sensor diagnostics demo
Add BEACON_MODE environment variable (none/topic/param) that controls
entity enrichment via gateway beacon plugins. Sensor nodes conditionally
publish MedkitDiscoveryHint messages (topic mode) or declare
ros2_medkit.discovery.* parameters (param mode) with sensor-specific
metadata (entity_id, display_name, component, function membership,
sensor type, data topic, frame ID).
Shared BeaconHelper class avoids code duplication across 4 sensor nodes.
Launch file resolves the appropriate beacon plugin based on mode.
Docker-compose passes BEACON_MODE through to the container.
Closes#41
|`brightness`| int | 128 | Base brightness (0-255) |
256
257
|`inject_black_frames`| bool | false | Randomly inject black frames |
257
258
259
+
## Beacon Mode (Entity Enrichment)
260
+
261
+
The gateway's beacon plugins let sensor nodes publish extra metadata (display names, process info, topology hints) that enriches the SOVD entity model at runtime - without modifying the manifest.
262
+
263
+
Three modes are available, controlled by the `BEACON_MODE` environment variable:
264
+
265
+
| Mode | Plugin | Mechanism | Description |
266
+
|------|--------|-----------|-------------|
267
+
|`none`| - | - | Default. No beacon plugins. Entities come from manifest + runtime discovery only. |
268
+
|`topic`| topic_beacon | Push (ROS 2 topic) | Sensor nodes publish `MedkitDiscoveryHint` messages on `/ros2_medkit/discovery` every 5s. Gateway subscribes and enriches entities. |
269
+
|`param`| parameter_beacon | Pull (ROS 2 parameters) | Sensor nodes declare `ros2_medkit.discovery.*` parameters. Gateway polls them every 5s. |
**Topic beacon** (push): Each sensor node creates a publisher on `/ros2_medkit/discovery` and publishes a `MedkitDiscoveryHint` message every 5 seconds. The gateway's `topic_beacon` plugin subscribes to this topic and merges the hints into the entity model. Hints have a TTL (default 10s) - if a node stops publishing, the data goes stale.
306
+
307
+
**Parameter beacon** (pull): Each sensor node declares ROS 2 parameters under the `ros2_medkit.discovery.*` prefix. The gateway's `parameter_beacon` plugin polls all nodes for these parameters every 5 seconds. No explicit publishing is needed - the gateway reads the parameters via the ROS 2 parameter service.
308
+
309
+
Both mechanisms enrich the same entities defined in the manifest. They do not create new entities (the `allow_new_entities` option is disabled). Only one beacon mode should be active at a time - they serve the same purpose via different transport mechanisms.
310
+
258
311
## Use Cases
259
312
260
313
1.**CI/CD Testing** - Validate ros2_medkit without heavy simulation
0 commit comments