Action API

class mini.apis.api_action.PlayAction(is_serial: bool = True, action_name: Optional[str] = None)[source]

Bases: mini.apis.base_api.BaseApi

Execute built-in action API

The robot performs a built-in action with a specified name The action name can be obtained with GetActionList APi

Parameters
  • is_serial (bool) – Whether to wait for a reply, the default is True

  • action_name (str) – Action name, cannot be none or empty string

#PlayActionResponse.isSuccess : True or False

#PlayActionResponse.resultCode : Result Code

async execute()[source]

Send instructions to execute actions

Returns

PlayActionResponse

class mini.apis.api_action.StopAllAction(is_serial: bool = True)[source]

Bases: mini.apis.base_api.BaseApi

Stop all action API

Stop all actions being performed, stop the specified custom action.

if the action is an uninterruptible action, StopCustomActionResponse.resultCode = 403

Args

is_serial (bool): Whether to wait for a reply, the default is True

async execute()[source]

Send command to stop all actions

Returns

StopActionResponse

class mini.apis.api_action.MoveRobotDirection(value)[source]

Bases: enum.Enum

Robot moving direction

FORWARD : move forward

BACKWARD : move backward

LEFTWARD : move leftward

RIGHTWARD : move rightward

FORWARD = 3
BACKWARD = 4
LEFTWARD = 1
RIGHTWARD = 2
class mini.apis.api_action.MoveRobot(is_serial: bool = True, direction: mini.apis.api_action.MoveRobotDirection = MoveRobotDirection.FORWARD, step: int = 1)[source]

Bases: mini.apis.base_api.BaseApi

Control robot moving-API

Control the robot to move n steps in a certain direction (MoveRobotDirection)

Parameters
  • is_serial (bool) – Whether to wait for a reply, the default is True

  • direction (MoveRobotDirection) – Robot movement direction, default FORWARD, move forward

  • step (int) – Number of steps, default 1 step

#MoveRobotResponse.isSuccess : True or False

#MoveRobotResponse.code : Result Code

async execute()[source]

Send robot movement instructions

Returns

MoveRobotResponse

class mini.apis.api_action.RobotActionType(value)[source]

Bases: enum.Enum

Robot action resource type

INNER (built-in): the unmodifiable motion file built into the robot

CUSTOM (custom): Action files that can be modified by the developer placed in the sdcard/customize/actions directory

INNER = 0
CUSTOM = 1
class mini.apis.api_action.GetActionList(is_serial: bool = True, action_type: mini.apis.api_action.RobotActionType = RobotActionType.INNER)[source]

Bases: mini.apis.base_api.BaseApi

Get robot action resource list API

Get a list of action files stored in the robot’s local (built-in/custom)

Parameters
  • is_serial (bool) – Whether to wait for a reply, the default is True

  • action_type (RobotActionType) – Action type, default is INNER, built-in action

#GetActionListResponse.actionList ([str]): Action list, str array

#GetActionListResponse.isSuccess: Is it successful, True Or False

#GetActionListResponse.resultCode: Result Code

async execute()[source]

Send command to get list of robot actions

Returns

GetActionListResponse

class mini.apis.api_action.PlayCustomAction(is_serial: bool = True, action_name: Optional[str] = None)[source]

Bases: mini.apis.base_api.BaseApi

xecute custom action api

Let the robot perform a custom action with a specified name.

Action name can be obtained with GetActionList.

Parameters
  • is_serial (bool) – Whether to wait for a reply, the default is True

  • action_name (str) – custom action name, cannot be empty or None

#PlayCustomActionResponse.isSuccess: Is it successful

#PlayCustomActionResponse.resultCode: Return code

async execute()[source]

execute custom action instructions

Returns

PlayCustomActionResponse

class mini.apis.api_action.StopCustomAction(is_serial: bool = True, action_name: Optional[str] = None)[source]

Bases: mini.apis.base_api.BaseApi

Stop custom action API

Stop the specified custom action, if the action is an uninterruptible action, StopCustomActionResponse.resultCode = 403

Parameters
  • is_serial (bool) – Whether to wait for a reply, the default is True

  • action_name (str) – custom action name, cannot be empty or None

#StopCustomActionResponse.isSuccess: Is it successful

#StopCustomActionResponse.resultCode: Return code

async execute()[source]

Execute stop custom action command

Returns

StopCustomActionResponse