# map_update **Repository Path**: evo-matrix_robotics/map_update ## Basic Information - **Project Name**: map_update - **Description**: map_update动态更新加载map的程序 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-17 - **Last Updated**: 2026-02-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # map_update ROS 2 utility node that loads occupancy grid maps from standard YAML/PGM files on demand and republishes them on the `map` topic at 1 Hz. The node exposes a service so that new maps can be requested without restarting the process. ## Build From the workspace root: ```bash colcon build --packages-select map_update source install/setup.bash ``` ## Launch Use the supplied launch file to load one of the sample maps under `config/00-PGM` during startup: ```bash ros2 launch map_update map_loader.launch.py ``` Arguments: - `map_yaml` (default: `share/map_update/config/00-PGM/floot4_inner.yaml`) - `map_frame` (default: `map`) ## Loading maps via service The node provides a `map_update/srv/LoadMap` service on `/load_map`. Call it with the absolute path to the YAML configuration you want to load: ```bash ros2 service call /load_map map_update/srv/LoadMap "{map_yaml_path: '/home/ubuntu20/01-program/07-HandBot_SLAM/slam_ws/src/map_update/config/00-PGM/floot_2.yaml'}" ``` On success the new map is cached and begins streaming on `map` at 1 Hz. Use `ros2 topic echo /map` or `ros2 topic hz /map` to verify the published data. ## Map requirements - YAML layout matches the standard `nav2_map_server` format (keys: `image`, `resolution`, `origin`, `negate`, `occupied_thresh`, `free_thresh`). - Supported image formats: binary (`P5`) or ASCII (`P2`) PGM. - Relative image paths are resolved relative to the YAML file's directory.