Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

State Reading

Full State Snapshot

Read the complete arm state in one call, including TCP pose plus angle, velocity, acceleration, torque, and temperature for all joints.

from realhand import A7lite

with A7lite(side="left", interface_name="can0") as arm:
    arm.enable()
    state = arm.get_state()
    print(state.pose)
    print(f"Actual angle of the first joint: {state.joint_angles[0].angle:.4f} rad")

Return value

  • State: Contains pose, joint_angles, joint_control_angles, joint_velocities, joint_control_velocities, joint_control_acceleration, joint_torques, and joint_temperatures

State data model

FieldDescription
poseTCP pose (Pose)
joint_anglesActual angles of the 7 joints (list[AngleState])
joint_control_anglesControl angles of the 7 joints (list[AngleState])
joint_velocitiesActual velocities of the 7 joints (list[VelocityState])
joint_control_velocitiesControl velocities of the 7 joints (list[VelocityState])
joint_control_accelerationControl accelerations of the 7 joints (list[AccelerationState])
joint_torquesActual torques of the 7 joints (list[TorqueState])
joint_temperaturesTemperatures of the 7 joints (list[TemperatureState])

Each sub-state model (AngleState, VelocityState, etc.) includes a value field and a timestamp (Unix time in seconds).

Sub-state model fields

ModelValue fieldTimestamp field
AngleState.angle.timestamp
VelocityState.velocity.timestamp
AccelerationState.acceleration.timestamp
TorqueState.torque.timestamp
TemperatureState.temperature.timestamp

Read Individual State Items

Besides get_state(), the following methods return a single kind of state. All of them return lists for 7 joints, except get_pose().

from realhand import A7lite

with A7lite(side="left", interface_name="can0") as arm:
    arm.enable()
    angles = arm.get_angles()
    velocities = arm.get_velocities()
    temps = arm.get_temperatures()
    pose = arm.get_pose()
    print(f"Actual angle of the second joint: {angles[1]:.4f} rad")
    print(f"Actual velocity of the third joint: {velocities[2]:.4f} rad/s")
    print(f"Actual temperature of the fourth joint: {temps[3]:.1f} °C")
    print(f"TCP: ({pose.x:.3f}m, {pose.y:.3f}m, {pose.z:.3f}m)")

Return values

MethodReturn valueUnit
get_angles()Actual angles of 7 jointsrad
get_control_angles()Control angles of 7 jointsrad
get_velocities()Actual velocities of 7 jointsrad/s
get_control_velocities()Control velocities of 7 jointsrad/s
get_control_acceleration()Control accelerations of 7 jointsrad/s²
get_torques()Actual torques of 7 jointsNm
get_temperatures()Temperatures of 7 joints°C
get_pose()TCP posem, rad

Sensor Data

A7 Lite uses active motor reporting mode, which starts automatically during construction.

Data typeUnitReport rate
AngleradDetermined by motor report period
Velocityrad/sSame as above
TorqueNmSame as above
Temperature°CSame as above