simulation_logger.py — Records navigation simulation data to JSON.
For each room command received, logs:
- Departure: robot position + timestamp when the command was received
- Target: room name, room ID, and theoretical coordinates from registry
- Arrival: robot position + timestamp when Nav2 reports goal reached
- Duration: time elapsed between departure and arrival
- Position error: Euclidean distance between target and actual arrival
Output is a single JSON file per simulation run, saved under simulation_logs/.
Subscribes:
/room_command (std_msgs/String)
/bcr_bot/odom (nav_msgs/Odometry)
/navigate_to_pose/_action/status (action_msgs/GoalStatusArray)
/room_command_feedback (std_msgs/String)
/clock (rosgraph_msgs/Clock)
Parameters:
log_directory (str) — folder for simulation logs
room_registry (str) — path to room_registry.yaml (empty = auto-resolve)
odom_topic (str) — odometry topic
goal_reached_distance_m (float) — fallback distance threshold