Estop

For clients to the emergency stop (estop) service.

exception bosdyn.client.estop.EstopResponseError(response, error_message=None)[source]

Bases: ResponseError

General class of errors for Estop service.

exception bosdyn.client.estop.EndpointUnknownError(response, error_message=None)[source]

Bases: EstopResponseError

The endpoint specified in the request is not registered.

exception bosdyn.client.estop.IncorrectChallengeResponseError(response, error_message=None)[source]

Bases: EstopResponseError

The challenge and/or response was incorrect.

exception bosdyn.client.estop.EndpointMismatchError(response, error_message=None)[source]

Bases: EstopResponseError

Target endpoint did not match.

exception bosdyn.client.estop.ConfigMismatchError(response, error_message=None)[source]

Bases: EstopResponseError

Registered to the wrong configuration.

exception bosdyn.client.estop.InvalidEndpointError(response, error_message=None)[source]

Bases: EstopResponseError

New endpoint was invalid.

exception bosdyn.client.estop.InvalidIdError(response, error_message=None)[source]

Bases: EstopResponseError

Tried to replace a EstopConfig, but provided bad ID.

exception bosdyn.client.estop.MotorsOnError(response, error_message=None)[source]

Bases: EstopResponseError

The operation is not allowed while motors are on.

class bosdyn.client.estop.StopLevel(value)

Bases: IntEnum

An enumeration.

ESTOP_LEVEL_UNKNOWN = 0
ESTOP_LEVEL_CUT = 1
ESTOP_LEVEL_SETTLE_THEN_CUT = 2
ESTOP_LEVEL_NONE = 4
class bosdyn.client.estop.EstopClient(name='EstopClient - PID: 37')[source]

Bases: BaseClient

Client to the estop service.

default_service_name = 'estop'
service_type = 'bosdyn.api.EstopService'
register(target_config_id, endpoint, **kwargs)[source]

Register the endpoint in the target configuration.

Parameters:
  • target_config_id – The identification of the current configuration on the robot.

  • endpoint – Estop endpoint.

  • kwargs – Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.

Returns:

estop_pb2.EstopEndpoint that has been registered.

register_async(target_config_id, endpoint, **kwargs)[source]

Async version of register()

deregister(target_config_id, endpoint, **kwargs)[source]

Deregister the endpoint in the target configuration.

Parameters:
  • target_config_id – The identification of the current configuration on the robot.

  • endpoint – Estop endpoint.

  • kwargs – Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.

deregister_async(target_config_id, endpoint, **kwargs)[source]

Async version of deregister()

get_config(**kwargs)[source]

Return the estop configuration of the robot.

Parameters:

kwargs – Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.

Returns:

estop_pb2.EstopConfig the robot is currently using.

get_config_async(**kwargs)[source]

Async version of get_config()

set_config(config, target_config_id, **kwargs)[source]

Change the estop configuration of the robot.

Parameters:
  • config – New configuration to set.

  • target_config_id – The identification of the current configuration on the robot.

  • kwargs – Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.

Returns:

estop_pb2.EstopConfig the robot is currently using.

set_config_async(config, target_config_id, **kwargs)[source]

Async version of set_config()

get_status(**kwargs)[source]

Return the estop status of the robot.

Parameters:

kwargs – Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.

Returns:

estop_pb2.EstopSystemStatus from the server.

get_status_async(**kwargs)[source]

Async version of get_status()

check_in(stop_level, endpoint, challenge, response, suppress_incorrect=False, **kwargs)[source]

Check in with the estop system.

Parameters:
  • stop_level – Integer / enum representing desired stop level. See StopLevel enum.

  • endpoint – The endpoint asserting the stop level.

  • challenge – A previously received challenge from the server.

  • response – A response to the ‘challenge’ argument.

  • suppress_incorrect – Set True to prevent an IncorrectChallengeResponseError from being raised when STATUS_INVALID is returned. Useful for the first check-in, before a challenge has been sent by the server.

  • kwargs – Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.

Returns:

A new challenge from the server.

check_in_async(stop_level, endpoint, challenge, response, suppress_incorrect=False, **kwargs)[source]

Async version of check_in()

class bosdyn.client.estop.EstopEndpoint(client, name, estop_timeout, role='PDB_rooted', first_checkin=True, estop_cut_power_timeout=None)[source]

Bases: object

Endpoint in the software estop system.

REQUIRED_ROLE = 'PDB_rooted'
property last_set_level
set_challenge(challenge)[source]

Thread-safe write to the challenge.

get_challenge()[source]

Thread-safe read of the challenge.

force_simple_setup()[source]

Replaces the existing estop configuration with a single-endpoint configuration.

stop(**kwargs)[source]

Issue a CUT stop level command to the robot, cutting motor power immediately.

Parameters:

kwargs – Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.

Returns:

None. Will raise an error if RPC failed.

settle_then_cut(**kwargs)[source]

Issue a SETTLE_THEN_CUT stop level. The robot will attempt to sit before cutting motor power.

Parameters:

kwargs – Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.

Returns:

None. Will raise an error if RPC failed.

allow(**kwargs)[source]

Issue a NONE stop level command to the robot, allowing motor power.

Parameters:

kwargs – Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.

Returns:

None. Will raise an error if RPC failed.

check_in_at_level(level, **kwargs)[source]

Check in at a specified level.

Meant for internal use, but may be helpful for higher-level wrappers.

deregister(**kwargs)[source]

Deregister this endpoint from the configuration.

register(target_config_id, **kwargs)[source]

Register this endpoint to the given configuration.

stop_async(**kwargs)[source]

Async version of stop()

settle_then_cut_async(**kwargs)[source]

Async version of settle_then_cut()

allow_async(**kwargs)[source]

Async version of allow()

check_in_at_level_async(level, **kwargs)[source]
deregister_async(**kwargs)[source]

Async version of deregister()

from_proto(proto)[source]

Set member variables based on given estop_pb2.EstopEndpoint.

to_proto()[source]

Return estop_pb2.EstopEndpoint based on current member variables.

property unique_id

Return the _unique_id. Should be used as read-only.

class bosdyn.client.estop.EstopKeepAlive(endpoint, rpc_timeout_seconds=None, rpc_interval_seconds=None, keep_running_cb=None, max_status_queue_size=20)[source]

Bases: object

Wraps an EstopEndpoint to do periodic check-ins, keeping software estop from timing out.

This is intended to be the common implementation of both periodic checking-in and one-time check-ins. See the command line utility and the “Big Red Button” application for examples.

You should not access any of the “private” members, or the wrapped endpoint.

shutdown()[source]
property last_set_level
property logger
allow()[source]
settle_then_cut()[source]
stop()[source]
property endpoint

Return the _endpoint. Should be used as read-only.

property client

Return the _endpoint.client. Should be used as read-only.

class KeepAliveStatus(value)[source]

Bases: Enum

An enumeration.

OK = 0
ERROR = 1
DISABLED = 2
bosdyn.client.estop.is_estopped(estop_client, **kwargs)[source]

Returns true if robot is estopped, false otherwise.

Raises:

RpcError – Problem communicating with the robot

bosdyn.client.estop.response_from_challenge(challenge)[source]