Status Data
Check if Robot Can Move
Based on the given robot state, determine if the robot can move.
- Function name: Method
can_moveunder [Robot] - Parameters:
- robot_state: [RobotState] Robot state
- Return: [bool] Whether can move. Returns
trueinIDLE,PAUSED,MOVINGstates,falsein other states
Example Program
state = lebai:get_robot_state()
if lebai:can_move(state) then
print("Can move")
end
state = lebai.get_robot_state()
if lebai.can_move(state):
print("Can move")
Get Robot State
Get the robot's current state.
- Function name: Method
get_robot_stateunder [Robot] - Parameters: None
- Return: [RobotState] Current robot 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)
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_reasonunder [Robot] - Parameters: None
- Return: [EstopReason] Emergency stop reason
Example Program
reason = lebai:get_estop_reason()
print(reason)
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_dataunder [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)
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_dataunder [Robot] - Parameters: None
- Return: [PhyData] Physical data, containing the following fields
Example Program
data = lebai:get_phy_data()
print(data)
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 }
