-
Notifications
You must be signed in to change notification settings - Fork 2
77/fault gateway rest api endpoints #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements REST API endpoints for fault management in the ROS2 Medkit Gateway, enabling fault reporting, querying, and clearing operations through HTTP. The implementation bridges SOVD fault management APIs with a new ros2_medkit_fault_manager service backend.
- Adds four REST endpoints for fault operations: list faults, get specific fault, report fault, and clear fault
- Introduces a new
FaultManagercomponent in the gateway that communicates with the fault manager services - Creates a complete
ros2_medkit_fault_managerpackage with in-memory fault storage and service interfaces
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ros2_medkit_gateway/src/rest_server.cpp | Adds four fault endpoint handlers and registers routes for fault operations |
| src/ros2_medkit_gateway/src/gateway_node.cpp | Instantiates FaultManager and provides accessor method |
| src/ros2_medkit_gateway/src/fault_manager.cpp | Implements FaultManager client that interfaces with fault manager services |
| src/ros2_medkit_gateway/include/ros2_medkit_gateway/fault_manager.hpp | Defines FaultManager interface with service client methods |
| src/ros2_medkit_gateway/test/test_integration.test.py | Adds comprehensive integration tests for fault REST endpoints |
| src/ros2_medkit_fault_manager/src/fault_manager_node.cpp | Implements ROS2 node providing fault management services |
| src/ros2_medkit_fault_manager/src/fault_storage.cpp | Implements thread-safe in-memory fault storage with aggregation logic |
| src/ros2_medkit_fault_manager/test/test_integration.test.py | Adds integration tests for fault manager services |
| src/ros2_medkit_fault_manager/test/test_fault_manager.cpp | Adds unit tests for fault storage and manager node |
| postman/collections/ros2-medkit-gateway.postman_collection.json | Adds Postman collection requests for fault endpoints |
4e4fe7a to
e60d4e9
Compare
e60d4e9 to
979bc22
Compare
Gateway REST API Endpoints for fault management.
Adds FaultManager class that interfaces with ros2_medkit_fault_manager
services and exposes fault operations via REST API.
New REST endpoints:
- GET /api/v1/components/{id}/faults - list faults (REQ_INTEROP_012)
- GET /api/v1/components/{id}/faults/{code} - get fault (REQ_INTEROP_013)
- POST /api/v1/components/{id}/faults - report fault
- DELETE /api/v1/components/{id}/faults/{code} - clear fault (REQ_INTEROP_015)
Changes:
- Add FaultManager class with service clients for fault_manager
- Integrate FaultManager into GatewayNode
- Add fault endpoint handlers to RESTServer
- Add 'faults' capability to root endpoint
- Add integration tests (test_55-63) with fault_manager_node
- Update Postman collection and README with Faults folder
979bc22 to
64ee819
Compare
|
Screencast from 14.12.2025 17:13:04.webm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
- Add demo_lidar_sensor node that reports faults based on parameter validation:
- LIDAR_RANGE_INVALID when min_range >= max_range
- LIDAR_FREQ_UNSUPPORTED when scan_frequency > 20.0 Hz
- LIDAR_CALIBRATION_REQUIRED when sensor not calibrated
- Fix fault filtering to use prefix matching for namespace hierarchy
(allows querying by namespace e.g. /perception/lidar matches
/perception/lidar/lidar_sensor)
- Add LIDAR Fault Workflow folder to Postman collection with 8-step
example demonstrating complete fault management lifecycle
- Update Postman README with fault_manager startup instructions
- Fix prefix matching for fault source_id filtering to support namespace
hierarchy (e.g., /perception/lidar matches /perception/lidar/lidar_sensor)
- Add validation to reject non-positive scan_frequency in lidar_sensor demo
- Extract get_component_namespace_path helper to reduce code duplication
- Add docstring to fault_to_json method explaining timestamp conversion
- Add comment to empty except clause in integration tests
- Fix test section comment numbering (test_55-58)
- Update Postman README with fault_manager startup instructions
c5666e0 to
d1b4086
Compare
Pull Request
Summary
Gateway REST API Endpoints for fault management.
Adds FaultManager class that interfaces with ros2_medkit_fault_manager
services and exposes fault operations via REST API.
New REST endpoints:
Changes:
Issue
Link the related issue (required):
Type
Testing
How was this tested / how should reviewers verify it?
Checklist