polymetis.robot_client package

Submodules

polymetis.robot_client.abstract_robot_client module

class polymetis.robot_client.abstract_robot_client.AbstractRobotClient(metadata_cfg: DictConfig)

Bases: ABC

Parent class for all RobotClients.

An interface for RobotClients which connect to the gRPC server. All RobotClients use the RobotClientMetadata object, which is instantiated from a Hydra config. Example robot client configs are in ../conf/robot_client/.

abstract run()

Override this method to connect to the server.

polymetis.robot_client.executable_robot_client module

class polymetis.robot_client.executable_robot_client.ExecutableRobotClient(executable_cfg: DictConfig, use_real_time: bool, *args, **kwargs)

Bases: AbstractRobotClient

A RobotClient which calls some executable as a subprocess.

This RobotClient is used for instantiating some executable as a subprocess, e.g. a connection to a robot requiring a real-time control loop.

Parameters:
  • executable_cfg – A Hydra configuration object detailing the executable. e.g. ../conf/robot_client/empty_statistics_client.

  • use_real_time – If True, this will call the executable with sudo.

run()

Connects to gRPC server, and passes executable client required files.

Note

Creates two temporary files: an executable configuration file, and a metadata protobuf message. The configuration file contains the path to the metadata file. The path of the configuration is passed to the executable.

polymetis.robot_client.metadata module

class polymetis.robot_client.metadata.EmptyRobotClientMetadata

Bases: RobotClientMetadata

class polymetis.robot_client.metadata.RobotClientMetadata(default_Kq: List[float], default_Kqd: List[float], default_Kx: List[float], default_Kxd: List[float], hz: int, robot_model_cfg: RobotModelConfig)

Bases: object

Container class to hold all necessary metadata for the RobotClient.

Constructs a container for the metadata by creating a default controller, loading the URDF file associated with the robot model and reading it into the metadata, and constructing the final Protobuf message containing the information necessary to instantiate a client that connects to the server.

Parameters:
  • default_Kq – Default position gains for the robot.

  • default_Kqd – Default velocity gains for the robot.

  • default_Kx – Default pose positional gains for the robot.

  • default_Kxd – Default pose velocity gains for the robot.

  • hz – Frequency the robot is running at.

  • robot_model_cfg – A dataclass containing all the info necessary for a urdf model of the robot.

get_proto()

Returns the underlying protobuf message.

serialize() bytes

Returns a byte-serialized version of the underlying protobuf message.

class polymetis.robot_client.metadata.RobotClientMetadataConfig(default_Kq: List[float], default_Kqd: List[float], default_Kx: List[float], default_Kxd: List[float], hz: int, robot_model: RobotModelConfig)

Bases: object

Dataclass holding full RobotClientMetadata, required for instantiatinga RobotClient with the server.

default_Kq: List[float]
default_Kqd: List[float]
default_Kx: List[float]
default_Kxd: List[float]
hz: int
robot_model: RobotModelConfig
class polymetis.robot_client.metadata.RobotModelConfig(robot_description_path: str, controlled_joints: List[float], num_dofs: int, rest_pose: List[float], joint_limits_low: List[float], joint_limits_high: List[float], joint_damping: List[float], torque_limits: List[float], ee_link_idx: Optional[int] = None, ee_link_name: Optional[str] = None)

Bases: object

Dataclass that holds relevant information for the robot model.

controlled_joints: List[float]
joint_damping: List[float]
joint_limits_high: List[float]
joint_limits_low: List[float]
num_dofs: int
rest_pose: List[float]
robot_description_path: str
torque_limits: List[float]

Module contents