pyrcf.components.agents.planner_controller_agent
Classes
A simple implementation of Agent using a local planner object and controller. |
Module Contents
- class pyrcf.components.agents.planner_controller_agent.PlannerControllerAgent(local_planner: pyrcf.components.local_planners.LocalPlannerBase, controller: pyrcf.components.controllers.ControllerBase)
Bases:
pyrcf.components.agents.agent_base.AgentBaseA simple implementation of Agent using a local planner object and controller.
This agent simply calls the local planner update and controller update steps in sequence.
- local_planner
- controller
- _latest_local_plan = None
- _latest_ctrl_cmd = None
- get_action(robot_state: pyrcf.core.types.RobotState, global_plan: pyrcf.core.types.GlobalMotionPlan, t: float = None, dt: float = None) pyrcf.core.types.RobotCmd
Compute the control command to be executed given the current state and the global plan.
- Parameters:
robot_state (RobotState) – Current robot state. This is equivalent to ‘observation’ in standard learning-based agents.
global_plan (GlobalMotionPlan) – The reference global plan to follow.
t (float, optional) – the current time signature of the control loop. Defaults to None (controllers may or may not need this).
dt (float, optional) – the time since the last control loop. Defaults to None (controllers may or may not need this).
- Returns:
The output control command (action) to be sent to the robot.
- Return type:
- Raises:
NotImplementedError – Raised if this method is not implemented by the child class.
- get_latest_local_plan() pyrcf.core.types.LocalMotionPlan
- get_latest_ctrl_cmd() pyrcf.core.types.RobotCmd
- get_last_output() Tuple[pyrcf.core.types.LocalMotionPlan, pyrcf.core.types.RobotCmd]
Should return the last computed outputs by this agent.
- Returns:
- Output local plan and control command from this agent.
NOTE: Either of these can be None, if the agent does not compute them.
- Return type:
Tuple[LocalMotionPlan, RobotCmd]
- shutdown()
Cleanly shutdown the PyRCF component. Override in child class if required. The base class implements an empty function.
- get_class_info() str
Override with custom string if needed.