Skip to content

release_control

Runs at once Any mode Open to every client

Give up control of the robot. Another client can then take control. A client that does not hold control gets released false. It is refused while this client holds control and its own moves are still queued or running: wait for them (wait_idle()) or stop them (stop()) first. A collision-detection change this client made returns to its start value.

Syntax

robot.release_control()

Arguments

None.

Returns

Any

{"released": bool, "holder": label or None}: whether this client held control and gave it up, and who holds control now ("ip:port").

Examples

robot.take_control()
robot.release_control()
Usage restrictions 1 code

This command runs at once; it is not queued. The robot accepts it in any mode and state, from every client.

It answers with one of these codes when it does not carry the command out:

  • [6010] Command not allowed now — this client's moves are still queued or running

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

  • CommandRejected: The robot refused it; its error code says why.
  • 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": "release_control", "args": []}

See also