Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a “Triggers” showcase to each demo, demonstrating the gateway’s condition-based trigger mechanism and Server-Sent Events (SSE) delivery via shared host-side scripts.
Changes:
- Introduces a shared
lib/triggers-api.shhelper for trigger CRUD + SSE watching and “find active trigger” convenience. - Adds
setup-triggers.shandwatch-triggers.shto each demo and updatesrun-demo.shoutput with a trigger workflow. - Updates each demo README with a new Triggers section and manual API examples (plus MoveIt README dash/style cleanups).
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/triggers-api.sh | Shared trigger REST/SSE helper functions used by all demos. |
| demos/sensor_diagnostics/setup-triggers.sh | Creates an OnChange fault trigger for components/compute-unit with idempotency guard. |
| demos/sensor_diagnostics/watch-triggers.sh | Watches trigger SSE stream (auto-detects an active trigger if no ID provided). |
| demos/sensor_diagnostics/run-demo.sh | Prints a numbered triggers workflow in detach mode. |
| demos/sensor_diagnostics/README.md | Documents triggers setup, behavior, and manual API usage. |
| demos/turtlebot3_integration/setup-triggers.sh | Creates an OnChange fault trigger for components/nav2-stack with idempotency guard. |
| demos/turtlebot3_integration/watch-triggers.sh | Watches trigger SSE stream (auto-detects an active trigger if no ID provided). |
| demos/turtlebot3_integration/run-demo.sh | Prints a numbered triggers workflow in detach mode. |
| demos/turtlebot3_integration/README.md | Documents triggers setup, behavior, and manual API usage. |
| demos/moveit_pick_place/setup-triggers.sh | Creates an OnChange fault trigger for components/moveit-planning with idempotency guard. |
| demos/moveit_pick_place/watch-triggers.sh | Watches trigger SSE stream (auto-detects an active trigger if no ID provided). |
| demos/moveit_pick_place/run-demo.sh | Prints a numbered triggers workflow in detach mode. |
| demos/moveit_pick_place/README.md | Documents triggers + manual API usage; replaces em-dashes with hyphen style in multiple sections. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Triggers must target the entity whose ROS node name appears in reporting_sources[0] of the FaultEvent. The TriggerFaultSubscriber extracts entity_id from this field. - sensor_diagnostics: apps/diagnostic_bridge (was components/compute-unit) - turtlebot3: apps/anomaly_detector (was components/nav2-stack) - moveit: apps/manipulation_monitor (was components/moveit-planning) Verified end-to-end: setup-triggers -> watch-triggers -> inject-nan produces SSE events with fault payloads.
mfaferek93
reviewed
Mar 23, 2026
…ust specific ones)
…x curl error handling - Extract common setup/watch logic to lib/setup-trigger.sh and lib/watch-trigger.sh; per-demo scripts are now thin wrappers setting ENTITY_TYPE/ENTITY_ID/INJECT_HINT - Add trigger_id validation in delete_trigger and watch_trigger_events - Fix curl error handling in create_fault_trigger: capture failure explicitly instead of swallowing with || true
The runtime-discovered entity (diagnostic_bridge with underscore) may not exist in CI if the Docker image cache has an older gateway version. The manifest entity (diagnostic-bridge with hyphen) always exists. Trigger CRUD works on any entity - only SSE dispatch needs reporting_sources match.
mfaferek93
approved these changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add trigger examples to each demo showcasing the gateway's condition-based trigger system with SSE event delivery.
New files:
lib/triggers-api.sh- shared library for trigger REST API (create, list, delete, watch SSE, find active)demos/*/setup-triggers.sh- creates OnChange fault trigger with idempotency guarddemos/*/watch-triggers.sh- connects to SSE event stream, auto-detects active triggerModified files:
demos/*/run-demo.sh- daemon output includes numbered trigger workflowdemos/*/README.md- Triggers section with setup guide, API usage, scripts table entriesdemos/moveit_pick_place/README.md- em dashes cleaned up (style convention)User workflow:
./setup-triggers.sh- creates trigger, prints ID./watch-triggers.sh- SSE stream in new terminal (blocking)./inject-*.sh- trigger fires, event appears in watch terminalKey implementation detail: Trigger entity must match
reporting_sources[0]from FaultEvent (ROS node name), not the manifest entity ID. Each demo targets the fault-reporting app:apps/diagnostic_bridgeapps/anomaly_detectorapps/manipulation_monitorRelated Issue
closes #43
Checklist