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: Containspose,joint_angles,joint_control_angles,joint_velocities,joint_control_velocities,joint_control_acceleration,joint_torques, andjoint_temperatures
State data model
| Field | Description |
|---|---|
pose | TCP pose (Pose) |
joint_angles | Actual angles of the 7 joints (list[AngleState]) |
joint_control_angles | Control angles of the 7 joints (list[AngleState]) |
joint_velocities | Actual velocities of the 7 joints (list[VelocityState]) |
joint_control_velocities | Control velocities of the 7 joints (list[VelocityState]) |
joint_control_acceleration | Control accelerations of the 7 joints (list[AccelerationState]) |
joint_torques | Actual torques of the 7 joints (list[TorqueState]) |
joint_temperatures | Temperatures 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
| Model | Value field | Timestamp 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
| Method | Return value | Unit |
|---|---|---|
get_angles() | Actual angles of 7 joints | rad |
get_control_angles() | Control angles of 7 joints | rad |
get_velocities() | Actual velocities of 7 joints | rad/s |
get_control_velocities() | Control velocities of 7 joints | rad/s |
get_control_acceleration() | Control accelerations of 7 joints | rad/s² |
get_torques() | Actual torques of 7 joints | Nm |
get_temperatures() | Temperatures of 7 joints | °C |
get_pose() | TCP pose | m, rad |
Sensor Data
A7 Lite uses active motor reporting mode, which starts automatically during construction.
| Data type | Unit | Report rate |
|---|---|---|
| Angle | rad | Determined by motor report period |
| Velocity | rad/s | Same as above |
| Torque | Nm | Same as above |
| Temperature | °C | Same as above |