pyrcf.components.robot_interfaces.robot_interface_base

Classes

RobotInterface

Base class defining the interface for all robots that can be used in the control loop.

DummyRobot

Base class defining the interface for all robots that can be used in the control loop.

Module Contents

class pyrcf.components.robot_interfaces.robot_interface_base.RobotInterface

Bases: pyrcf.components.pyrcf_component.PyRCFComponent

Base class defining the interface for all robots that can be used in the control loop.

abstract read() pyrcf.core.types.RobotState

Get the latest state from the robot.

Raises:

NotImplementedError – Raised if this method is not implemented by the child class.

Returns:

the latest state of the robot.

Return type:

RobotState

abstract write(cmd: pyrcf.core.types.RobotCmd) bool

Send the specified commands to the robot.

Parameters:

cmd (RobotCmd) – the command object as computed by the controller in the loop.

Raises:

NotImplementedError – Raised if this method is not implemented by the child class.

Returns:

True if sending command was succesful.

Return type:

bool

activate() bool

This method will be called in a loop until it returns true, before the control loop starts. Override in child class as required.

deactivate() bool

This method will be called in a loop until it returns true, after the control loop is stopped, and before shutdown of this class is called. Override in child class as required.

class pyrcf.components.robot_interfaces.robot_interface_base.DummyRobot(squawk: bool = True)

Bases: RobotInterface

Base class defining the interface for all robots that can be used in the control loop.

_squawk = True
read() pyrcf.core.types.RobotState

This is a dummy method for sanity checking the control loop.

write(cmd: pyrcf.core.types.RobotCmd) bool

This is a dummy method for sanity checking the control loop.