rti_set_servo_generator¶
Runs at once Any mode Takes control
Choose how the robot fills in the ticks between position targets. The generator turns your position targets into one setpoint per tick, within the joints' real-time limits and soft limits. It acts on position streams while the rate limiter is on. A change takes effect at once: the new generator continues from the position and speed the old one reached. rti_connect() sets the generator again, so call this after it. A gain or a look-ahead that is not finite is refused, and nothing changes.
Syntax¶
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
name |
str |
required | "passthrough": RTI mode only; replays your stamped targets exactly, one tick behind, by their send times, and checks every sample against the limits. "ruckig_advancing": plans toward where your target is moving and passes through it at its speed; the closest tracking of a sparse stream. "ruckig": plans a jerk-limited move to each target and stops on it; exact and never overshoots, but on a sparse stream it sprints and waits. "tracker": a servo law that never plans to stop; smooth on any stream, but a large step can overshoot. Any case. The robot ignores another name, and "passthrough" in SOFT_RTI. |
gain |
float | None |
None |
The tracker's bandwidth in rad/s, from 1 to 150 (clamped); above about 20 a large step overshoots. None keeps the current value. Only the tracker uses it. |
lookahead |
float | None |
None |
How far ahead the tracker extrapolates your target, in seconds, from 0 to 0.5 (clamped). None keeps the current value, or, with gain given, sets 2 / gain, which cancels the lag on a target moving at a steady speed. |
self_lookahead |
float | None |
None |
The tracker's damping look-ahead, in seconds, from 0 to 0.5 (clamped): its aim moves back by its own speed times this. None keeps the current value. |
Default values¶
The generator is set at every rti_connect(): "passthrough" in RTI
mode, "ruckig_advancing" in SOFT_RTI. The tracker's gain 15 rad/s,
lookahead 2 / 15 s (about 0.133 s) and self_lookahead 0 are set each
time the robot software starts and last until changed.
Returns¶
Nothing.
Examples¶
robot.rti_connect(rate_hz=10, wait=True)
robot.rti_set_servo_generator("tracker", gain=15)
robot.rti_disconnect(wait=True)
Further details¶
Note
In RTI mode only "passthrough" checks the stream itself (the speed,
acceleration, jerk and soft-limit errors); the others absorb a jump
within the limits instead. Every one still needs each position
target's send time in RTI mode.
Usage restrictions 4 codes
This command runs at once; it is not queued. The robot accepts it in any mode and state, 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:
- [6101] Control held by another client — another client holds control; the message names it
- [6003] Invalid arguments —
nameis empty or holds a colon, a number is not finite, or the message did not carry exactly four values - [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 —
"passthrough"in SOFT_RTI (it needs a send time with every target), or RTI could not use a value. The message says why
In Python, a code above raises CommandRejected; its number is the code. The call raises:
CommandRejected: The robot refused it: a number is not finite, 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:gain,lookaheadorself_lookaheadis not a number. Nothing is sent.TypeError:gain,lookaheadorself_lookaheadis not a number. 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.