pyrcf.control_loop.minimal_ctrl_loop

Classes

MinimalCtrlLoop

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.SimpleManagedCtrlLoop

A minimal control loop with only 1 controller and 1 local planner.

The run method runs the following in a loop of specified frequency.

  1. read robot state from robot interface

  2. update robot state with state estimates from state estimator

  3. get global plan message from global planner / user interface

  4. generate local plan using the global plan message

  5. compute control command to track the local plan

  6. 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:

MinimalCtrlLoop