7.9 Planning and Navigation
7.9 Planning and Navigation
7.9.1 Overview
The A3-Ultra robot comes preconfigured with basic mapping, localization, and navigation capabilities. Through the secondary development interfaces, users can perform tasks such as navigation by waypoint, navigation to a target pose, and navigation along a specified route. It also supports dynamic obstacle detection and avoidance.
There are multiple interfaces for issuing navigation tasks based on different navigation logic. Instead of documenting each interface separately, this section provides a unified explanation of the differences in their input and output parameters.
General notes for navigation task interfaces:
- Before executing a task, the robot must have completed relocalization successfully, and the
map_idin the request must match the map used for relocalization. - Before executing a task, switch the MC state to
RL_LOCOMOTION_DEFAULT(reinforced straight-leg) mode. Otherwise, the robot may not respond correctly to PNC velocity commands. - When issuing a task, set
task_id. If it is not set (default is0), PNC will generate atask_idautomatically and return it in the response. The client should save thistask_idfor later control commands or task-status queries.
Code examples are in the examples/pnc/ directory. Each interface has a corresponding script whose purpose can be identified from the filename. A complete end-to-end example, from obtaining the map ID and selecting a waypoint ID to issuing a navigation task and monitoring task status, is available at example/pnc/pnc_demo.py.
Field descriptions
- task_id: Task ID. If it is not set (default is
0), PNC will generate atask_idautomatically and return it in the response. The client should save it for later control commands or task-status queries. - map_id: Map ID. Fill in the current map ID.
- target_id: Navigation point ID.
- pose: 2D world-coordinate pose.
- pose_offset: Relative offset from the target point.
- state: Unless otherwise specified, this indicates whether the request was successfully delivered and accepted.
CommonState_SUCCESSmeans success; any other value means failure. - ackerman_mode: Reserved field, currently unused. Fill it in as shown in the example.
- guide_line_id: Reserved field, currently unused. Fill it in as shown in the example.
7.9.2 Point-to-Point Navigation RPC Interfaces
| Interface Name | Interface Description | URL | Input Parameters | Output Parameters | Notes |
|---|---|---|---|---|---|
pb:/aimdk.protocol.PncService/PlanningNaviToGoal | Issues a planned navigation task for the specified target point ID | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/PlanningNaviToGoal | text | text | Maximum arrival accuracy is approximately 0.4 m |
pb:/aimdk.protocol.PncService/PlanningNaviToPose2D | Issues a planned navigation task for the specified target pose | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/PlanningNaviToPose2D | text | text | Maximum arrival accuracy is approximately 0.4 m |
pb:/aimdk.protocol.PncService/LinearNaviToRelative | Issues a straight-line navigation task for the specified relative target pose | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/LinearNaviToRelative | text | text | First performs an in-place rotation, then moves in a straight line |
pb:/aimdk.protocol.PncService/LinearNaviToGoal | Issues a straight-line navigation task for the specified target point ID | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/LinearNaviToGoal | text | text | First performs an in-place rotation, then moves in a straight line |
pb:/aimdk.protocol.PncService/LinearNaviToPose2D | Issues a straight-line navigation task for the specified target pose | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/LinearNaviToPose2D | text | text | First performs an in-place rotation, then moves in a straight line |
pb:/aimdk.protocol.PncService/DirectNaviToRelativeGoal | Issues a direct-movement task for the specified target point ID | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/DirectNaviToRelativeGoal | text | text | Translates and rotates simultaneously. Suitable only when the target orientation differs little from the robot orientation; otherwise the arrival error may be large |
pb:/aimdk.protocol.PncService/DirectNaviToRelative | Issues a direct-movement task for the specified relative target pose | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/DirectNaviToRelative | text | text | |
pb:/aimdk.protocol.PncService/PreciseNaviToGoal | Issues a high-precision navigation task for the specified target point ID | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/PreciseNaviToGoal | text | text | For special high-precision arrival scenarios only. The robot first moves to a point about 0.5 m behind the target using normal planned navigation, then moves directly to the target. During direct movement it does not avoid obstacles and may adjust multiple times. Arrival accuracy is about 0.1 m. Ensure there is enough space behind the target point. This mode is not recommended unless necessary. |
7.9.3 Simple Movement RPC Interfaces
| Interface Name | Interface Description | URL | Input Parameters | Output Parameters | Notes |
|---|---|---|---|---|---|
pb:/aimdk.protocol.PncService/SpinTurnAndMoveForward | Issues a task for in-place rotation followed by straight forward movement | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/SpinTurnAndMoveForward | text | text | |
pb:/aimdk.protocol.PncService/SpinTurn | Issues an in-place rotation task | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/SpinTurn | text | text | |
pb:/aimdk.protocol.PncService/MoveForward | Issues a straight-line translation task | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/MoveForward | text | text | The robot orientation does not change after the task finishes |
7.9.4 Task Query and Control RPC Interfaces
| Interface Name | Interface Description | URL | Input Parameters | Output Parameters | Notes |
|---|---|---|---|---|---|
pb:/aimdk.protocol.PncService/ActionCancel | Issues a task-cancel command | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/ActionCancel | text | text | The command is accepted only when `task_id` matches; otherwise `CommonState_FAILURE` is returned |
pb:/aimdk.protocol.PncService/ActionPause | Issues a task-pause command | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/ActionPause | text | text | The command is accepted only when `task_id` matches; otherwise `CommonState_FAILURE` is returned |
pb:/aimdk.protocol.PncService/ActionResume | Issues a command to resume a paused task | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/ActionResume | text | text | The command is accepted only when `task_id` matches; otherwise `CommonState_FAILURE` is returned |
pb:/aimdk.protocol.PncService/ActionGetState | Gets the navigation task status | http://10.42.10.11:53176/rpc/aimdk.protocol.PncService/ActionGetState | text | text
| If the requested `task_id` is `0`, the service returns the most recent task ID and its corresponding status. For any other non-matching `task_id`, `PncServiceState_FAILED` is returned. |