Status Data

Check if Robot Can Move

Based on the given robot state, determine if the robot can move.

  • Function name: Method can_move under [Robot]
  • Parameters:
    1. robot_state: [RobotState] Robot state
  • Return: [bool] Whether can move. Returns true in IDLE, PAUSED, MOVING states, false in other states

Example Program

state = lebai:get_robot_state()
if lebai:can_move(state) then
  print("Can move")
end

Get Robot State

Get the robot's current state.

WARNING

When the arm is in idle state, if a scene is called and the scene executes non-motion commands, the arm state remains idle. The arm state and scene execution are relatively independent.

Example Program

state = lebai:get_robot_state()
print(state)
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "get_robot_state", "params": [{}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {"state": "IDLE"}, "id": 1 }

Get Emergency Stop Reason

Get the robot's current emergency stop reason.

  • Function name: Method get_estop_reason under [Robot]
  • Parameters: None
  • Return: [EstopReason] Emergency stop reason

Example Program

reason = lebai:get_estop_reason()
print(reason)
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "get_estop_reason", "params": [{}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {"state": "NONE"}, "id": 1 }

Get Arm Motion Data

Read motion data (joint/Cartesian position, velocity, acceleration, torque).

  • Function name: Method get_kin_data under [Robot]
  • Parameters: None
  • Return: [KinData] Motion data, containing the following fields

Example Program

data = lebai:get_kin_data()
print(data.actual_joint_pose)
print(data.actual_tcp_pose)
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "get_kin_data", "params": [{}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {"actual_joint_pose": [], "actual_tcp_pose": {}}, "id": 1 }

Get Arm Physical Data

Read physical data (temperature, voltage).

  • Function name: Method get_phy_data under [Robot]
  • Parameters: None
  • Return: [PhyData] Physical data, containing the following fields

Example Program

data = lebai:get_phy_data()
print(data)
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "get_phy_data", "params": [{}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {"joint_voltage": [48.0], "flange_voltage": 24.0}, "id": 1 }