Robot Configuration
Load TCP from Resource Library
tcp = lebai:load_tcp(name, dir)
Parameters
nameNamedirWorkspace name. Optional, default root directory
Returns
tcpOffset 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 flange coordinate system. Only meaningful in kinematics.
- Parameters
tcpOffset relative to flangex. 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
tcpCurrent 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
factorSpeed 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
nameNamedirWorkspace name. Optional, default root directory
Returns
payloadEnd loadmassCurrent robot load masscogCurrent 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 unchangedcog. Center of gravity, offset relative to flange. Optional, default unchangedxX direction offset of center of gravity (m)yY direction offset of center of gravity (m)zZ 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
payloadEnd loadmassCurrent robot load masscogCurrent 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
gravityOffset relative to robot basexX direction component (m/s2)yY direction component (m/s2)zZ 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
gravityOffset 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 }
