Skip to content

set_friction_comp

Runs at once Any mode Takes control

Switch friction compensation in freedrive on or off. With it on, in freedrive (IDLE mode, on an enabled, homed arm with gravity compensation on), the robot pushes each joint gently in the direction it is already moving, to make up part of its friction. The push is a share of the joint's friction model in the robot XML, less the joint's gravity-model error (<gravity_error_nm>): a joint whose gravity model is off by as much as that share gets none.

It gives nothing at rest, so static friction still holds a released arm. It is full from 2 deg/s and fades out between 20 and 40 deg/s, as shipped. The shares and speeds are config/system.xml <friction_comp>: fraction, model_share, sliding_ratio, band_dps, fade_start_dps and fade_end_dps, read when the robot software starts. Outside freedrive it has no effect; for motion, see set_friction_ff().

The call returns as soon as the robot accepts it. latest_status() shows the switch in friction_comp once it is in force, and the robot's activity log records each change.

Syntax

robot.set_friction_comp(enabled)

Arguments

Name Type Default Description
enabled bool required True to help joints moved by hand, False to stop helping.

Default values

Off, set each time the robot software starts.

Returns

Any

Always None: the robot's answer carries no data.

Examples

robot.enter_idle_mode(wait=True)
robot.set_friction_comp(True)
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 was not true or false (1 / 0); this client always sends one of them
  • [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.

Protocol

A client that does not use robotclient sends this over the TCP command protocol (port 29000) for the example above:

{"id": "c1", "cmd": "set_friction_comp", "args": [1]}

See also