Robot Configuration

Load TCP from Resource Library

Read the saved Tool Center Point (TCP).

  • Function name: Method load_tcp under [Robot]
  • Parameters:
    1. name: [str] Name
    2. dir: [str] Workspace name. Optional, default root directory
  • Return: [CartesianPose] Offset relative to the flange

Example Program

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_tcp under [Robot]
  • Parameters:
    1. 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)
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_tcp under [Robot]
  • Parameters: None
  • Return: [CartesianPose] Current robot TCP, same type as Set TCP input parameter

Example Program

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_factor under [Robot]
  • Parameters:
    1. speed_factor: [int] Velocity factor percentage, range 0~100
  • Return: None

Example Program

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_factor under [Robot]
  • Parameters: None
  • Return: [int] Velocity factor percentage, range 0~100

Example Program

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_sensitivity under [Robot]
  • Parameters:
    1. sensitivity: [int] Sensitivity, range 0~100
  • Return: None

Example Program

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_detector under [Robot]
  • Parameters: None
  • Return: None

Example Program

lebai:disable_collision_detector()

Enable Collision Detection

  • Function name: Method enable_collision_detector under [Robot]
  • Parameters: None
  • Return: None

Example Program

lebai:enable_collision_detector()

Temporarily Disable Joint Limits

  • Function name: Method disable_joint_limits under [Robot]
  • Parameters: None
  • Return: None

Example Program

lebai:disable_joint_limits()

Enable Joint Limits

  • Function name: Method enable_joint_limits under [Robot]
  • Parameters: None
  • Return: None

Example Program

lebai:enable_joint_limits()

Load Payload from Resource Library

Read the saved payload parameters.

  • Function name: Method load_payload under [Robot]
  • Parameters:
    1. name: [str] Name
    2. dir: [str] Workspace name. Optional, default root directory
  • Return: [Payload] End-effector payload

Example Program

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_payload under [Robot]
  • Parameters:
    1. mass: [float] Payload mass (kg). Optional, default no update
    2. 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)
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_payload under [Robot]
  • Parameters: None
  • Return: [Payload] Current robot end-effector payload

Example Program

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_gravity under [Robot]
  • Parameters:
    1. 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)
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_gravity under [Robot]
  • Parameters: None
  • Return: [Position] Gravity direction offset relative to the robot's base

Example Program

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_auto under [Robot]
  • Parameters:
    1. name: [AutoCfg] Auto configuration item name, currently supports the following items:
      1. ARM_POWER Whether to auto power on after startup, default true
      2. ENABLE_JOINT Whether to auto power on and start the arm after startup, default false
      3. INIT_CLAW Whether to auto initialize the gripper after power on, default true
    2. value: [bool] true to enable, false to disable
  • Return: None

Example Program

lebai:set_auto("ARM_POWER", true)
lebai:set_auto("ENABLE_JOINT", false)

Get Auto Configuration

  • Function name: Method get_auto under [Robot]
  • Parameters:
    1. name: [AutoCfg] Auto configuration item name
  • Return: [bool] Whether the corresponding configuration is enabled; returns None when not set

Example Program

enabled = lebai:get_auto("ARM_POWER")
print(enabled)