pyrcf.components.robot_interfaces.robot_interface_base ====================================================== .. py:module:: pyrcf.components.robot_interfaces.robot_interface_base Classes ------- .. autoapisummary:: pyrcf.components.robot_interfaces.robot_interface_base.RobotInterface pyrcf.components.robot_interfaces.robot_interface_base.DummyRobot Module Contents --------------- .. py:class:: RobotInterface Bases: :py:obj:`pyrcf.components.pyrcf_component.PyRCFComponent` Base class defining the interface for all robots that can be used in the control loop. .. py:method:: read() -> pyrcf.core.types.RobotState :abstractmethod: 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. :rtype: RobotState .. py:method:: write(cmd: pyrcf.core.types.RobotCmd) -> bool :abstractmethod: Send the specified commands to the robot. :param cmd: the command object as computed by the controller in the loop. :type cmd: RobotCmd :raises NotImplementedError: Raised if this method is not implemented by the child class. :returns: True if sending command was succesful. :rtype: bool .. py:method:: 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. .. py:method:: 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. .. py:class:: DummyRobot(squawk: bool = True) Bases: :py:obj:`RobotInterface` Base class defining the interface for all robots that can be used in the control loop. .. py:attribute:: _squawk .. py:method:: read() -> pyrcf.core.types.RobotState This is a dummy method for sanity checking the control loop. .. py:method:: write(cmd: pyrcf.core.types.RobotCmd) -> bool This is a dummy method for sanity checking the control loop.