pyrcf.components.ctrl_loop_debuggers.ctrl_loop_debugger_base

Classes

CtrlLoopDebuggerBase

Base class for control loop debuggers. Can only be used with control loops.

DummyDebugger

A dummy debugger to test in pipeline.

Module Contents

class pyrcf.components.ctrl_loop_debuggers.ctrl_loop_debugger_base.CtrlLoopDebuggerBase(rate: float = None, clock: pyrcf.utils.time_utils.ClockBase = PythonPerfClock())

Bases: abc.ABC

Base class for control loop debuggers. Can only be used with control loops.

_rate = None
_should_run()
run_once(t: float, dt: float, robot_state: pyrcf.core.types.RobotState, global_plan: pyrcf.core.types.GlobalMotionPlan, agent_outputs: List[Tuple[pyrcf.core.types.LocalMotionPlan, pyrcf.core.types.RobotCmd]], robot_cmd: pyrcf.core.types.RobotCmd)

The main method that will be run in every control loop.

NOTE: SHOULD NOT BE OVERRIDDEN. Override the _run_once_impl method.

This method automatically checks if it is ok to trigger the implemented child method, and calls it if appropriate.

Parameters:
  • t (float) – Current time in the control loop.

  • dt (float) – The current dt in the control loop.

  • robot_state (RobotState) – robot state after update from the state estimator in the control loop.

  • global_plan (GlobalMotionPlan) – The global plan output produced by the global planner.

  • agent_outputs (List[Tuple[LocalMotionPlan, RobotCmd]]) – The list of outputs from all agents in the control loop.

  • robot_cmd (RobotCmd) – The final command written to the robot.

abstract _run_once_impl(t: float, dt: float, robot_state: pyrcf.core.types.RobotState, global_plan: pyrcf.core.types.GlobalMotionPlan, agent_outputs: List[Tuple[pyrcf.core.types.LocalMotionPlan, pyrcf.core.types.RobotCmd]], robot_cmd: pyrcf.core.types.RobotCmd)

The main method that will be run in every control loop. Should be overridden in the implemented child of CtrlLoopDebuggerBase.

This method will be called automatically if the timer is triggered, as long as the main run_once() method is called continuously in the control loop.

Parameters:
  • t (float) – Current time in the control loop.

  • dt (float) – The current dt in the control loop.

  • robot_state (RobotState) – robot state after update from the state estimator in the control loop.

  • global_plan (GlobalMotionPlan) – The global plan output produced by the global planner.

  • agent_outputs (List[Tuple[LocalMotionPlan, RobotCmd]]) – The list of outputs from all agents in the control loop.

  • robot_cmd (RobotCmd) – The final command written to the robot.

shutdown()

Cleanly shutdown the debugger. Override in child class if required. The base class implements an empty function.

class pyrcf.components.ctrl_loop_debuggers.ctrl_loop_debugger_base.DummyDebugger(squawk: bool = True, rate: float = 10, clock: pyrcf.utils.time_utils.ClockBase = PythonPerfClock())

Bases: CtrlLoopDebuggerBase

A dummy debugger to test in pipeline.

_squawk = True
_run_once_impl(t: float, dt: float, robot_state: pyrcf.core.types.RobotState, global_plan: pyrcf.core.types.GlobalMotionPlan, agent_outputs: List[Tuple[pyrcf.core.types.LocalMotionPlan | pyrcf.core.types.RobotCmd]], robot_cmd: pyrcf.core.types.RobotCmd)

The main method that will be run in every control loop. Should be overridden in the implemented child of CtrlLoopDebuggerBase.

This method will be called automatically if the timer is triggered, as long as the main run_once() method is called continuously in the control loop.

Parameters:
  • t (float) – Current time in the control loop.

  • dt (float) – The current dt in the control loop.

  • robot_state (RobotState) – robot state after update from the state estimator in the control loop.

  • global_plan (GlobalMotionPlan) – The global plan output produced by the global planner.

  • agent_outputs (List[Tuple[LocalMotionPlan, RobotCmd]]) – The list of outputs from all agents in the control loop.

  • robot_cmd (RobotCmd) – The final command written to the robot.