cartographer实现切换地图功能
- 主要功能
主要功能
cartographer没有提供切换地图功能,本博客基于cartographer源码提供了切换地图功能的封装。具体措施如下:
ros2 service call /finish_trajectory cartographer_ros_msgs/srv/FinishTrajectory "{trajectory_id: 1}"ros2 service call /delete_trajectory cartographer_ros_msgs/srv/DeleteTrajectory "{trajectory_id: 0}"ros2 service call /load_state_from_file cartographer_ros_msgs/srv/LoadStateFromFile "{file_path: '/opt/beefast/map/2024-10-17_19-26-31.pbstream', load_frozen_state: true}"ros2 service call /start_trajectory cartographer_ros_msgs/srv/StartTrajectory "{configuration_directory: '/opt/beefast/config/',configuration_basename: 'cartographer_localization.lua',use_initial_pose: true,initial_pose: {position: {x: 0.0,y: 0.0,z: 0.0},orientation: {x: 0.0,y: 0.0,z: 0.0,w: 1.0}},relative_to_trajectory_id: 2
}"ros2 topic pub /beefast/navigation std_msgs/msg/String data:\ \'change_map\'\ --once