Robot Configuration
Load TCP from Resource Library
Read the saved Tool Center Point (TCP).
- Function name: Method
load_tcpunder [Robot] - Parameters:
- name: [str] Name
- dir: [str] Workspace name. Optional, default root directory
- Return: [CartesianPose] Offset relative to the flange
Example Program
tcp = lebai:load_tcp("tcp1")
tcp = lebai.load_tcp("tcp1")
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "load_tcp", "params": [{"name": "", "dir": ""}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {"position": {}, "rotation": {}}, "id": 1 }
Set TCP
Set the Tool Center Point (TCP) coordinates, with values relative to the flange coordinate system. Only meaningful kinematically.
- Function name: Method
set_tcpunder [Robot] - Parameters:
- pose: [CartesianPose] Offset relative to the flange
- Return: None
Example Program
tcp = {x = 0, y = 0, z = 0.175, rz = 0, ry = 0, rx = 0}
lebai:set_tcp(tcp)
tcp = {'x': 0, 'y': 0, 'z': 0.175, 'rz': 0, 'ry': 0, 'rx': 0}
lebai.set_tcp(tcp)
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "set_tcp", "params": [{"position": {}, "rotation": {}}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {}, "id": 1 }
Get Current TCP
Get the current robot Tool Center Point (TCP) setting. Only has kinematic significance.
- Function name: Method
get_tcpunder [Robot] - Parameters: None
- Return: [CartesianPose] Current robot TCP, same type as Set TCP input parameter
Example Program
tcp = lebai:get_tcp()
print(tcp)
tcp = lebai.get_tcp()
print(tcp)
Set Velocity Factor
Based on the arm motion command velocity, set the actual velocity as the corresponding percentage of the motion command velocity. For example, 100 means 100% of the motion command velocity, 10 means 10% of the motion command velocity.
- Function name: Method
set_velocity_factorunder [Robot] - Parameters:
- speed_factor: [int] Velocity factor percentage, range 0~100
- Return: None
Example Program
lebai:set_velocity_factor(100)
lebai.set_velocity_factor(100)
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "set_kin_factor", "params": [{"speed_factor": 100}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {}, "id": 1 }
Get Velocity Factor
- Function name: Method
get_velocity_factorunder [Robot] - Parameters: None
- Return: [int] Velocity factor percentage, range 0~100
Example Program
factor = lebai:get_velocity_factor()
print(factor)
factor = lebai.get_velocity_factor()
print(factor)
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "get_kin_factor", "params": [{}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {"speed_factor": 100}, "id": 1 }
Set Collision Detection Sensitivity
Set collision detection sensitivity. Higher values are more sensitive.
- Function name: Method
set_collision_detector_sensitivityunder [Robot] - Parameters:
- sensitivity: [int] Sensitivity, range 0~100
- Return: None
Example Program
lebai:set_collision_detector_sensitivity(50)
lebai.set_collision_detector_sensitivity(50)
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "set_collision_detector", "params": [{"action": "STOP", "pause_time": 0, "sensitivity": 50}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {}, "id": 1 }
Temporarily Disable Collision Detection
- Function name: Method
disable_collision_detectorunder [Robot] - Parameters: None
- Return: None
Example Program
lebai:disable_collision_detector()
lebai.disable_collision_detector()
Enable Collision Detection
- Function name: Method
enable_collision_detectorunder [Robot] - Parameters: None
- Return: None
Example Program
lebai:enable_collision_detector()
lebai.enable_collision_detector()
Temporarily Disable Joint Limits
- Function name: Method
disable_joint_limitsunder [Robot] - Parameters: None
- Return: None
Example Program
lebai:disable_joint_limits()
lebai.disable_joint_limits()
Enable Joint Limits
- Function name: Method
enable_joint_limitsunder [Robot] - Parameters: None
- Return: None
Example Program
lebai:enable_joint_limits()
lebai.enable_joint_limits()
Load Payload from Resource Library
Read the saved payload parameters.
- Function name: Method
load_payloadunder [Robot] - Parameters:
- name: [str] Name
- dir: [str] Workspace name. Optional, default root directory
- Return: [Payload] End-effector payload
Example Program
payload = lebai:load_payload("payload1")
payload = lebai.load_payload("payload1")
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "load_payload", "params": [{"name": "", "dir": ""}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {"mass": 0.2, "cog": {}}, "id": 1 }
Set Robot End-Effector Payload
Set the current payload parameters (only set specified items). Must be called to update when the payload weight or weight distribution changes. For example, when the robot picks up or puts down a heavy object.
WARNING
This setting will affect the drag teaching experience. Please ensure the settings match the robot's actual situation.
- Function name: Method
set_payloadunder [Robot] - Parameters:
- mass: [float] Payload mass (kg). Optional, default no update
- cog: [Position] Payload center of gravity offset position (m), relative to the flange offset. Optional, default no update
- Return: None
Example Program
mass = 0.5
cog = {x = 0, y = 0, z = 0.176}
lebai:set_payload(mass, cog)
mass = 0.5
cog = {'x': 0, 'y': 0, 'z': 0.176}
lebai.set_payload(mass, cog)
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "set_payload", "params": [{"mass": 0.2, "cog": {}}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {}, "id": 1 }
Get Payload
Get the current robot end-effector payload mass and center of gravity.
- Function name: Method
get_payloadunder [Robot] - Parameters: None
- Return: [Payload] Current robot end-effector payload
Example Program
payload = lebai:get_payload()
print(payload)
payload = lebai.get_payload()
print(payload)
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "get_payload", "params": [{}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {"mass": 0.2, "cog": {}}, "id": 1 }
Set Gravity Direction
Set the direction of the robot's gravitational acceleration. After the robot is fixed, this corresponds to the acceleration direction opposite to the center of the Earth.
WARNING
This setting will affect the drag teaching experience. Please ensure the settings match the robot's actual situation.
- Function name: Method
set_gravityunder [Robot] - Parameters:
- pose: [Position] Gravity direction offset relative to the robot's base
- Return: None
Note: Upright direction: {"x": 0, "y": 0, "z": -9.8}; Side mounting direction: {"x": 0, "y": -9.8, "z": 0}; Inverted direction: {"x": 0, "y": 0, "z": 9.8}
Example Program
gravity = {x = 0, y = 0, z = -9.8}
lebai:set_gravity(gravity)
gravity = {'x': 0, 'y': 0, 'z': -9.8}
lebai.set_gravity(gravity)
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "set_gravity", "params": [{"x": 0, "y": 0, "z": -9.8}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {}, "id": 1 }
Get Gravity Direction
- Function name: Method
get_gravityunder [Robot] - Parameters: None
- Return: [Position] Gravity direction offset relative to the robot's base
Example Program
gravity = lebai:get_gravity()
print(gravity)
gravity = lebai.get_gravity()
print(gravity)
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "get_gravity", "params": [{}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {"x": 0, "y": 0, "z": -9.8}, "id": 1 }
Set Auto Configuration
WARNING
Takes effect after restart; Takes effect long-term after setting once;
- Function name: Method
set_autounder [Robot] - Parameters:
- name: [AutoCfg] Auto configuration item name, currently supports the following items:
ARM_POWERWhether to auto power on after startup, defaulttrueENABLE_JOINTWhether to auto power on and start the arm after startup, defaultfalseINIT_CLAWWhether to auto initialize the gripper after power on, defaulttrue
- value: [bool] true to enable, false to disable
- name: [AutoCfg] Auto configuration item name, currently supports the following items:
- Return: None
Example Program
lebai:set_auto("ARM_POWER", true)
lebai:set_auto("ENABLE_JOINT", false)
lebai.set_auto("ARM_POWER", True)
lebai.set_auto("ENABLE_JOINT", False)
Get Auto Configuration
- Function name: Method
get_autounder [Robot] - Parameters:
- name: [AutoCfg] Auto configuration item name
- Return: [bool] Whether the corresponding configuration is enabled; returns
Nonewhen not set
Example Program
enabled = lebai:get_auto("ARM_POWER")
print(enabled)
enabled = lebai.get_auto("ARM_POWER")
print(enabled)
