pyrcf.components.ctrl_loop_debuggers.pybullet_robot_plan_debugger
This control loop debugger will create a dummy visual robot in pybullet which will try to follow position/pose plan in the control loop. This can be used to visualise ideal robot poses/configurations and to compare performance of controllers in tracking them.
Classes
This control loop debugger will create a dummy visual robot in pybullet which |
Module Contents
- class pyrcf.components.ctrl_loop_debuggers.pybullet_robot_plan_debugger.PybulletRobotPlanDebugger(urdf_path: str, rate: float = None, clock: pyrcf.utils.time_utils.ClockBase = PythonPerfClock(), cid: int = 0, enable_toggle_button: bool = True, show_ee_targets: bool = True, use_curr_pose_if_plan_unavailable: bool = True, **pybullet_debug_robot_kwargs)
Bases:
pyrcf.components.ctrl_loop_debuggers.ctrl_loop_debugger_base.CtrlLoopDebuggerBaseThis control loop debugger will create a dummy visual robot in pybullet which will try to follow position/pose plan in the control loop. This can be used to visualise ideal robot poses/configurations and to compare performance of controllers in tracking them.
- _debugger_robot
- _toggler_button = None
- _show_ee_targets
- _ee_frame_viz: Mapping[str, pyrcf.components.callback_handlers.pb_gui_utils.PybulletDebugFrameViz]
- _use_curr_pose
- _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.
- classmethod fromBulletRobotInstance(robot: pyrcf.components.robot_interfaces.simulation.pybullet_robot.PybulletRobot, rate: float = None, clock: pyrcf.utils.time_utils.ClockBase = PythonPerfClock(), enable_toggle_button: bool = True, show_ee_targets: bool = True, use_curr_pose_if_plan_unavailable: bool = True, **pybullet_debug_robot_kwargs) PybulletRobotPlanDebugger
Creates an instance of PybulletRobotPlanDebugger using the provided PybulletRobot child class object.
- Parameters:
robot (PybulletRobot) – The robot instance (will not be modified).
rate (float, optional) – Rate at which this should be triggered. Defaults to None (i.e. use control loop rate).
clock (ClockBase, optional) – The clock to use for timer. Defaults to PythonPerfClock().
cid (int, optional) – The pybullet physics client ID to connect to. Defaults to 0.
enable_toggle_button (bool, optional) – If set to True, this will create a button in the pybullet GUI to enable/disable the VISUALISATION of this debugger. Defaults to True. NOTE: This only affects the visualisation! Does not disable the actual debugger. NOTE: There can be an overhead when the visualisation is toggled on and off.
**pybullet_debug_robot_kwargs – Additional keyword arguments can be passed here. All keyword arguments to PybulletDebugRobot is allowed here (e.g. use rgba=[,,,] for setting the visualisation color of this debug robot)
- Returns:
- PybulletRobotPlanDebugger instance created using the urdf and
cid from the passed PybulletRobot object.
- Return type: