rti_claim¶
Runs at once RTI or SOFT_RTI mode Enabled Homed Takes control
Claim real-time control: the robot starts applying your commands. From now on the robot applies the commands your PC streams, and its watchdog runs at once: the first command must arrive within the command timeout (40 ms in RTI mode, three of your intervals in SOFT_RTI), and so must every next one. Otherwise the arm brakes to rest within its limits, then the robot latches RTI_LINK_LOST, which disables it. The first command is checked against the arm (rti_set_start_pose_check()): one too far from it ends the stream the same way, with RTI_START_POSE. A stream the arm cannot follow ends the same way, with RTI_POSITION_LIMIT, RTI_VELOCITY_LIMIT, RTI_ACCELERATION_LIMIT, RTI_JERK_LIMIT or RTI_NO_SEND_TIME (see RTIClient).
The robot answers at once and never reports whether the claim took. It ignores a claim while an error is latched, while the session is not paired and idle (already claimed, or still stopping after a release), or when the rate limiter is on and its planner is missing. The state packet's rti_state shows it: 2 means control is active. While a claim is active, control of the robot (take_control()) does not expire.
Syntax¶
Arguments¶
None.
Returns¶
Nothing.
Examples¶
import time
from robotclient import RTIClient
rti = RTIClient(robot)
rti.connect(rate_hz=50)
robot.wait_mode("SOFT_RTI")
q = rti.read_once()["j_p"]
robot.rti_claim()
for i in range(50):
rti.send_joint_position(q)
time.sleep(0.02)
robot.rti_release()
robot.rti_disconnect(wait=True)
rti.close()
Further details¶
Warning
From the claim on, the arm follows your PC's commands. Keep the space around the arm clear and a hand near the E-stop.
Usage restrictions 4 codes
This command runs at once; it is not queued. The robot accepts it only when it is in RTI or SOFT_RTI mode, enabled and homed, 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
- [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
- [6026] Refused by RTI — no claim: an error is latched, the robot is not in an RTI mode, the PC is not paired or a claim is active already, or the rate limiter cannot start. The message says which
In Python, a code above raises CommandRejected; its number is the code. The call raises:
CommandRejected: The robot refused it: it is not in a real-time mode (for example right afterrti_connect()withoutwait), not enabled or not homed, 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.
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.