merge dev into main #6
Conversation
Co-authored-by: Antoine <damnthonyy@users.noreply.github.com>
feat(sim): add Docker environment for ROS2 Humble + Gazebo Fortress w…
Co-authored-by Antoine Mahassadi <dmantoinepro@gmail.com>
Init/back end base
feat(back): create packages for ROS2 exec
- Add unit tests for event formatting, sinks, state store, and telemetry service - Implemented unit tests for EventFormatter to ensure required fields, action, actor, ID, timestamp, and payload flattening. - Added tests for ConsoleSink and FileSink to verify logging behavior and file writing. - Created tests for RobotState and RobotStateStore to validate state management and updates. - Developed tests for TelemetryService to check state updates and connection event emissions. - Removed outdated test files for MessageRouter, MissionStateMachine, ModeManager, RobotStateStore, Schema Validation, TeleopService, and WatchdogService. - Introduced configuration loading tests to validate YAML parameter handling and environment overrides. - Implemented Config class to manage configuration loading and access with typed getters. - Updated setup.py to include testing dependencies. - Added configuration files for backend, common, mock, and real environments. Assisted-by : Claude :)
- enhance battery level calcul - update tests - update readme Co-authored-by: Kelian <kelianhalleray@gmail.com>
…er, update BackendContext for dependency injection Co-authored-by: Kelian <kelianhalleray@gmail.com>
Refactor codebase structure **Ok for Yann**
Review Summary by QodoComplete backend refactor with rosbridge integration, telemetry pipeline, and audit logging
WalkthroughsDescription• **Complete backend architecture redesign** with clean separation of concerns: adapters layer (robot communication), modules layer (business logic), and app layer (WebSocket server) • **ROS integration via rosbridge** with RosbridgeClient providing WebSocket transport, connection fallback, exponential backoff reconnection, and latency measurement • **Robot adapter pattern** with abstract RobotAdapter interface, RosbridgeRobotAdapter for real hardware, and MockRobotAdapter for development • **Telemetry pipeline** converting ROS battery messages to state updates with voltage-to-percentage conversion, watchdog timeout detection, and audit event emission • **Audit logging system** with multi-sink dispatch (ConsoleSink, FileSink), in-memory history, and WebSocket broadcasting for frontend consumption • **WebSocket server** with client management, message routing (ping, state queries, teleoperation, emergency stop), and real-time state/audit broadcasting • **Configuration system** with YAML merging, environment-specific overrides, and typed getters for flexible deployment across mock/sim/real environments • **Comprehensive test coverage** including unit tests for all components, integration tests for service wiring, and real rosbridge tests (skipped in CI) • **Extensive documentation** with architecture guides, extension instructions, and configuration reference for adapters, robot module, audit system, app layer, and configuration • **Removed legacy code** including old infrastructure layer, mission state machine, mode manager, and obsolete adapter implementations Diagramflowchart LR
ROS["ROS Topics<br/>via rosbridge"]
RC["RosbridgeClient<br/>WebSocket"]
RA["RobotAdapter<br/>Domain Logic"]
TS["TelemetryService<br/>State Updates"]
AS["AuditService<br/>Event History"]
SS["StateStore<br/>Single Source"]
WS["WebSocketHandler<br/>Client Broadcast"]
FE["Frontend<br/>Clients"]
ROS -->|subscribe| RC
RC -->|battery msg| RA
RA -->|on_battery| TS
TS -->|update state| SS
TS -->|emit event| AS
SS -->|state changed| WS
AS -->|event recorded| WS
WS -->|broadcast| FE
File Changes1. src/robocoop_backend/robocoop_backend/adapters/rosbridge_client.py
|
#5