Skip to content

rti_set_vel_scale

Runs at once Any mode Takes control

Scale the real-time joint speed limits down. Every joint's real-time velocity limit becomes fraction of its value in the robot XML (<rti_limits><velocity>). It can only lower the limits, and each call scales from the XML values, so calls do not add up. It takes effect at once. It limits the servo generators, velocity commands while the rate limiter is on, and the first-command check; acceleration and jerk keep their limits, and the RTI-mode stream checks still use the full ones.

In SOFT_RTI it smooths a slow stream: a generator capped near your travel speed glides between your targets instead of sprinting to each and waiting. Set it to about your travel speed divided by the joint's limit. It acts like a cliff: above your travel speed it changes nothing, and at it the arm has no speed in reserve to catch up after a delay.

Syntax

robot.rti_set_vel_scale(fraction)

Arguments

Name Type Default Description
fraction float required The share of the robot XML limit, above 0 and at most 1: a fraction, not a percent. Below 0.01 counts as 0.01; zero, a negative, a non-finite value or one above 1 is refused.

Default values

1 (the robot XML limits), set each time the robot software starts. It lasts until changed or the robot software restarts; rti_connect() does not reset it.

Returns

Nothing.

Examples

robot.rti_connect(rate_hz=20, wait=True)
robot.rti_set_vel_scale(0.1)
robot.rti_set_vel_scale(1)
robot.rti_disconnect(wait=True)

Further details

Note

It lasts across sessions: set it back to 1 when your program is done, or the next session, from any PC, runs slower.

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 — fraction is not a number above 0 and at most 1, or the message did not carry exactly one value
  • [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 — rTI could not use the value. The message says why; the setting in force stays

In Python, a code above raises CommandRejected; its number is the code. The call raises:

  • CommandRejected: The robot refused it: fraction is not above 0 and at most 1, 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: fraction is not a number. Nothing is sent.
  • TypeError: fraction is 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.

See also