Skip to content Skip to main navigation Skip to footer

Power Control

Get the Current Battery Level

Method:

RobotSettingApi.getInstance().getRobotString(Definition.ROBOT_SETTINGS_BATTERY_INFO);
GreetingBotGreetingBot MiniLuckiBotDeliverBot MaxBigScreenBot
YesYesYesYesNo

Start Auto-Recharge

Method name: startNaviToAutoChargeAction

How to call:

RobotApi.getInstance().startNaviToAutoChargeAction(reqId, timeout, new ActionListener() {
    @Override
    public void onResult(int status, String responseString) throws RemoteException {
        switch (status) {
            case Definition.RESULT_OK:
                //Charging succeeded
                break;
            case Definition.RESULT_FAILURE:
                //Charging failed
                break;
        }
    }
    @Override
    public void onStatusUpdate(int status, String data) throws RemoteException {
        switch (status) {
            case Definition.STATUS_NAVI_GLOBAL_PATH_FAILED:
                //Global path planning failed
                break;
            case Definition.STATUS_NAVI_OUT_MAP:
                //The target point cannot be reached: the destination is outside the map. The map may not match the map point; please set the map point again
                break;
            case Definition.STATUS_NAVI_AVOID:
                //The route to the charging point is blocked by obstacles
                break;
            case Definition.STATUS_NAVI_AVOID_END:
                //The obstacles have been removed
                break;
            default:
                break;
        }
    }
});

Parameters

  • timeout: navigation timeout. If the robot does not reach the charging pile within this time, auto-recharge is considered to have failed

Supported platforms:

GreetingBotGreetingBot MiniLuckiBotDeliverBot MaxBigScreenBot
YesYesNoNoNo

Stop Auto-Recharge

Method name: stopAutoChargeAction

How to call:

RobotApi.getInstance().stopAutoChargeAction(reqId, true);

Supported platforms:

GreetingBotGreetingBot MiniLuckiBotDeliverBot MaxBigScreenBot
YesYesNoNoNo

Stop Charging and Leave the Charging Pile

Method name: leaveChargingPile

How to call:

RobotApi.getInstance().leaveChargingPile(reqId, speed, distance, new CommandListener() {
            @Override
            public void onStatusUpdate(int status, String data, String extraData) {
                Log.d(TAG, "leaveChargingPile onStatusUpdate: " + status + " data:" + data + " extraData:" + extraData);
            }

            @Override
            public void onError(int errorCode, String errorString, String extraData) {
                Log.d(TAG, "leaveChargingPile errorCode: " + errorCode + " errorString:" + errorString + " extraData:" + extraData);
                switch (errorCode) {
                    case Definition.RESULT_FAILURE_MOTION_AVOID_STOP://Obstacle ahead, failed to leave the pile
                        break;
                    case Definition.RESULT_FAILURE_TIMEOUT://Leaving the pile timed out (15s)
                        break;
                    case Definition.STATUS_LEAVE_PILE_OPEN_RADAR_FAILURE://Failed to start the lidar
                        break;
                    default:
                        break;
                }
            }

            @Override
            public void onResult(int result, String message, String extraData) {
                Log.d(TAG, "leaveChargingPile onResult: " + result + " message:" + message);
                switch (result) {
                    case Definition.RESULT_OK://Left the pile successfully
                        //If you want to check the charging status here, note that the charging status takes some time to update
                        break;
                }
            }
        });

Parameters

  • speed: forward speed when leaving the pile. Default: 0.7
  • distance: forward distance when leaving the pile. Default: 0.2, in meters

Supported platforms:

GreetingBotGreetingBot MiniLuckiBotDeliverBot MaxBigScreenBot
YesYesNoNoNo

Note 1: This method cannot be used to stop charging when the robot is charged by cable.

Note 2: Before you can use this method, you must first call RobotApi.getInstance().disableBattery(); to disable system charging.