Roban2 Docs
Development Interfaces

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


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 NameData TypeDescription
goal.target_pose.header.frame_idstringTarget coordinate frame (usually "map")
goal.target_pose.pose.position.xfloat64Target position X coordinate (m)
goal.target_pose.pose.position.yfloat64Target position Y coordinate (m)
goal.target_pose.pose.position.zfloat64Target position Z coordinate (m)
goal.target_pose.pose.orientation.xfloat64Target orientation X component
goal.target_pose.pose.orientation.yfloat64Target orientation Y component
goal.target_pose.pose.orientation.zfloat64Target orientation Z component
goal.target_pose.pose.orientation.wfloat64Target 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 NameData TypeDescription
status_list[].goal_id.idstringGoal ID
status_list[].statusuint8Status code
status_list[].textstringStatus description text

Status code description:

Status CodeStatus NameDescription
0PENDINGWaiting
1ACTIVEExecuting
2PREEMPTEDCanceled (canceled successfully)
3SUCCEEDEDNavigation completed successfully
4ABORTEDNavigation failed
5REJECTEDExecution rejected

Example usage:

rostopic echo /move_base/status

Example 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 NameData TypeDescription
idstringGoal 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 NameData TypeDescription
map_namestringMap name

Response parameters:

Field NameData TypeDescription
successboolLoad success status
messagestringStatus 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 NameData TypeDescription
current_mapstringName 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 NameData TypeDescription
mapsstring[]List of all available map names

Example usage:

rosservice call /get_all_maps

Task Point Management Services

/task_point

Service type: kuavo_mapping/TaskPointOperation

Description: Create, read, update, and delete operations for task points

Operation type constants:

Constant ValueOperation NameDescription
0ADDAdd a task point
1UPDATEUpdate a task point
2DELETEDelete a task point
3GETGet all task points

Request parameters:

Field NameData TypeRequiredDescription
operationint8✅Operation type (0-3)
task_point.pose.position.xfloat64⚠️Task point X coordinate (m); required for ADD/UPDATE unless use_robot_current_pose=true
task_point.pose.position.yfloat64⚠️Task point Y coordinate (m); required for ADD/UPDATE unless use_robot_current_pose=true
task_point.pose.position.zfloat64⚠️Task point Z coordinate (m); required for ADD/UPDATE unless use_robot_current_pose=true
task_point.pose.orientation.xfloat64⚠️Task point orientation X component; required for ADD/UPDATE unless use_robot_current_pose=true
task_point.pose.orientation.yfloat64⚠️Task point orientation Y component; required for ADD/UPDATE unless use_robot_current_pose=true
task_point.pose.orientation.zfloat64⚠️Task point orientation Z component; required for ADD/UPDATE unless use_robot_current_pose=true
task_point.pose.orientation.wfloat64⚠️Task point orientation W component; required for ADD/UPDATE unless use_robot_current_pose=true
task_point.namestring⚠️Task point name; optional for ADD, required for UPDATE/DELETE
namestring⚠️Task point name (used for the operation); optional for ADD, required for UPDATE/DELETE
use_robot_current_posebool❌Whether to use the robot's current position (for ADD/UPDATE operations); default false

Response parameters:

Field NameData TypeDescription
successboolOperation success status
messagestringStatus message
task_points[].pose.position.xfloat64Task point X coordinate (returned by GET)
task_points[].pose.position.yfloat64Task point Y coordinate (returned by GET)
task_points[].pose.position.zfloat64Task point Z coordinate (returned by GET)
task_points[].pose.orientation.xfloat64Task point orientation X component (returned by GET)
task_points[].pose.orientation.yfloat64Task point orientation Y component (returned by GET)
task_points[].pose.orientation.zfloat64Task point orientation Z component (returned by GET)
task_points[].pose.orientation.wfloat64Task point orientation W component (returned by GET)
task_points[].namestringTask 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, the task_point.pose field 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, the task_point.pose field 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"

Service type: kuavo_mapping/NavigateToTaskPoint

Description: Navigates to the specified task point

Request parameters:

Field NameData TypeDescription
task_namestringTask point name

Response parameters:

Field NameData TypeDescription
successboolNavigation start status
messagestringStatus 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 NameData TypeDescription
task_point_namestringTask point name

Response parameters:

Field NameData TypeDescription
successboolOperation success status
messagestringStatus 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:

  • 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_arm mode, 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 pose has already been provided, you cannot perform global localization again after switching maps (load_map)
  • It is recommended to provide the initial pose only 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_taskpoint service is provided by the map_manager node and is used to set the initial pose by task point name
  • The set_initialpose service is provided by the global_localization node and is used to set the initial pose directly
  • Service call flow: initialpose_with_taskpoint → map_manager looks up the task point → calls set_initialpose → global_localization handles localization
  • Service calls are synchronous and wait for the operation to complete before returning the result

Troubleshooting

FAQ

  1. PCD file does not exist: Check whether map construction has completed, and wait long enough for FAST-LIO to generate point cloud data
  2. Navigation failure: Check whether the map file path is correct, and ensure the coordinate frame configuration is correct
  3. Abnormal sensor data: Check the LiDAR connection and driver configuration
  4. Localization failure: Ensure global localization has completed, and check whether the TF transforms are correct
  5. Task point operation failure: Check whether Map Manager is running properly and whether database permissions are correct
  6. 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
  7. Failed to call the initialpose_with_taskpoint service:
    • Check whether the task point name exists
    • Ensure the map_manager node is running properly
    • Check whether the global_localization node is started and provides the set_initialpose service
  8. Failed to call the set_initialpose service:
    • Ensure the global_localization node is running properly
    • Check whether the pose data format is correct
    • Ensure the coordinate frame is set correctly (usually "map")