Custom Types

This document lists the pose types used in Lua API. Unlike SDK Custom Types, Lua API poses use Lua tables.

TIP

  • Joint pose JointPose is an associative array with specified index keys (radians).
  • Cartesian pose CartesianPose is an array with sequential numeric index: position in meters, angles in radians.
  • Can be converted to SDK format via sdk_pose and lua_pose.
  • See Position and Orientation for detailed explanation.

Pose Types

JointPose

Joint pose (radians), represented as associative array with specified index keys:

FieldTypeDescription
j1[float]Joint 1 angle (rad)
j2[float]Joint 2 angle (rad)
j3[float]Joint 3 angle (rad)
j4[float]Joint 4 angle (rad)
j5[float]Joint 5 angle (rad)
j6[float]Joint 6 angle (rad)
{j1=0.024, j2=math.rad(-15), j3=math.pi, j4=math.pi/2, j5=math.rad(30), j6=0}

CartesianPose

Cartesian pose (position in meters, angles in radians), represented as array with sequential numeric index: x, y, z, rz, ry, rx:

IndexFieldTypeDescription
1x[float]X coordinate (m)
2y[float]Y coordinate (m)
3z[float]Z coordinate (m)
4rz[float]Rotation around Z axis (rad)
5ry[float]Rotation around Y axis (rad)
6rx[float]Rotation around X axis (rad)
{0.2, 0, 0, math.pi/2, math.rad(30), 0.024}

Pose

Pose parameter: joint pose or Cartesian pose, i.e. [JointPose] | [CartesianPose]

KinResult

Pose with solving result, adding ok field on top of [JointPose] or [CartesianPose]:

FieldTypeDescription
ok[bool]Whether solving was successful, true: success, false: failure
{j1=0, j2=1.57, j3=-1.57, j4=0, j5=3.14, j6=3.14, ok=true}

Wrench

Force/torque data, represented as associative array with specified index keys:

FieldTypeDescription
force_x[float]Force along X axis (N)
force_y[float]Force along Y axis (N)
force_z[float]Force along Z axis (N)
torque_x[float]Torque around X axis (N·m)
torque_y[float]Torque around Y axis (N·m)
torque_z[float]Torque around Z axis (N·m)
{force_x=0, force_y=0, force_z=0, torque_x=0, torque_y=0, torque_z=0}

Object Types

Serial

Serial instance, created by serial.open, providing the following methods:

MethodDescription
set_timeoutSet timeout
set_baud_rateSet baud rate
set_paritySet parity
writeSend data
readReceive data

Modbus

Modbus slave instance, created by modbus.new_tcp, modbus.new_rtu or modbus.new_flange, providing the following methods:

MethodDescription
set_slaveSet slave ID
disconnectDisconnect
set_timeoutSet timeout
set_retrySet timeout retry count
read_coilsRead multiple coils
read_discrete_inputsRead multiple discrete inputs
read_input_registersRead multiple input registers
read_holding_registersRead multiple holding registers
write_single_coilWrite single coil
write_multiple_coilsWrite multiple coils
write_single_registerWrite single holding register
write_multiple_registersWrite multiple holding registers