Skip to content Skip to main navigation Skip to footer

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:

GreetbotMiniLuckiBaoxiaodi MAXBaodapingElevator BOT
NoNoNoNoNoYES

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:

GreetbotMiniLuckiBaoxiaodi MAXBaodapingElevator BOT
NoNoNoNoNoYES

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.

NAMEcodedescription
STATUS_START_NAVIGATION1014Navigation Start
STATUS_NAVI_REPLACE_DESTINATION1048Switch destinations and start navigation
STATUS_ESTIMATE_LOST1045Location loss
STATUS_DISTANCE_WITH_DESTINATION1050Distance from destination, in meters Example:extraData = “3”
STATUS_NAVI_AVOID_IMMEDIATELY1051Avoiding obstacles
STATUS_GOAL_OCCLUDED1016Obstacle avoidance begins
STATUS_NAVI_AVOID1018
STATUS_GOAL_OCCLUDED_END1017End of obstacle avoidance
STATUS_NAVI_AVOID_END1019
STATUS_NAVI_OBSTACLES_AVOID1023
STATUS_NAVI_MULTI_ROBOT_WAITING1034Start waiting for other robots to pass (multi machine obstacle avoidance begins)
STATUS_NAVI_MULTI_ROBOT_WAITING_END1035End of multi machine obstacle avoidance
STATUS_NAVI_GO_STRAIGHT1036Robot walking on a straight line
STATUS_NAVI_TURN_LEFT1037Robot turning left
STATUS_NAVI_TURN_RIGHT1038Robot turning right

onResult

The status reported at the end of the navigation function

NAMEcodedescription
RESULT_NAVIGATION_ARRIVED102Successfully arrived
RESULT_OK1
RESULT_FAILURE2Navigation failed
RESULT_DESTINATION_AVAILABLE103Destination reachable, unoccupied
RESULT_DESTINATION_IN_RANGE104Within the range of destination
ACTION_RESPONSE_STOP_SUCCESS3action Stopped successfully
STATUS_NAVI_OUT_MAP1020Beyond map range
STATUS_NAVI_GLOBAL_PATH_FAILED1025Navigation path planning failed
STATUS_NAVI_MULTI_MAP_NOT_MATCH1040Multi machine map mismatch
STATUS_NAVI_MULTI_LORA_DISCONNECT1041Multiple Lora disconnected
STATUS_NAVI_MULTI_LORA_CONFIG_FAIL1042Problem with multi machine configuration
STATUS_NAVI_MULTI_VERSION_NOT_MATCH1043Visual mismatch
STATUS_NAVI_WHEEL_SLIP1044Wheel slipping during navigation

onError

The status reported when navigation ends abnormally

NAMEcodedescription
ERROR_PARAMETER-102parameter error
ERROR_TARGET_NOT_FOUND-107No point found
ERROR_DESTINATION_NOT_EXIST-108Destination does not exist
ERROR_ESTIMATE_ERROR-128Relocation failed
ERROR_MULTIPLE_MODE_ERROR-127Multiple machine information error
ERROR_PARAMS_JSON_PARSER_ERROR-32750026json parse error
ERROR_NO_AVAILABLE_DESTINATION-129No available destination found
ERROR_NOT_ESTIMATE-116Not located
ERROR_IN_DESTINATION-113Already at destination
ERROR_DESTINATION_CAN_NOT_ARRAIVE-109Destination Unreachable
ERROR_MULTI_ROBOT_WAITING_TIMEOUT-125Multiple machine obstacle avoidance waiting timeout
ERROR_NAVIGATION_AVOID_TIMEOUT-136Robot obstacle avoidance timeout
ACTION_RESPONSE_ALREADY_RUN-1Request busy
ACTION_RESPONSE_REQUEST_RES_ERROR-6request failure
ACTION_RESPONSE_RES_UNAVAILBALE-9Request not available
ERROR_WHEEL_OVER_CURRENT_RUN_OUT-124

Elevator navigation demo