Skip to content

rti_set_gravity_comp

Runs at once Any mode Takes control

Switch gravity compensation on or off for real-time control. With it on, the robot adds the torque that holds the arm up against gravity to every real-time command and to its holds and stops, as in the other modes. Turn it off only when your controller computes gravity itself: a torque controller that also gets the robot's would apply it twice. It takes effect at once.

It needs the robot-wide switch on too (set_gravity_comp()), and it changes nothing outside the real-time modes.

Syntax

robot.rti_set_gravity_comp(enabled)

Arguments

Name Type Default Description
enabled bool required True to add gravity compensation, False to leave gravity to your controller.

Default values

On, set each time the robot software starts and at every rti_connect(); rti_disconnect() keeps it.

Returns

Nothing.

Examples

robot.rti_connect(wait=True)
robot.rti_set_gravity_comp(True)
robot.rti_disconnect(wait=True)

Further details

Warning

Off, a torque stream that adds no gravity of its own lets the arm fall, and position streams and holds carry the weight on the drives' own position loops alone. It stays off until it is switched on or the next rti_connect().

Usage restrictions 3 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 — the value is not true or false (1 / 0), or the message did not carry exactly one value; this client always sends one
  • [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

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

  • CommandRejected: 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.

See also