7.8 Navigation Control Section
7.8 Navigation Control Section
Section titled “7.8 Navigation Control Section”7.8.1 Overview
Section titled “7.8.1 Overview”The A2 Ultra robot comes pre-installed with basic mapping, localization, and navigation capabilities. Users can perform various tasks such as navigating to waypoints, target points, and specified routes through secondary development interfaces. Additionally, it includes features like dynamic obstacle recognition and avoidance.
The navigation task issuance interfaces vary based on the navigation logic. Instead of listing each interface’s documentation separately, we will provide a unified explanation of the differences in input and output parameters for these interfaces.
Unified Explanation of Navigation Task Issuance Interfaces:
- Before executing a task, the robot must successfully relocalize, and the map ID for the task must match the relocalized map.
- Before executing a task, the MC state must be switched to RL_LOCOMOTION_DEFAULT (reinforced straight leg) mode; otherwise, the robot may not respond correctly to PNC speed commands.
- When issuing a task, a
task_idmust be set. If not set (default is 0), PNC will generate atask_idand return it in the response. The client needs to save thistask_idfor subsequent control instructions or to query the task status.
Code examples are located in the examples/pnc/ directory. Each interface has a corresponding script, and the filenames indicate their purpose. There is a complete end-to-end example in example/pnc/pnc_demo.py that covers obtaining the map ID, selecting waypoint IDs, issuing navigation tasks, and monitoring task status.
Field Unified Explanation
task_id: Task ID. If not set (default is 0), PNC will generate atask_idand return it in the response. The client needs to save thistask_idfor subsequent control instructions or to query the task status.map_id: Map ID. The current map ID must be provided.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 sent and received. A return value ofCommonState_SUCCESSindicates success, while other values indicate failure.ackerman_mode: Reserved field, not in use. Follow the example for filling.guide_line_id: Reserved field, not in use. Follow the example for filling.
7.8.2 Point Navigation RPC Interface
Section titled “7.8.2 Point Navigation RPC Interface”| Interface Name | Interface Description | URL | Input Parameters | Output Parameters | Remarks |
|---|---|---|---|---|---|
pb:/aimdk.protocol.PncService/PlanningNaviToGoal |
Issue a planning navigation task for a given target point ID | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/PlanningNaviToGoal | |
|
The accuracy range is approximately 0.4 meters |
pb:/aimdk.protocol.PncService/PlanningNaviToPose2D |
Issue a planning navigation task for a given target pose | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/PlanningNaviToPose2D | |
|
The accuracy range is approximately 0.4 meters |
pb:/aimdk.protocol.PncService/LinearNaviToRelative |
Issue a linear navigation task for a given relative target pose | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/LinearNaviToRelative | |
|
First perform an in-place rotation, then execute a linear movement |
pb:/aimdk.protocol.PncService/LinearNaviToGoal |
Issue a linear navigation task for a given target point ID | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/LinearNaviToGoal | |
|
First perform an in-place rotation, then execute a linear movement |
pb:/aimdk.protocol.PncService/LinearNaviToPose2D |
Issue a linear navigation task for a given target pose | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/LinearNaviToPose2D | |
|
First perform an in-place rotation, then execute a linear movement |
pb:/aimdk.protocol.PncService/DirectNaviToRelativeGoal |
Issue a direct movement task for a given target point ID | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/DirectNaviToRelativeGoal | |
|
Translate and rotate simultaneously, suitable only for tasks where the deviation between the target point and the robot's orientation is small; otherwise, it may result in significant positioning errors |
pb:/aimdk.protocol.PncService/DirectNaviToRelative |
Issue a direct movement task for a given relative target pose | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/DirectNaviToRelative | |
|
|
pb:/aimdk.protocol.PncService/PreciseNaviToGoal |
Issue a high-precision navigation task for a given target point ID | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/PreciseNaviToGoal | |
|
This is only applicable for high-precision point-to-point tasks in special scenarios. The robot will first navigate to a position approximately 0.5 meters behind the target using normal planning and navigation mode, and then move directly to the target without obstacle avoidance, possibly making multiple adjustments. The precision of reaching the target is about 0.1 meters. It is necessary to ensure that there is sufficient space behind the target. This mode is not recommended for non-special requirements. |
7.8.3 Simple Movement RPC Interface
Section titled “7.8.3 Simple Movement RPC Interface”| Interface Name | Interface Description | URL | Input Parameters | Output Parameters | Remarks |
|---|---|---|---|---|---|
pb:/aimdk.protocol.PncService/SpinTurnAndMoveForward |
Issue a task for on-the-spot rotation followed by straight-line movement. The on-the-spot rotation will be executed first, followed by the straight-line movement. | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/SpinTurnAndMoveForward | |
|
|
pb:/aimdk.protocol.PncService/SpinTurn |
Issue a task for on-the-spot rotation. | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/SpinTurn | |
|
|
pb:/aimdk.protocol.PncService/MoveForward |
Issue a task for straight-line translation. | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/MoveForward | |
|
The orientation of the machine will not change after the task is executed. |
7.8.4 Task Query and Control RPC Interface
Section titled “7.8.4 Task Query and Control RPC Interface”| Interface Name | Interface Description | URL | Input Parameters | Output Parameters | Remarks |
|---|---|---|---|---|---|
pb:/aimdk.protocol.PncService/ActionCancel |
Issue a command to cancel a task. | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/ActionCancel | |
|
The command will only respond if the task_id matches; otherwise, it returns CommonState_FAILURE. |
pb:/aimdk.protocol.PncService/ActionPause |
Issue a command to pause a task. | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/ActionPause | |
|
The command will only respond if the task_id matches; otherwise, it returns CommonState_FAILURE. |
pb:/aimdk.protocol.PncService/ActionResume |
Issue a command to resume a paused task. | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/ActionResume | |
|
The command will only respond if the task_id matches; otherwise, it returns CommonState_FAILURE. |
pb:/aimdk.protocol.PncService/ActionGetState |
Get the navigation task state. | http://192.168.100.110:53176/rpc/aimdk.protocol.PncService/ActionGetState | |
|
If the requested task_id is 0, it returns the task_id and corresponding state of the most recent task. For other task_id mismatches, it returns PncServiceState_FAILED. |