How mit-spark/hydra-ros works
Project Type and Purpose
• This is a full‐stack robotics perception application built on ROS Noetic.
• Its goal: wrap the MIT‐SPARK Hydra real‐time 3D scene‐graph construction/optimization library into ROS nodes (hydra_ros), define custom ROS messages/services (hydra_msgs), and provide a standalone visualizer (hydra_visualizer).
File Structure to Find Major Components
• Top‐level packages:
• hydra_msgs: custom ROS messages (msg/) and services (srv/).
• hydra_ros: the ROS interface to Hydra – C++/Python nodes, organized into modules (input, frontend, backend, loop_closing, odometry, openset, utils), launch files, configs, and tests.
• hydra_visualizer: standalone ROS-based visualizer with plugins, graph I/O wrappers, and RViz configs.
• Support directories:
• dev/: linting and formatting scripts.
• doc/: user guides.
• .github/: contribution templates.
Out the Main Components
a. ROS Master (central broker)
b. hydra_msgs package
– Topics: ActiveLayer, DsgUpdate
– Services: GetDsg, QueryFreespace
c. hydra_ros nodes (group them):
• Input Modules
– ros_sensors, bag_reader, pointcloud_receiver, image_receiver – subscribe to raw sensor data / bags.
• Hydra Pipeline Orchestrator
– hydra_ros_pipeline node (coordinates frontend → backend).
• Frontend Modules
– GVD occupancy publisher, object_visualizer, places_visualizer – process raw data into intermediate representations.
• Backend Modules
– ros_backend_publisher – performs optimization, publishes final scene graph.
• Loop Closure & Odometry
– ros_lcd_registration, ros_pose_graph_tracker – detect loops, maintain pose graph.
• Openset Module
– ros_embedding_group – handles embeddings for open‐set recognition.
• Utilities
– TF lookups, lazy publisher, scene_graph_logger – shared helpers.
d. hydra_visualizer nodes:
• hydra_visualizer_node – subscribes to DsgUpdate and raw graph I/O via ROS or ZMQ.
• Config manager & I/O wrappers – graph_ros_wrapper, graph_file_wrapper, graph_zmq_wrapper.
e. External Services / Tools
– RViz (via .rviz files), bag playback, dataset launch files.
Relationships and Data Flow
• Sensor data → Input Modules (subscribe on /camera/…, /velodyne/…)
• Input Modules → Frontend (publish intermediate topics or feed directly into pipeline node)
• Frontend → Backend (intermediate GVD/places → final scene graph)
• Backend → hydra_msgs topics (DsgUpdate published)
• hydra_visualizer_node subscribes to DsgUpdate → passes graph to plugins → renders in RViz.
• Services (GetDsg, QueryFreespace) called by external clients to query current graph or freespace.
• Loop closure & odometry modules feed back into the pipeline to refine the graph.
Architectural Patterns
• ROS publisher/subscriber pattern for data flow.
• Modular pipeline: clear separation of input → front-end → back-end → visualization.
• Launch files configure and wire up entire graph per dataset.