Elevator navigation
introduce
Elevator navigation refers to the walking ability of a robot, which can move from point A to point B. During the walking process, the robot can automatically plan its route and switch maps between different floors, effectively avoiding obstacles.
There are many sensors used for robot navigation, including bottom LiDAR, RGBD, and head IR sensors (some models). Therefore, please do not block these sensors during navigation to avoid problems such as robot not walking and path planning failure.
The prerequisite for a robot to perform navigation actions is that it has created a new map and successfully located on that map; Robots must establish patrol lines; The robot must be above the point of line inspection; The robot’s map cannot use copied maps, which can cause point ID and floor conflicts and cannot be reached; The radar is in an on state; Only ladder controlled robots are supported; Please be sure to pay attention to this!
Obtain multiple map point data information
Method name: getMultiFloorConfigAndPose Result callback:
//Obtain a list of multiple map points: 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 the 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 type; Command ID, define parameter reqid
- dest:String type; The destination of this navigation; The destination is not empty and is the point on the target floor map
- floor:Int type; Destination floor mapping; The floor mapping (FloorIndex) of the destination floor cannot be 0 and must be in the map group managed by MapTool in multiple layers
- listener:ActionListenerType; Function monitoring; Callback required:onResult、onError、onStatusUpdate
platforms:
Greetbot | Mini | Lucki | Baoxiaodi MAX | Baodaping | Elevator BOT |
---|---|---|---|---|---|
No | No | No | No | No | YES |
Note: Before calling this interface, it is necessary to ensure that it has been located
Stop navigating to the specified location
Method name: stopAdvanceNavigation Call method:
RobotApi.getInstance().stopAdvanceNavigation(reqId);
platforms:
Greetbot | Mini | Lucki | Baoxiaodi MAX | Baodaping | Elevator BOT |
---|---|---|---|---|---|
No | No | No | No | No | YES |
Note: This interface can only be used to stop navigation initiated by startElevatorNavigation
Definition of status and error codes
onStatusUpdate
Events reported during the navigation process will not stop the task when reported.
NAME | code | description |
STATUS_START_NAVIGATION | 1014 | Navigation Start |
STATUS_NAVI_REPLACE_DESTINATION | 1048 | Switch destinations and start navigation |
STATUS_ESTIMATE_LOST | 1045 | Location loss |
STATUS_DISTANCE_WITH_DESTINATION | 1050 | Distance from destination, in meters Example:extraData = “3” |
STATUS_NAVI_AVOID_IMMEDIATELY | 1051 | Avoiding obstacles |
STATUS_GOAL_OCCLUDED | 1016 | Obstacle avoidance begins |
STATUS_NAVI_AVOID | 1018 | |
STATUS_GOAL_OCCLUDED_END | 1017 | End of obstacle avoidance |
STATUS_NAVI_AVOID_END | 1019 | |
STATUS_NAVI_OBSTACLES_AVOID | 1023 | |
STATUS_NAVI_MULTI_ROBOT_WAITING | 1034 | Start waiting for other robots to pass (multi machine obstacle avoidance begins) |
STATUS_NAVI_MULTI_ROBOT_WAITING_END | 1035 | End of multi machine obstacle avoidance |
STATUS_NAVI_GO_STRAIGHT | 1036 | Robot walking on a straight line |
STATUS_NAVI_TURN_LEFT | 1037 | Robot turning left |
STATUS_NAVI_TURN_RIGHT | 1038 | Robot turning right |
onResult
The status reported at the end of the navigation function
NAME | code | description |
RESULT_NAVIGATION_ARRIVED | 102 | Successfully arrived |
RESULT_OK | 1 | |
RESULT_FAILURE | 2 | Navigation failed |
RESULT_DESTINATION_AVAILABLE | 103 | Destination reachable, unoccupied |
RESULT_DESTINATION_IN_RANGE | 104 | Within the range of destination |
ACTION_RESPONSE_STOP_SUCCESS | 3 | action Stopped successfully |
STATUS_NAVI_OUT_MAP | 1020 | Beyond map range |
STATUS_NAVI_GLOBAL_PATH_FAILED | 1025 | Navigation path planning failed |
STATUS_NAVI_MULTI_MAP_NOT_MATCH | 1040 | Multi machine map mismatch |
STATUS_NAVI_MULTI_LORA_DISCONNECT | 1041 | Multiple Lora disconnected |
STATUS_NAVI_MULTI_LORA_CONFIG_FAIL | 1042 | Problem with multi machine configuration |
STATUS_NAVI_MULTI_VERSION_NOT_MATCH | 1043 | Visual mismatch |
STATUS_NAVI_WHEEL_SLIP | 1044 | Wheel slipping during navigation |
onError
The status reported when navigation ends abnormally
NAME | code | description |
ERROR_PARAMETER | -102 | parameter error |
ERROR_TARGET_NOT_FOUND | -107 | No point found |
ERROR_DESTINATION_NOT_EXIST | -108 | Destination does not exist |
ERROR_ESTIMATE_ERROR | -128 | Relocation failed |
ERROR_MULTIPLE_MODE_ERROR | -127 | Multiple machine information error |
ERROR_PARAMS_JSON_PARSER_ERROR | -32750026 | json parse error |
ERROR_NO_AVAILABLE_DESTINATION | -129 | No available destination found |
ERROR_NOT_ESTIMATE | -116 | Not located |
ERROR_IN_DESTINATION | -113 | Already at destination |
ERROR_DESTINATION_CAN_NOT_ARRAIVE | -109 | Destination Unreachable |
ERROR_MULTI_ROBOT_WAITING_TIMEOUT | -125 | Multiple machine obstacle avoidance waiting timeout |
ERROR_NAVIGATION_AVOID_TIMEOUT | -136 | Robot obstacle avoidance timeout |
ACTION_RESPONSE_ALREADY_RUN | -1 | Request busy |
ACTION_RESPONSE_REQUEST_RES_ERROR | -6 | request failure |
ACTION_RESPONSE_RES_UNAVAILBALE | -9 | Request not available |
ERROR_WHEEL_OVER_CURRENT_RUN_OUT | -124 |