Skip to content

holds_control

Runs in the client Sends nothing to the robot

Return whether this client holds control. It compares control_holder() with this connection's own address, so it reads the latest status and asks the robot nothing. Behind a router that translates addresses (NAT) the robot sees another address, and it returns False. Right after a command claimed control on its own, the status can lag by about 20 ms.

Syntax

robot.holds_control()

Arguments

None.

Returns

bool

True when this connection holds control; False otherwise, also when the client is not connected.

Examples

robot.take_control()
robot.holds_control()

See also