Robot Configuration
auto_sync
Set Tool Center PointSet the Tool Center Point (TCP) coordinates, relative to the tool coordinate system. This is only meaningful in kinematics.
set_tcp({x, y, z, α, β, γ})
- The parameter is a six-tuple representing a spatial position transformation, in the following order (note that Lua array indices start at 1):
x
: X-direction offset, unit: m.y
: Y-direction offset, unit: m.z
: Z-direction offset, unit: m.α
: Rotation angle around Z-axis, unit: rad.β
: Rotation angle around Y-axis, unit: rad.γ
: Rotation angle around X-axis, unit: rad.
Example Program
set_tcp({0, 0.04, 0, math.pi/2, 0, 0})
Get Current Tool Center Point
get_tcp()
- Returns
- Current robot TCP. The type is the same as the input parameter of Set Tool Center Point.
auto_sync
Set Velocity Factorset_velocity_factor(factor)
Set the actual speed as a percentage of the speed in the arm movement command. For example, 100 means 100% of the command speed, 10 means 10% of the command speed.
- Parameters
factor
: Velocity factor percentage, range 0~100
Example Program
set_velocity_factor(50)
Get Velocity Factor
get_velocity_factor()
- Returns
- Velocity factor percentage, range 0~100
auto_sync
Temporarily Disable Collision Detectiondisable_collision_detector()
auto_sync
Enable Collision Detectionenable_collision_detector()
auto_sync
Temporarily Disable Joint Limitsdisable_joint_limits()
auto_sync
Enable Joint Limitsenable_joint_limits()
auto_sync
Set End Loadset_payload(mass, cog)
Set both the end load mass and center of gravity simultaneously. Alternatively, you can use separate methods Set Load Mass and Set Load Center of Gravity to set them.
This method must be called to update when the load weight or weight distribution changes. For example, when the robot picks up or puts down a relatively heavy object.
- Parameters
mass
: Load mass, unit: kg.cog
: Center of gravity, relative to the tool coordinate system.x
X-direction offset of the center of gravity (m)y
Y-direction offset of the center of gravity (m)z
Z-direction offset of the center of gravity (m)
Example Program
- mass: 2kg
- cog: Load center point coordinates: x: 0, y: 0, z: 0.5m (in the tool coordinate system)
set_payload(2.0, {x=0, y=0, z=0.5})
auto_sync
Set Load Massset_payload_mass(mass)
- Parameters
mass
: Load mass, unit: kg.
Example Program
set_payload_mass(2.0)
auto_sync
Set Load Center of Gravityset_payload_cog({x, y, z})
This method must be called to update when the load weight distribution changes. For example, when the robot picks up or puts down a relatively heavy object.
- Parameters
x
X-direction offset of the center of gravity (m)y
Y-direction offset of the center of gravity (m)z
Z-direction offset of the center of gravity (m)
Example Program
- cog: Load center point coordinates: x: 0, y: 0, z: 0.5m (in the tool coordinate system)
set_payload_cog({0, 0, 0.5})
Or written as:
set_payload_cog({x=0, y=0, z=0.5})
Get End Load
get_payload()
Get the current mass and center of gravity of the robot's end load.
- Returns the current robot load.
mass
: Current robot load mass.cog
: Current robot load center of gravity table.
Example Program
print(get_payload())
Output:
{cog={y=0,x=0,z=0},mass=0}
auto_sync
Set Gravity Acceleration Directionset_gravity({x, y, z})
When 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 make sure the setting is consistent with the actual installation of the robot.
- Parameters are the gravity direction described relative to the robot's base coordinate system
x
X-direction component (m/s2)y
Y-direction component (m/s2)z
Z-direction component (m/s2)
Example Program
- Indicates an acceleration of 9.82 m/s2 (1 g) in the negative Z-axis direction (default)
set_gravity({x=0, y=0, z=-9.82})
Get Gravity Acceleration Direction
get_gravity()
- Returns the gravity direction described relative to the robot's base coordinate system
x
X-direction component (m/s2)y
Y-direction component (m/s2)z
Z-direction component (m/s2)
Example Program
print(get_gravity())
Output:
{y=0,x=0,z=-9.82}
3.1.16
Set Auto Configuration Itemset_auto(name, val)
WARNING
It effect after restart; Once set, it will effect for a long time;
- Parameters
name
: Auto configuration item name, currently supports the following configuration itemsARM_POWER
Whether to automatically power on after startup, defaulttrue
ENABLE_JOINT
Whether to automatically power on and start the arm after startup, defaultfalse
INIT_CLAW
Whether to automatically initialize the gripper after power on, defaulttrue
val
: true to enable, false to disable
Example Program
set_auto("INIT_CLAW", false)
3.1.16
Get Auto Configuration Itemget_auto(name)