pyrcf.components.controller_manager =================================== .. py:module:: pyrcf.components.controller_manager .. autoapi-nested-parse:: Defines controller managers that can be used to handle multiple controllers in the control loop. Subpackages ----------- .. toctree:: :maxdepth: 1 /autoapi/pyrcf/components/controller_manager/command_accumulators/index Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/pyrcf/components/controller_manager/controller_manager_base/index /autoapi/pyrcf/components/controller_manager/simple_controller_manager/index Classes ------- .. autoapisummary:: pyrcf.components.controller_manager.ControllerManagerBase pyrcf.components.controller_manager.SimpleControllerManager Package Contents ---------------- .. py:class:: ControllerManagerBase(agents: List[pyrcf.components.agents.agent_base.AgentBase], command_accumulation_policy: pyrcf.components.controller_manager.command_accumulators.cmd_accumulation_policies.CommandAccumulatorBase) Bases: :py:obj:`abc.ABC` Base class for writing controller (agent) managers. .. py:attribute:: agents .. py:attribute:: _accumulator .. py:method:: add_agent(agent: pyrcf.components.agents.agent_base.AgentBase) Add an agent to be managed by this controller manager. :param agent: The agent to be added to the end of the list. :type agent: AgentBase :returns: The self object with the new agent added. This is for using this method in a builder strategy. :rtype: ControllerManagerBase .. py:method:: set_cmd_accumulation_policy(policy: pyrcf.components.controller_manager.command_accumulators.cmd_accumulation_policies.CommandAccumulatorBase) Set/change the command accumulation policy for this mananger. :param policy: The new policy to be used. :type policy: CommandAccumulatorBase :returns: The self object with the policy updated. This is for using this method in a builder strategy. :rtype: ControllerManagerBase .. py:method:: update(robot_state: pyrcf.core.types.RobotState, global_plan: pyrcf.core.types.GlobalMotionPlan, t: float, dt: float) -> pyrcf.core.types.RobotCmd :abstractmethod: Run one update step of all the 'agents' managed by this manager. :param robot_state: Current robot state. This is equivalent to 'observation' in standard learning-based agents. :type robot_state: RobotState :param global_plan: The reference global plan to follow. :type global_plan: GlobalMotionPlan :param t: the current time signature of the control loop. Defaults to None (controllers may or may not need this). :type t: float, optional :param dt: the time since the last control loop. Defaults to None (controllers may or may not need this). :type dt: float, optional :returns: The output control command (action) to be sent to the robot based on the accumulation policy used by this manager. :rtype: RobotCmd :raises NotImplementedError: Raised if this method is not implemented by the child class. .. py:method:: shutdown() Cleanly shutdown all agents managed by this controller manager. .. py:class:: SimpleControllerManager(agents: List[pyrcf.components.agents.agent_base.AgentBase] = None, command_accumulation_policy: pyrcf.components.controller_manager.command_accumulators.cmd_accumulation_policies.CommandAccumulatorBase = SimpleCmdOverride()) Bases: :py:obj:`pyrcf.components.controller_manager.controller_manager_base.ControllerManagerBase` A simple controller manager that naively performs sequential updates of all agents it manages. .. py:method:: update(robot_state: pyrcf.core.types.RobotState, global_plan: pyrcf.core.types.GlobalMotionPlan, t: float, dt: float) -> pyrcf.core.types.RobotCmd Run one update step of all the 'agents' managed by this manager. :param robot_state: Current robot state. This is equivalent to 'observation' in standard learning-based agents. :type robot_state: RobotState :param global_plan: The reference global plan to follow. :type global_plan: GlobalMotionPlan :param t: the current time signature of the control loop. Defaults to None (controllers may or may not need this). :type t: float, optional :param dt: the time since the last control loop. Defaults to None (controllers may or may not need this). :type dt: float, optional :returns: The output control command (action) to be sent to the robot based on the accumulation policy used by this manager. :rtype: RobotCmd :raises NotImplementedError: Raised if this method is not implemented by the child class.