pyrcf.control_loop.minimal_ctrl_loop
Classes
A minimal control loop with only 1 controller and 1 local planner. |
Module Contents
- class pyrcf.control_loop.minimal_ctrl_loop.MinimalCtrlLoop(robot_interface: pyrcf.components.robot_interfaces.robot_interface_base.RobotInterface, state_estimator: pyrcf.components.state_estimators.state_estimator_base.StateEstimatorBase, controller: pyrcf.components.controllers.controller_base.ControllerBase, local_planner: pyrcf.components.local_planners.LocalPlannerBase, global_planner: pyrcf.components.global_planners.global_planner_base.GlobalMotionPlannerBase, verbose: bool = True)
Bases:
pyrcf.control_loop.simple_managed_ctrl_loop.SimpleManagedCtrlLoopA minimal control loop with only 1 controller and 1 local planner.
The run method runs the following in a loop of specified frequency.
read robot state from robot interface
update robot state with state estimates from state estimator
get global plan message from global planner / user interface
generate local plan using the global plan message
compute control command to track the local plan
write control command to robot
- controller_manager
- classmethod useWithDefaults(robot_interface: pyrcf.components.robot_interfaces.robot_interface_base.RobotInterface, controller: pyrcf.components.controllers.controller_base.ControllerBase, global_planner: pyrcf.components.global_planners.global_planner_base.GlobalMotionPlannerBase = None, local_planner: pyrcf.components.local_planners.LocalPlannerBase = BlindForwardingPlanner(), state_estimator: pyrcf.components.state_estimators.state_estimator_base.StateEstimatorBase = DummyStateEstimator(squawk=False), verbose: bool = True) MinimalCtrlLoop
Create a control loop default values for planners and state estimators.
Default local planner: BlindForwardingPlanner Default global planner: Try JoystickGlobalPlannerInterface; fallback KeyboardGlobalPlannerInterface Default state estimator: DummyStateEstimator
- Parameters:
robot_interface (RobotInterface) – The robot interface to use in the loop.
controller (ControllerBase) – The controller to be used.
global_planner (GlobalMotionPlannerBase, optional) – The global planner to use. If None provided, will try to first find a joystick, and then creates a keyboard interface if joystick is not found.
local_planner (LocalPlannerBase, optional) – Local planner to use. Defaults to BlindForwardingPlanner.
state_estimator (StateEstimatorBase, optional) – State estimator to use. Defaults to DummyStateEstimator(squawk=False).
- Returns:
- returns a valid control loop object with planners and state estimators
automatically defined.
- Return type: