SLAM System API Documentation
Overview
This document describes all API interfaces of the SLAM system, including services, topics, actions, and more. The system is built on ROS1 and integrates SLAM, navigation, map management, and other capabilities.
Table of Contents
- Navigation Control Interface
- Map Management Services
- Task Point Management Services
- Global Localization Services
- Status Monitoring Topics
Navigation Control Interface
1. Start Navigation
/move_base/goal
Interface type: move_base_msgs/MoveBaseActionGoal
Description: Sends a navigation goal to start a navigation task
Field description:
| Field Name | Data Type | Description |
|---|---|---|
goal.target_pose.header.frame_id | string | Target coordinate frame (usually "map") |
goal.target_pose.pose.position.x | float64 | Target position X coordinate (m) |
goal.target_pose.pose.position.y | float64 | Target position Y coordinate (m) |
goal.target_pose.pose.position.z | float64 | Target position Z coordinate (m) |
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 | Description |
|---|---|---|
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 | Description |
|---|---|---|
| 0 | PENDING | Waiting |
| 1 | ACTIVE | Executing |
| 2 | PREEMPTED | Canceled (canceled successfully) |
| 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 reminder: Although status_list is an array, in practice you usually only need to retrieve the first element (status_list[0]), because the system normally handles only one navigation goal at a time.
3. Cancel Navigation
/move_base/cancel
Interface type: actionlib_msgs/GoalID
Description: Cancels the currently executing navigation task or all pending goals
Field description:
| Field Name | Data Type | Description |
|---|---|---|
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: Loads the specified map file
Request parameters:
| Field Name | Data Type | Description |
|---|---|---|
map_name | string | Map name |
Response parameters:
| Field Name | Data Type | Description |
|---|---|---|
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: Gets the name of the currently loaded map
Request parameters: None
Response parameters:
| Field Name | Data Type | Description |
|---|---|---|
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: Gets the list of all available maps
Request parameters: None
Response parameters:
| Field Name | Data Type | Description |
|---|---|---|
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 operations for task points
Operation type constants:
| Constant Value | Operation Name | Description |
|---|---|---|
| 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 | Description |
|---|---|---|---|
operation | int8 | ✅ | Operation type (0-3) |
task_point.pose.position.x | float64 | ⚠️ | Task point X coordinate (m); required for ADD/UPDATE unless use_robot_current_pose=true |
task_point.pose.position.y | float64 | ⚠️ | Task point Y coordinate (m); required for ADD/UPDATE unless use_robot_current_pose=true |
task_point.pose.position.z | float64 | ⚠️ | Task point Z coordinate (m); 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 position (for ADD/UPDATE operations); default false |
Response parameters:
| Field Name | Data Type | Description |
|---|---|---|
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 description:
ADD operation (operation=0)
- name: Optional; if not provided, the default name is used
- use_robot_current_pose: If
true, thetask_point.posefield is ignored and the robot's current position 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 position 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
- Other fields are ignored
GET operation (operation=3)
- All fields are ignored; returns the list of all task points
Example usage:
Add a Task Point (using a specified position)
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 position)
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: Navigates to the specified task point
Request parameters:
| Field Name | Data Type | Description |
|---|---|---|
task_name | string | Task point name |
Response parameters:
| Field Name | Data Type | Description |
|---|---|---|
success | bool | Navigation start status |
message | string | Status message |
Example usage:
rosservice call /navigate_to_task_point "task_name: 'home_position'"Global Localization Services
/initialpose_with_taskpoint
Service type: kuavo_mapping/InitialPoseWithTaskPoint
Description: Global localization based on a task point
Request parameters:
| Field Name | Data Type | Description |
|---|---|---|
task_point_name | string | Task point name |
Response parameters:
| Field Name | Data Type | Description |
|---|---|---|
success | bool | Operation success status |
message | string | Status message |
Usage: Receives a task point name, looks up the corresponding task point position 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 reminders:
Mapping-related
- When mapping, the robot's lidar must be level with the ground; if it is tilted, mapping will fail
- It is recommended to position the robot's head motor first, put the robot program into
cali_armmode, enable the head motor, and then start mapping - During mapping, the user should stand behind the robot to avoid blocking the lidar's field of view
- Make sure there are no dynamic objects in the environment; the environment should remain relatively static during mapping
- Back up the original file before editing a map, and maintain data consistency while editing
Localization and Map Switching
- ⚠️ Important limitation: If an
initial posehas already been provided, you cannot perform global localization again after switching maps (load_map) - It is recommended to provide the
initial poseonly after deciding 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 position is accurate - Deleting a task point cannot be undone; operate 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 the result
Troubleshooting
FAQ
- PCD file does not exist: Check whether map construction has completed, and wait long enough for FAST-LIO to generate point cloud data
- Navigation failure: Check whether the map file path is correct, and ensure the coordinate frame configuration is correct
- Abnormal sensor data: Check the LiDAR connection and driver configuration
- Localization failure: Ensure 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 database permissions are correct
- Unable to localize after switching maps: After switching maps, global localization must be performed again. If an initial pose was previously set, the navigation node may need to be restarted
- Failed to call the initialpose_with_taskpoint service:
- Check whether the task point name exists
- Ensure the
map_managernode is running properly - Check whether the
global_localizationnode is started and provides theset_initialposeservice
- Failed to call the set_initialpose service:
- Ensure the
global_localizationnode is running properly - Check whether the pose data format is correct
- Ensure the coordinate frame is set correctly (usually "map")
- Ensure the