Robot Configuration

Load TCP from Resource Library

tcp = lebai:load_tcp(name, dir)
  • Parameters

    • name Name
    • dir Workspace name. Optional, default root directory
  • Returns

    • tcp Offset relative to flange
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

lebai:set_tcp(tcp)

Set Tool Center Point (TCP) coordinates, coordinate values relative to tool coordinate system. Only meaningful in kinematics.

  • Parameters
    • tcp Offset relative to flange
      • x. X direction offset, unit m.
      • y. Y direction offset, unit m.
      • z. Z direction offset, unit m.
      • rz. Rotation angle around Z axis, unit rad.
      • ry. Rotation angle around Y axis, unit rad.
      • rx. Rotation angle around X axis, unit rad.
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "set_tcp", "params": [{"position": {}, "rotation": {}}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {}, "id": 1 }

Get Current TCP

tcp = lebai:get_tcp()

Get current robot Tool Center Point (TCP) settings. Only has kinematic meaning.

  • Returns
    • tcp Current robot TCP. Type same as input parameter of Set TCP.

Set Velocity Factor

lebai:set_velocity_factor(factor)

Based on the arm motion command speed, set the actual speed as a percentage of the motion command speed, e.g., 100 means 100% of motion command speed, 10 means 10% of motion command speed.

  • Parameters
    • factor. Speed factor percentage, range 0~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

factor = lebai:get_velocity_factor()
  • Returns
    • factor Speed factor percentage, range 0~100
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "get_kin_factor", "params": [{}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {"speed_factor": 100}, "id": 1 }

Load End Load from Resource Library

payload = lebai:load_payload(name, dir)
  • Parameters

    • name Name
    • dir Workspace name. Optional, default root directory
  • Returns

    • payload End load
      • mass Current robot load mass
      • cog Current robot load center of gravity
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 Load

lebai:set_payload(mass, cog)

When the load weight or weight distribution changes, this method must be called to update. For example, when the robot picks up or puts down a relatively heavy object.

WARNING

This setting will affect the drag teaching experience. Please make sure the setting matches the actual robot situation.

  • Parameters
    • mass. Load mass, unit: kg. Optional, default unchanged
    • cog. Center of gravity, offset relative to flange. Optional, default unchanged
      • x X direction offset of center of gravity (m)
      • y Y direction offset of center of gravity (m)
      • z Z direction offset of center of gravity (m)
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "set_payload", "params": [{"mass": 0.2, "cog": {}}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {}, "id": 1 }

Get Load

payload = lebai:get_payload()

Get current robot end load mass and center of gravity.

  • Returns
    • payload End load
      • mass Current robot load mass
      • cog Current robot load center of gravity
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 robot gravity acceleration.

lebai:set_gravity(gravity)

When the robot is fixed, this corresponds to the acceleration direction opposite to the earth's center.

WARNING

This setting will affect the drag teaching experience. Please make sure the setting matches the actual robot situation.

  • Parameters
    • gravity Offset relative to robot base
      • x X direction component (m/s2)
      • y Y direction component (m/s2)
      • z Z direction component (m/s2)
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

gravity = lebai:get_gravity()
  • Returns
    • gravity Offset relative to robot base
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 }