Elevator Navigation
Introduction
Elevator navigation refers to the robot’s ability to move: the robot can travel from point A to point B, automatically plan its route along the way, automatically switch maps between floors, and effectively avoid obstacles.
Robot navigation uses many sensors, including the bottom lidar, RGBD and the head IR sensor (on some models). Do not block these sensors during navigation, or problems such as the robot not moving or path planning failing may occur.
The robot can only navigate if: a map has been created for it and it has been localized successfully on that map; a patrol line has been created for it; it is standing on a map point of the patrol line; it does not use a copied map (a copied map causes map point ID and floor conflicts, and destinations cannot be reached); the lidar is on; and it is an elevator-control robot. Be sure to keep this in mind!
Note: Kagao elevator control requires ROM 10.3 or later; in-house elevator control requires ROM 10.5 or later. Ask your pre-sales contact which elevator control type your robot uses.
Get Multi-Map Point Data
Method name: getMultiFloorConfigAndPose Result callback:
//Get the multi-map point list:
RobotApi.getInstance().getMultiFloorConfigAndPose(Definition.DEBUG_REQ_ID, new CommandListener() {
@Override
public void onResult(int result, String message, String extraData) {
Type type = new TypeToken<ArrayList<MultiFloorInfo>>() {
}.getType();
try {
Log.d(TAG, "initAllMapInfo: " + result + " msg:" + message);
mDatas = new Gson().fromJson(message, type);
} catch (Exception e) {
e.printStackTrace();
}
}
});
Navigate to a Specified Location
Method name: startElevatorNavigation Result callback:
RobotApi.getInstance().startElevatorNavigation(Definition.DEBUG_REQ_ID,
dest,
floor,
new ActionListener() {
@Override
public void onResult(int status, String message, String extraData) throws RemoteException {
Log.e("mName", "onResult: " + status + " responseString:" + message + " extraData:" + extraData);
handlerResult(status, message, extraData);
}
@Override
public void onError(int errorCode, String errorString, String extraData) throws RemoteException {
Log.e("mName", "onError: " + errorCode + " errorString:" + errorString + " extraData:" + extraData);
handlerError(errorCode, errorString, extraData);
}
@Override
public void onStatusUpdate(int status, String data, String extraData) throws RemoteException {
Log.e("mName", "onStatusUpdate: " + status + " data:" + data + " extraData:" + extraData);
handlerStatusUpdate(status, data, extraData);
}
});
handlerResult method:
private void handlerResult(int status, String message, String extraData) {
switch (status) {
case Definition.RESULT_OK:
//stop(ComponentResult.RESULT_NAVIGATION_ARRIVED, message, extraData);
break;
case Definition.ACTION_RESPONSE_STOP_SUCCESS:
//stop(status, message + " stopped successfully", extraData);
break;
case Definition.RESULT_FAILURE:
//stop(status, message + " navigation failed", extraData);
break;
case Definition.STATUS_NAVI_OUT_MAP:
//stop(ComponentError.ERROR_NAVIGATION_OUT_MAP, message, extraData);
break;
case Definition.STATUS_NAVI_GLOBAL_PATH_FAILED:
//stop(ComponentError.ERROR_NAVIGATION_GLOBAL_PATH_FAILED, message, extraData);
break;
case Definition.STATUS_NAVI_MULTI_MAP_NOT_MATCH:
case Definition.STATUS_NAVI_MULTI_LORA_DISCONNECT:
case Definition.STATUS_NAVI_MULTI_LORA_CONFIG_FAIL:
case Definition.STATUS_NAVI_MULTI_VERSION_NOT_MATCH:
//stop(ComponentError.ERROR_MULTIPLE_MODE_ERROR, message, extraData);
break;
case Definition.STATUS_NAVI_WHEEL_SLIP:
//stop(ComponentError.ERROR_NAVI_WHEEL_SLIP, message, extraData);
break;
default:
//stop(status, message, extraData);
break;
}
}
handlerError method:
private void handlerError(int errorCode, String message, String extraData) {
switch (errorCode) {
case Definition.ERROR_NOT_ESTIMATE:
// stop(ComponentError.ERROR_NOT_ESTIMATE, "navigation not estimate", extraData);
break;
case Definition.ERROR_IN_DESTINATION:
// stop(ComponentError.ERROR_NAVIGATION_ALREADY_IN_DESTINATION, "already in destination", extraData);
break;
case Definition.ERROR_DESTINATION_NOT_EXIST:
// stop(ComponentError.ERROR_DESTINATION_NOT_EXIST, "destination not exist", extraData);
break;
case Definition.ERROR_DESTINATION_CAN_NOT_ARRAIVE:
// stop(ComponentError.ERROR_DESTINATION_CAN_NOT_ARRIVE, "navigation moving time out", extraData);
break;
case Definition.ERROR_MULTI_ROBOT_WAITING_TIMEOUT:
// stop(ComponentError.ERROR_MULTI_ROBOT_WAITING_TIMEOUT);
break;
case Definition.ERROR_NAVIGATION_AVOID_TIMEOUT:
// stop(ComponentError.ERROR_NAVIGATION_AVOID_TIMEOUT, "navigation avoid time out", "");
case Definition.ACTION_RESPONSE_ALREADY_RUN:
// stop(ComponentError.ERROR_REQUEST_RES_BUSY);
break;
case Definition.ACTION_RESPONSE_REQUEST_RES_ERROR:
// stop(ComponentError.ERROR_REQUEST_RES_FAILED);
break;
case Definition.ERROR_WHEEL_OVER_CURRENT_RUN_OUT:
// stop(ComponentError.ERROR_WHEEL_OVER_CURRENT_RUN_OUT, "wheel over current retry count run out", extraData);
break;
case Definition.ACTION_RESPONSE_RES_UNAVAILBALE:
// stop(ComponentError.ERROR_OPEN_RADAR_FAILED, "res unavailable: " + message, extraData);
break;
default:
// stop(errorCode, message, extraData);
break;
}
}
handlerStatusUpdate method:
private void handlerStatusUpdate(int status, String data, String extraData) {
switch (status) {
case Definition.STATUS_GOAL_OCCLUDED:
case Definition.STATUS_NAVI_AVOID:
// updateStatus(ComponentStatus.STATUS_NAVIGATION_AVOID_START,"navigation avoid start", extraData);
break;
case Definition.STATUS_GOAL_OCCLUDED_END:
case Definition.STATUS_NAVI_AVOID_END:
// updateStatus(ComponentStatus.STATUS_NAVIGATION_AVOID_END,"navigation avoid end", extraData);
break;
case Definition.STATUS_NAVI_OBSTACLES_AVOID:
// updateStatus(ComponentStatus.STATUS_OBSTACLES_AVOID,"pause to obstacles avoid", extraData);
break;
case Definition.STATUS_START_NAVIGATION:
// updateStatus(ComponentStatus.STATUS_START_NAVIGATION,"start navigation");
break;
case Definition.STATUS_NAVI_MULTI_ROBOT_WAITING:
// updateStatus(ComponentStatus.STATUS_NAVI_MULTI_ROBOT_WAITING,"navigation multi robot waiting");
break;
case Definition.STATUS_NAVI_MULTI_ROBOT_WAITING_END:
// updateStatus(ComponentStatus.STATUS_NAVI_MULTI_ROBOT_WAITING_END,"navigation multi robot waiting end");
break;
case Definition.STATUS_NAVI_GO_STRAIGHT:
// updateStatus(ComponentStatus.STATUS_NAVIGATION_GO_STRAIGHT, data,extraData);
break;
case Definition.STATUS_NAVI_TURN_LEFT:
// updateStatus(ComponentStatus.STATUS_NAVIGATION_TURN_LEFT, data, extraData);
break;
case Definition.STATUS_NAVI_TURN_RIGHT:
// updateStatus(ComponentStatus.STATUS_NAVIGATION_TURN_RIGHT, data, extraData);
break;
case Definition.STATUS_NAVI_SET_PRIORITY_FAILED:
// updateStatus(ComponentStatus.STATUS_NAVIGATION_SET_PRIORITY_FAILED, data, extraData);
break;
default:
// updateStatus(status, data, extraData);
break;
}
}
Parameters:
- definition.DEBUG_REQ_ID: int; command ID, the reqid parameter
- dest: string; the destination of this navigation. It must not be empty and must be a map point on the target floor’s map
- floor: int; the floor mapping of the destination floor. The destination floor’s floor mapping (FloorIndex) cannot be 0 and must be in the map group managed in MapTool’s multi-floor management
- listener: ActionListener; listener for the function. Required callbacks: onResult, onError, onStatusUpdate
Supported platforms:
| GreetingBot | GreetingBot 2 | GreetingBot Mini | LuckiBot | LuckiBot Pro | BigScreenBot | Elevator Control |
| No | No | No | No | No | No | Yes |
Note: Make sure the robot is localized before calling this API
Stop Navigating to a Specified Location
Method name: stopAdvanceNavigation How to call:
RobotApi.getInstance().stopAdvanceNavigation(reqId);
Supported platforms:
| GreetingBot | GreetingBot 2 | GreetingBot Mini | LuckiBot | LuckiBot Pro | BigScreenBot | Elevator Control |
| No | No | No | No | No | No | Yes |
Note: This API can only stop navigation started by startElevatorNavigation
Status and Error Code Definitions
onStatusUpdate
Events reported during navigation. The task does not stop when these are reported.
| Name | code | Definition |
| STATUS_START_NAVIGATION | 1014 | Navigation started |
| STATUS_NAVI_REPLACE_DESTINATION | 1048 | Destination switched and navigation started |
| STATUS_ESTIMATE_LOST | 1045 | Localization lost |
| STATUS_DISTANCE_WITH_DESTINATION | 1050 | Distance to the destination, in m. Example: extraData = “3” |
| STATUS_NAVI_AVOID_IMMEDIATELY | 1051 | Obstacle avoidance |
| STATUS_GOAL_OCCLUDED | 1016 | Obstacle avoidance started |
| STATUS_NAVI_AVOID | 1018 | |
| STATUS_GOAL_OCCLUDED_END | 1017 | Obstacle avoidance ended |
| STATUS_NAVI_AVOID_END | 1019 | |
| STATUS_NAVI_OBSTACLES_AVOID | 1023 | |
| STATUS_NAVI_MULTI_ROBOT_WAITING | 1034 | Started waiting for other robots to pass (multi-robot obstacle avoidance started) |
| STATUS_NAVI_MULTI_ROBOT_WAITING_END | 1035 | Multi-robot obstacle avoidance ended |
| STATUS_NAVI_GO_STRAIGHT | 1036 | Robot is moving in a straight line |
| STATUS_NAVI_TURN_LEFT | 1037 | Robot is turning left |
| STATUS_NAVI_TURN_RIGHT | 1038 | Robot is turning right |
onResult
Status reported when navigation ends
| Name | code | Definition |
| RESULT_NAVIGATION_ARRIVED | 102 | Arrived at the destination |
| RESULT_OK | 1 | |
| RESULT_FAILURE | 2 | Navigation failed |
| RESULT_DESTINATION_AVAILABLE | 103 | Destination is reachable and not occupied |
| RESULT_DESTINATION_IN_RANGE | 104 | Arrived within range of the destination |
| ACTION_RESPONSE_STOP_SUCCESS | 3 | Action stopped successfully |
| STATUS_NAVI_OUT_MAP | 1020 | Out of map range |
| STATUS_NAVI_GLOBAL_PATH_FAILED | 1025 | Navigation path planning failed |
| STATUS_NAVI_MULTI_MAP_NOT_MATCH | 1040 | Multi-robot maps do not match |
| STATUS_NAVI_MULTI_LORA_DISCONNECT | 1041 | Multi-robot LoRa disconnected |
| STATUS_NAVI_MULTI_LORA_CONFIG_FAIL | 1042 | Multi-robot configuration problem |
| STATUS_NAVI_MULTI_VERSION_NOT_MATCH | 1043 | Vision does not match |
| STATUS_NAVI_WHEEL_SLIP | 1044 | Wheel slipped during navigation |
onError
Status reported when navigation ends abnormally
| Name | code | Definition |
| ERROR_PARAMETER | -102 | Parameter error |
| ERROR_TARGET_NOT_FOUND | -107 | Map point not found |
| ERROR_DESTINATION_NOT_EXIST | -108 | Destination does not exist |
| ERROR_ESTIMATE_ERROR | -128 | Relocalization failed |
| ERROR_MULTIPLE_MODE_ERROR | -127 | Multi-robot information error |
| ERROR_PARAMS_JSON_PARSER_ERROR | -32750026 | JSON parsing error |
| ERROR_NO_AVAILABLE_DESTINATION | -129 | No available destination found |
| ERROR_NOT_ESTIMATE | -116 | Not localized |
| ERROR_IN_DESTINATION | -113 | Already at the destination |
| ERROR_DESTINATION_CAN_NOT_ARRAIVE | -109 | Destination unreachable |
| ERROR_MULTI_ROBOT_WAITING_TIMEOUT | -125 | Multi-robot obstacle avoidance wait timed out |
| ERROR_NAVIGATION_AVOID_TIMEOUT | -136 | Robot obstacle avoidance timed out |
| ACTION_RESPONSE_ALREADY_RUN | -1 | Request busy |
| ACTION_RESPONSE_REQUEST_RES_ERROR | -6 | Request failed |
| ACTION_RESPONSE_RES_UNAVAILBALE | -9 | Request unavailable |
| ERROR_WHEEL_OVER_CURRENT_RUN_OUT | -124 |