SLAM System API Documentation
Overview
This document describes all API interfaces of the SLAM system, including services, topics, and actions. The system is built on ROS1 and integrates SLAM, navigation, map management, and other functions.
Table of Contents
- Navigation Control Interfaces
- Map Management Services
- Task Point Management Services
- Global Localization Service
- Status Monitoring Topics
Navigation Control Interfaces
1. Start Navigation
/move_base/goal
Interface Type: move_base_msgs/MoveBaseActionGoal
Description: Send a navigation goal to start a navigation task
Field Description:
| Field Name | Data Type | Meaning |
|---|---|---|
goal.target_pose.header.frame_id | string | Target coordinate frame (usually "map") |
goal.target_pose.pose.position.x | float64 | Target position X coordinate (meters) |
goal.target_pose.pose.position.y | float64 | Target position Y coordinate (meters) |
goal.target_pose.pose.position.z | float64 | Target position Z coordinate (meters) |
goal.target_pose.pose.orientation.x | float64 | Target orientation X component |
goal.target_pose.pose.orientation.y | float64 | Target orientation Y component |
goal.target_pose.pose.orientation.z | float64 | Target orientation Z component |
goal.target_pose.pose.orientation.w | float64 | Target orientation W component |
Example Usage:
rostopic pub /move_base/goal move_base_msgs/MoveBaseActionGoal "header:
seq: 0
stamp: {secs: 0, nsecs: 0}
frame_id: ''
goal_id:
stamp: {secs: 0, nsecs: 0}
id: ''
goal:
target_pose:
header:
seq: 0
stamp: {secs: 0, nsecs: 0}
frame_id: 'map'
pose:
position: {x: 1.0, y: 2.0, z: 0.0}
orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}"2. Navigation Status Monitoring
/move_base/status
Interface Type: actionlib_msgs/GoalStatusArray
Description: View the execution status of the current navigation goal
Field Description:
| Field Name | Data Type | Meaning |
|---|---|---|
status_list[].goal_id.id | string | Goal ID |
status_list[].status | uint8 | Status code |
status_list[].text | string | Status description text |
Status Code Description:
| Status Code | Status Name | Meaning |
|---|---|---|
| 0 | PENDING | Waiting |
| 1 | ACTIVE | Executing |
| 2 | PREEMPTED | Canceled (successfully canceled) |
| 3 | SUCCEEDED | Navigation completed successfully |
| 4 | ABORTED | Navigation failed |
| 5 | REJECTED | Execution rejected |
Example Usage:
rostopic echo /move_base/statusExample Output:
status_list:
- goal_id:
id: "goal_2025-06-26-13-45-00"
status: 2
text: "Goal canceled."⚠️ Important Note: Although status_list is an array, in practice you usually only need to retrieve the first element (status_list[0]), because the system typically handles only one navigation goal.
3. Cancel Navigation
/move_base/cancel
Interface Type: actionlib_msgs/GoalID
Description: Cancel the currently executing navigation task or all pending goals
Field Description:
| Field Name | Data Type | Meaning |
|---|---|---|
id | string | Goal ID (an empty string means cancel all goals) |
Usage:
Cancel All Navigation Goals
rostopic pub /move_base/cancel actionlib_msgs/GoalID '{}'Map Management Services
/load_map
Service Type: kuavo_mapping/LoadMap
Description: Load the specified map file
Request Parameters:
| Field Name | Data Type | Meaning |
|---|---|---|
map_name | string | Map name |
Response Parameters:
| Field Name | Data Type | Meaning |
|---|---|---|
success | bool | Load success status |
message | string | Status message |
Example Usage:
rosservice call /load_map "map_name: 'map_2025-01-15_10-30-00'"/get_current_map
Service Type: kuavo_mapping/GetCurrentMap
Description: Get the name of the currently loaded map
Request Parameters: None
Response Parameters:
| Field Name | Data Type | Meaning |
|---|---|---|
current_map | string | Name of the currently loaded map |
Example Usage:
rosservice call /get_current_map/get_all_maps
Service Type: kuavo_mapping/GetAllMaps
Description: Get the list of all available maps
Request Parameters: None
Response Parameters:
| Field Name | Data Type | Meaning |
|---|---|---|
maps | string[] | List of all available map names |
Example Usage:
rosservice call /get_all_mapsTask Point Management Services
/task_point
Service Type: kuavo_mapping/TaskPointOperation
Description: Create, read, update, and delete task points
Operation Type Constants:
| Constant Value | Operation Name | Meaning |
|---|---|---|
| 0 | ADD | Add a task point |
| 1 | UPDATE | Update a task point |
| 2 | DELETE | Delete a task point |
| 3 | GET | Get all task points |
Request Parameters:
| Field Name | Data Type | Required | Meaning |
|---|---|---|---|
operation | int8 | ✅ | Operation type (0-3) |
task_point.pose.position.x | float64 | ⚠️ | Task point X coordinate (meters); required for ADD/UPDATE unless use_robot_current_pose=true |
task_point.pose.position.y | float64 | ⚠️ | Task point Y coordinate (meters); required for ADD/UPDATE unless use_robot_current_pose=true |
task_point.pose.position.z | float64 | ⚠️ | Task point Z coordinate (meters); required for ADD/UPDATE unless use_robot_current_pose=true |
task_point.pose.orientation.x | float64 | ⚠️ | Task point orientation X component; required for ADD/UPDATE unless use_robot_current_pose=true |
task_point.pose.orientation.y | float64 | ⚠️ | Task point orientation Y component; required for ADD/UPDATE unless use_robot_current_pose=true |
task_point.pose.orientation.z | float64 | ⚠️ | Task point orientation Z component; required for ADD/UPDATE unless use_robot_current_pose=true |
task_point.pose.orientation.w | float64 | ⚠️ | Task point orientation W component; required for ADD/UPDATE unless use_robot_current_pose=true |
task_point.name | string | ⚠️ | Task point name; optional for ADD, required for UPDATE/DELETE |
name | string | ⚠️ | Task point name (used for the operation); optional for ADD, required for UPDATE/DELETE |
use_robot_current_pose | bool | ❌ | Whether to use the robot's current pose (for ADD/UPDATE operations); defaults to false |
Response Parameters:
| Field Name | Data Type | Meaning |
|---|---|---|
success | bool | Operation success status |
message | string | Status message |
task_points[].pose.position.x | float64 | Task point X coordinate (returned by GET) |
task_points[].pose.position.y | float64 | Task point Y coordinate (returned by GET) |
task_points[].pose.position.z | float64 | Task point Z coordinate (returned by GET) |
task_points[].pose.orientation.x | float64 | Task point orientation X component (returned by GET) |
task_points[].pose.orientation.y | float64 | Task point orientation Y component (returned by GET) |
task_points[].pose.orientation.z | float64 | Task point orientation Z component (returned by GET) |
task_points[].pose.orientation.w | float64 | Task point orientation W component (returned by GET) |
task_points[].name | string | Task point name (returned by GET) |
Operation Details:
ADD Operation (operation=0)
- name: Optional. If not provided, a default name is used.
- use_robot_current_pose: If
true, thetask_point.posefield is ignored and the robot's current pose is used. - task_point.pose: Required when
use_robot_current_pose=false.
UPDATE Operation (operation=1)
- name: Required. Specifies the name of the task point to update.
- use_robot_current_pose: If
true, thetask_point.posefield is ignored and the robot's current pose is used. - task_point.pose: Required when
use_robot_current_pose=false.
DELETE Operation (operation=2)
- name: Required. Specifies the name of the task point to delete.
- All other fields are ignored.
GET Operation (operation=3)
- All fields are ignored, and the list of all task points is returned.
Example Usage:
Add a Task Point (Using a Specified Pose)
rosservice call /task_point "operation: 0
task_point:
pose:
position: {x: 1.0, y: 2.0, z: 0.0}
orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}
name: 'home_position'
name: 'home_position'
use_robot_current_pose: false"Add a Task Point (Using the Robot's Current Pose)
rosservice call /task_point "operation: 0
task_point:
pose:
position: {x: 0.0, y: 0.0, z: 0.0}
orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}
name: 'current_position'
name: 'current_position'
use_robot_current_pose: true"Update a Task Point
rosservice call /task_point "operation: 1
task_point:
pose:
position: {x: 2.0, y: 3.0, z: 0.0}
orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}
name: 'home_position'
name: 'home_position'
use_robot_current_pose: false"Delete a Task Point
rosservice call /task_point "operation: 2
task_point:
pose:
position: {x: 0.0, y: 0.0, z: 0.0}
orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}
name: 'home_position'
name: 'home_position'
use_robot_current_pose: false"Get All Task Points
rosservice call /task_point "operation: 3
task_point:
pose:
position: {x: 0.0, y: 0.0, z: 0.0}
orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}
name: ''
name: ''
use_robot_current_pose: false"/navigate_to_task_point
Service Type: kuavo_mapping/NavigateToTaskPoint
Description: Navigate to the specified task point
Request Parameters:
| Field Name | Data Type | Meaning |
|---|---|---|
task_name | string | Task point name |
Response Parameters:
| Field Name | Data Type | Meaning |
|---|---|---|
success | bool | Navigation start status |
message | string | Status message |
Example Usage:
rosservice call /navigate_to_task_point "task_name: 'home_position'"Global Localization Service
/initialpose_with_taskpoint
Service Type: kuavo_mapping/InitialPoseWithTaskPoint
Description: Global localization based on a task point
Request Parameters:
| Field Name | Data Type | Meaning |
|---|---|---|
task_point_name | string | Task point name |
Response Parameters:
| Field Name | Data Type | Meaning |
|---|---|---|
success | bool | Operation success status |
message | string | Status message |
Usage: Receives a task point name, looks up the corresponding task point pose by name, and automatically calls the set_initialpose service to perform global localization
Example Usage:
# 通过任务点名称进行定位
rosservice call /initialpose_with_taskpoint "task_point_name: 'task1'"Notes
⚠️ Important Notes:
Mapping-Related
- When mapping, the robot's lidar must be level with the ground; any tilt will cause mapping to fail
- It is recommended to position the robot's head motors first, put the robot program into cali_arm mode, and enable the head motors before mapping
- During mapping, the user should stand behind the robot to avoid blocking the lidar's field of view
- Ensure there are no dynamic objects in the environment; the environment should remain relatively static during mapping
- Back up the original file before editing the map, and take care to maintain data consistency while editing
Localization and Map Switching
- ⚠️ Important Limitation: If you switch maps (load_map) after an
initial posehas been provided, you can no longer perform global localization - It is recommended to provide the
initial poseonly after you have determined which map to use
Task Point Management
- Task point names must be unique within the same map
- When using
use_robot_current_pose=true, make sure the robot's pose is accurate - Deleting a task point cannot be undone, so proceed with caution
Global Localization Service
- The
initialpose_with_taskpointservice is provided by themap_managernode and is used to set the initial pose by task point name - The
set_initialposeservice is provided by theglobal_localizationnode and is used to set the initial pose directly - Service call flow:
initialpose_with_taskpoint→map_managerlooks up the task point → callsset_initialpose→global_localizationhandles localization - Service calls are synchronous and wait for the operation to complete before returning a result
Troubleshooting
Common Issues
- PCD file does not exist: Check whether map construction is complete, and wait long enough for FAST-LIO to generate point cloud data.
- Navigation failure: Check whether the map file path is correct, and make sure the coordinate frame configuration is correct.
- Abnormal sensor data: Check the LiDAR connection and driver configuration.
- Localization failure: Make sure global localization has completed, and check whether the TF transforms are correct.
- Task point operation failure: Check whether Map Manager is running properly and whether the database permissions are correct.
- Unable to localize after switching maps: After switching maps, global localization must be performed again. If an initial pose has already been set previously, you may need to restart the navigation node.
initialpose_with_taskpointservice call failure:- Check whether the task point name exists
- Make sure the
map_managernode is running properly - Check whether the
global_localizationnode is started and provides theset_initialposeservice
set_initialposeservice call failure:- Make sure the
global_localizationnode is running properly - Check whether the pose data format is correct
- Make sure the coordinate frame is set correctly (usually "map")
- Make sure the