Power

For clients to the power command service.

exception bosdyn.client.power.PowerResponseError(response, error_message=None)[source]

Bases: bosdyn.client.exceptions.ResponseError

General class of errors for Power service.

exception bosdyn.client.power.ShorePowerConnectedError(response, error_message=None)[source]

Bases: bosdyn.client.power.PowerResponseError

Robot cannot be powered on while on wall power.

exception bosdyn.client.power.BatteryMissingError(response, error_message=None)[source]

Bases: bosdyn.client.power.PowerResponseError

Battery not inserted into robot.

exception bosdyn.client.power.CommandInProgressError(response, error_message=None)[source]

Bases: bosdyn.client.power.PowerResponseError

Power command cannot be overwritten.

exception bosdyn.client.power.EstoppedError(response, error_message=None)[source]

Bases: bosdyn.client.power.PowerResponseError

Cannot power on while estopped.

Inspect EStopState for more info.

exception bosdyn.client.power.FaultedError(response, error_message=None)[source]

Bases: bosdyn.client.power.PowerResponseError

Cannot power on due to a fault.

Inspect FaultState for more info.

exception bosdyn.client.power.PowerError[source]

Bases: bosdyn.client.exceptions.Error

General class of errors to handle non-response non-grpc errors.

exception bosdyn.client.power.CommandTimedOutError[source]

Bases: bosdyn.client.power.PowerError

Timed out waiting for SUCCESS response from power command.

class bosdyn.client.power.PowerClient[source]

Bases: bosdyn.client.common.BaseClient

A client for enabling / disabling robot motor power. Commands are non blocking. Clients are expected to issue a power command and then periodically check the status of this command. This service requires ownership over the robot, in the form of a lease.

default_service_name = 'power'
service_type = 'bosdyn.api.PowerService'
update_from(other)[source]

Adopt key objects like processors, logger, and wallet from other.

power_command(request, lease=None, **kwargs)[source]

Issue a power request to the robot.

power_command_async(request, lease=None, **kwargs)[source]

Async version of power_command().

power_command_feedback(power_command_id, **kwargs)[source]

Check the status of a previously issued power command.

power_command_feedback_async(power_command_id, **kwargs)[source]

Async version of power_command_feedback()

bosdyn.client.power.safe_power_off(command_client, state_client, timeout_sec=30, update_frequency=1.0, **kwargs)[source]

Power off robot safely. This function blocks until robot safely powers off. This means the robot will attempt to sit before powering off.

Parameters
  • command_client (RobotCommandClient) – client for calling RobotCommandService safe power off.

  • state_client (RobotStateClient) – client for monitoring power state.

  • timeout_sec (float) – Max time this function will block for.

  • update_frequency (float) – The frequency with which the robot should check if the command has succeeded.

Raises
bosdyn.client.power.power_on(power_client, timeout_sec=30, update_frequency=1.0, **kwargs)[source]

Power on robot. This function blocks until the command returns success.

Parameters
  • power_client (bosdyn.api.PowerClient) – client for calling power service.

  • timeout_sec (float) – Max time this function will block for.

  • update_frequency (float) – The frequency with which the robot should check if the command has succeeded.

Raises
bosdyn.client.power.power_off(power_client, timeout_sec=30, update_frequency=1.0, **kwargs)[source]

Power off robot immediately. This function blocks until robot powers off. This will not put robot in a safe state.

Parameters
  • power_client (bosdyn.api.PowerClient) – client for calling power service.

  • timeout_sec (float) – Max time this function will block for.

  • update_frequency (float) – The frequency with which the robot should check if the command has succeeded.

Raises
bosdyn.client.power.is_powered_on(state_client, **kwargs)[source]

Returns true if robot is powered on, false otherwise.

Raises

RpcError – Problem communicating with the robot