Add rosbag_blackbox: ROS2 ring buffer recorder + AI-accessible snapshot server#1
Merged
Merged
Conversation
Co-authored-by: marc-hanheide <1153084+marc-hanheide@users.noreply.github.com>
Co-authored-by: marc-hanheide <1153084+marc-hanheide@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add rosbag_blackbox package with ringbuffer implementation
Add rosbag_blackbox: ROS2 ring buffer recorder + AI-accessible snapshot server
Mar 11, 2026
marc-hanheide
marked this pull request as ready for review
March 11, 2026 23:07
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.
Implements a new
ament_pythonROS2 Humble package with two nodes: a memory-efficient ring buffer recorder and a FastAPI+MCP snapshot introspection server.Ring Buffer Node (
ringbuffer_node)ros2 bag recordbehaviour)*matches one path segment,**matches any namespace depthreliability,durability,depth); default isbest_effort/volatileto minimise system impactdurability: transient_localfor latched topicsmax_frequencyper topic — messages arriving faster than the configured Hz are silently droppeddeque; old entries evicted on everyadd()std_srvs/srv/Triggerservice (~/save_snapshot) dumps buffer → SQLite3 rosbag; filename pattern supports{datetime},{date},{time},{timestamp}placeholdersSnapshot Server (
snapshot_server)keys_only,truncate_arrays), stream image as PNG/mcp(streamable-HTTP) — AI agent tools mirror the REST surface:list_snapshots,select_snapshot,get_snapshot_metadata,list_topics,search_topics,get_messages,get_imagesensor_msgs/Image+CompressedImage→ PNG via numpy/Pillow; all other types → JSON viarosidl_runtime_pyfastapi,uvicorn,fastmcp,numpy,Pillow) are optional with graceful fallback — the recorder node builds and runs without themPackage structure
ring_buffer.pytopic_filter.pyringbuffer_node.pysnapshot_server.pylaunch/rosbag_blackbox.launch.pyconfig/example_config.yamlOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.