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
JointPoseis an associative array with specified index keys (radians). - Cartesian pose
CartesianPoseis 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:
| Field | Type | Description |
|---|---|---|
| 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:
| Index | Field | Type | Description |
|---|---|---|---|
| 1 | x | [float] | X coordinate (m) |
| 2 | y | [float] | Y coordinate (m) |
| 3 | z | [float] | Z coordinate (m) |
| 4 | rz | [float] | Rotation around Z axis (rad) |
| 5 | ry | [float] | Rotation around Y axis (rad) |
| 6 | rx | [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]:
| Field | Type | Description |
|---|---|---|
| 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:
| Field | Type | Description |
|---|---|---|
| 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:
| Method | Description |
|---|---|
| set_timeout | Set timeout |
| set_baud_rate | Set baud rate |
| set_parity | Set parity |
| write | Send data |
| read | Receive data |
Modbus
Modbus slave instance, created by modbus.new_tcp, modbus.new_rtu or modbus.new_flange, providing the following methods:
| Method | Description |
|---|---|
| set_slave | Set slave ID |
| disconnect | Disconnect |
| set_timeout | Set timeout |
| set_retry | Set timeout retry count |
| read_coils | Read multiple coils |
| read_discrete_inputs | Read multiple discrete inputs |
| read_input_registers | Read multiple input registers |
| read_holding_registers | Read multiple holding registers |
| write_single_coil | Write single coil |
| write_multiple_coils | Write multiple coils |
| write_single_register | Write single holding register |
| write_multiple_registers | Write multiple holding registers |
