Repository navigation
Add circular telemetry/log buffer node (#25) - #38
Conversation
1ptqc-KD-97bsBG-pVJG
left a comment
There was a problem hiding this comment.
I pulled the branch and ran the distributed_satellite_sim package tests through the Docker image. The core implementation looks good overall, and the functional ROS tests passed in that environment, but I don’t think this is ready to merge yet because of two blocking issues:
-
src/DistributedSatelliteSim/launch/sim.launch.pyEnablingtelemetry_bufferstill weakens the startup gate. Withmin_subscribersdefaulting to 1, the buffer can satisfyenv_node’s startup condition beforegnc_nodeis actually ready, which means an observer-only feature can change the closed-loop trajectory. This launch path needs the same protection as the DLQR reference launch, or another equivalent readiness check. -
src/DistributedSatelliteSim/test/test_telemetry_buffer_launch.pytest_actuation_history_queryablenever asserts that any actuation history was actually recorded. If the startup race above happens, or ifactuation_appliedstops being published, the test can still pass with an empty response. The test should fail unless at least one actuation sample is present.
Great work! Let me know when you've implemented some changes and I'll take another look. Thanks!
Implements an observer-only telemetry history system on top of the existing DLQR baseline. The control path (env_data, actuation_cmd) is unchanged.
Changes
New interfaces
msg/StateSample and msg/ActuationSample — timestamped history entries with variable-length numeric arrays, so the API is not hardcoded to the current 6-state/3-axis shapes
srv/GetRecentEnvHistory, srv/GetRecentActuationHistory, srv/GetRecentLogHistory — typed query services with limit, entries, total_buffered, and capacity fields; limit=0 returns all retained entries
env_node extension
New node: telemetry_buffer
Subscribes to env_data (receipt-time stamp), actuation_applied (source stamp), and /rosout
Stores recent entries in three independent fixed-capacity circular buffers
Exposes query services at ~/get_recent_env_history, ~/get_recent_actuation_history, ~/get_recent_log_history
Buffer access is mutex-guarded for safety under multi-threaded executors
Invalid capacity parameters (<= 0) fail fast at startup
No INFO logging inside query handlers to avoid feedback loops into the log buffer
Launch
sim.launch.py gains enable_telemetry_buffer (default false) and three capacity arguments — existing launch behavior is unchanged when the flag is omitted
Tests
Unit tests for CircularBuffer: rollover, ordering, limit=0, limit exceeding available entries
Node-level tests for all three buffer streams, including a test that exercises the real actuation_cmd → actuation_applied → buffer path with a live env_node
Integration launch test running env_node, gnc_node, and telemetry_buffer_node together, querying history over ROS services, and verifying clean shutdown