joint_test¶
Runs at once IDLE mode Enabled Takes control
Move one joint a few degrees and back, as a powered test. The joint moves amplitude_deg from where it stands and back on a smooth ramp that peaks at speed_dps, and rests 0.5 s at each end: 5 degrees at 5 deg/s takes about 4 s. The drive works in its own encoder counts, so the test needs no homing, and its current is limited to current_ma meanwhile. The robot stops the test at once when the joint falls more than 2 degrees behind the commanded motion, when the robot is disabled or leaves IDLE mode, and on any mode change, an error or the E-stop. The joint then gets its normal current limit and command back, and stays where it stopped.
The call returns at once. The result is in the status, joint_test: joint, state ("running", "done", "fell_behind" or "stopped"), amplitude_deg, moved_deg (the largest displacement the commanded way), max_error_deg (the largest tracking error), peak_current_ma, end_error_deg (where it ended against its start) and seq, which counts finished tests. The figures are written when the test ends.
Syntax¶
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
joint |
int |
required | The joint to move, a whole number: 1 for J1; 0 stops a running test. |
amplitude_deg |
float |
5.0 |
How far to move, in degrees, up to 15; the sign gives the direction. |
speed_dps |
float |
5.0 |
The peak speed, in degrees per second, up to 10. |
current_ma |
float |
600.0 |
The drive's current limit during the test, in milliamperes, up to the joint's own current limit. PAR6's first-run check uses 400 to 1500 mA, 1.5 times the joint's largest gravity torque. |
Returns¶
Any
None: the robot sends no data back.
Examples¶
seq = robot.latest_status()["joint_test"]["seq"]
robot.joint_test(6, 5, 5, 400)
robot.wait(lambda s: s["joint_test"]["seq"] > seq, 10)
robot.latest_status()["joint_test"]["state"]
Further details¶
Warning
The joint moves by itself, with no check of the safety zones or self-collision. On a homed arm the robot refuses a test that would move the joint past its soft limits; unhomed, the angles are unknown and nothing is checked. Only the 2-degree tracking limit and the current limit stop a running test. The other joints hold still meanwhile. Keep the space clear and a hand on the E-stop.
Usage restrictions 5 codes
This command runs at once; it is not queued. The robot accepts it only when it is in IDLE mode and enabled, from the client that holds control or when no client does.
It answers with one of these codes when it does not carry the command out:
- [6010] Command not allowed now — the message names the mode or state it needs
- [6101] Control held by another client — another client holds control; the message names it
- [6003] Invalid arguments —
jointis not 0 to the number of joints; or, for a test,amplitude_degis 0, above 15 degrees or not finite,speed_dpsis not above 0 and up to 10 deg/s, orcurrent_mais not above 0 and up to the joint's current limit in force (set_pid_gains()may have changed it) - [6025] RTI not running or not answering — rTI did not answer within 1 s: it is not running or not responding. The command may still have taken effect
- [4008] Joint test move refused — the test cannot start: the robot software started less than 1.2 s ago, another test, a freed joint or the Hall sensor check runs, the joint has not reported its position yet, or, on a homed arm, the move would pass the joint's soft limits. The message says why;
seqdoes not change
In Python, a code above raises CommandRejected; its number is the code. The call raises:
CommandRejected: The robot refused it: it is not in IDLE mode or not enabled, a value is out of range, or another client holds control. Or RTI refused it or did not answer within 1 s (Errors:).RobotTimeout: The robot did not answer within 5 s.RobotConnectionError: The client is not connected.ValueError: A value is not a number, orjointis not a whole number. Nothing is sent.TypeError: A value isNone. Nothing is sent.
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.