get_joints¶
Runs at once Any mode Open to every client
Return the measured joint angles, in degrees. The robot reads every joint's encoder each control tick (4 ms on PAR6); this asks it for the latest reading. The angles are measured against the reference that homing sets, so read them on a homed arm. An angle is not wrapped into one turn: a joint whose range passes 180 degrees reports more, for example up to 376 degrees on PAR6's J3.
Syntax¶
Arguments¶
None.
Returns¶
list[float]
One angle per joint, in degrees, J1 first.
Examples¶
Usage restrictions 1 code
This command runs at once; it is not queued. The robot accepts it in any mode and state, from every client.
It answers with one of these codes when it does not carry the command out:
- [6025] RTI not running or not answering — the control loop (RTI) has not run for over 0.5 s, or the robot is in flashing mode, where it reads no drive: the angles in its memory would be old
In Python, a code above raises CommandRejected; its number is the code. The call raises:
CommandRejected: The robot refused it: its control loop is not running, or it is in flashing mode.RobotTimeout: The robot did not answer within 5 s.RobotConnectionError: The client is not connected.
If the connection drops while the call waits for the robot's answer, it raises CommandRejected with the code CONNECTION_LOST (DISCONNECTED after disconnect()); while it waits for the robot's status, RobotConnectionError.
Like every immediate command, it also answers BAD_ARGS when a raw client sends a value the robot cannot read at all, and INTERNAL when it fails inside the robot.
Protocol¶
A client that does not use robotclient sends this over the TCP command protocol (port 29000) for the example above: