Robot State

For clients to use the robot state service.

class bosdyn.client.robot_state.RobotStateClient[source]

Bases: BaseClient

Client for the RobotState service.

default_service_name = 'robot-state'
service_type = 'bosdyn.api.RobotStateService'
get_robot_state(**kwargs)[source]

Obtain current state of the robot.

Returns:

The current robot state.

Return type:

RobotState

Raises:

RpcError – Problem communicating with the robot.

get_robot_state_async(**kwargs)[source]

Async version of get_robot_state()

get_robot_metrics(**kwargs)[source]

Obtain robot metrics, such as distance traveled or time powered on.

Returns:

All of the current robot metrics.

Raises:

RpcError – Problem communicating with the robot.

get_robot_metrics_async(**kwargs)[source]

Async version of get_robot_state()

get_robot_hardware_configuration(**kwargs)[source]

Obtain current hardware configuration of robot.

Returns:

The hardware configuration, which includes the link names.

Raises:

RpcError – Problem communicating with the robot.

get_robot_hardware_configuration_async(**kwargs)[source]

Async version of get_robot_hardware_configuration()

Obtain link model OBJ for a specific link.

Parameters:

link_name (string) – Name of the link to get the model.

Returns:

The bosdyn.api.Skeleton.Link.ObjModel for the specified link.

Raises:

RpcError – Problem communicating with the robot.

Async version of get_robot_joint_model_async()

Convenience function which first requests a robot’s hardware configuration followed by requests to get link models for all robot links.

Returns:

bosdyn.api.robot_state_pb2.HardwareConfiguration with all link models filled out.

class bosdyn.client.robot_state.RobotStateStreamingClient[source]

Bases: BaseClient

Client for the RobotState service.

This client is in BETA and may undergo changes in future releases.

default_service_name = 'robot-state-streaming'
service_type = 'bosdyn.api.RobotStateStreamingService'
get_robot_state_stream(**kwargs)[source]

Returns an iterator providing current state updates of the robot.

bosdyn.client.robot_state.has_arm(state_client, timeout=None)[source]

Check if the robot has an arm attached.

Parameters:
  • state_client – RobotStateClient to query for robot state.

  • timeout – Number of seconds to wait for RPC response.

Returns:

Returns True if robot has an arm, False otherwise.

Return type:

bool

Raises:

RpcError – A problem occurred trying to communicate with the robot.