pyrcf.components.local_planners
Module containing interface and definitions of local planner components that can be used in the control loop.
Submodules
Classes
Base class defining the interface for all local planners that can be used in the control |
|
Dummy local planner for testing pipeline. |
|
Simple forwarding planner which directly forwards the global plan message as local plan. |
|
Simply interpolates joint references given through the global plan messages using |
|
Solves IK using PybulletIKInterface for given end-effector reference and interpolates joint references. |
Package Contents
- class pyrcf.components.local_planners.LocalPlannerBase
Bases:
pyrcf.components.pyrcf_component.PyRCFComponentBase class defining the interface for all local planners that can be used in the control loop.
- abstract generate_local_plan(robot_state: pyrcf.core.types.RobotState, global_plan: pyrcf.core.types.GlobalMotionPlan, t: float, dt: float) pyrcf.core.types.LocalMotionPlan
The main local plan generation method to be called in the loop.
This method will be called after the global plan is generated in the loop.
This method should be implemented by any local planner implementation.
- Parameters:
robot_state (RobotState) – The current state information from the robot.
global_plan (GlobalMotionPlan) – the latest global plan generated by the global planner used in the loop.
t (float) – 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).
- Raises:
NotImplementedError – Raised if this method is not implemented by the child class.
- Returns:
The output local plan to be used by the controller in this iteration.
- Return type:
- class pyrcf.components.local_planners.DummyLocalPlanner(squawk: bool = True)
Bases:
LocalPlannerBaseDummy local planner for testing pipeline.
- _squawk = True
- generate_local_plan(robot_state: pyrcf.core.types.RobotState, global_plan: pyrcf.core.types.GlobalMotionPlan, t: float, dt: float) pyrcf.core.types.LocalMotionPlan
This is a dummy method for sanity checking the control loop.
- class pyrcf.components.local_planners.BlindForwardingPlanner
Bases:
pyrcf.components.local_planners.local_planner_base.LocalPlannerBaseSimple forwarding planner which directly forwards the global plan message as local plan.
- generate_local_plan(robot_state: pyrcf.core.types.RobotState, global_plan: pyrcf.core.types.GlobalMotionPlan, t: float, dt: float) pyrcf.core.types.LocalMotionPlan
The main local plan generation method to be called in the loop.
This method will be called after the global plan is generated in the loop.
This method should be implemented by any local planner implementation.
- Parameters:
robot_state (RobotState) – The current state information from the robot.
global_plan (GlobalMotionPlan) – the latest global plan generated by the global planner used in the loop.
t (float) – 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).
- Raises:
NotImplementedError – Raised if this method is not implemented by the child class.
- Returns:
The output local plan to be used by the controller in this iteration.
- Return type:
- class pyrcf.components.local_planners.JointReferenceInterpolator(filter_gain=0.05, blind_mode: bool = True, forward_other_global_plan_values: bool = True)
Bases:
pyrcf.components.local_planners.blind_forwarding_planner.LocalPlannerBaseSimply interpolates joint references given through the global plan messages using a 2nd-order filter.
- _alpha = 0.05
- _blind_mode = True
- _output_plan: pyrcf.core.types.LocalMotionPlan = None
- _prev_ref: numpy.ndarray = None
- _forward_gp = True
- generate_local_plan(robot_state: pyrcf.core.types.RobotState, global_plan: pyrcf.core.types.GlobalMotionPlan, t: float, dt: float) pyrcf.core.types.LocalMotionPlan
The main local plan generation method to be called in the loop.
This method will be called after the global plan is generated in the loop.
This method should be implemented by any local planner implementation.
- Parameters:
robot_state (RobotState) – The current state information from the robot.
global_plan (GlobalMotionPlan) – the latest global plan generated by the global planner used in the loop.
t (float) – 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).
- Raises:
NotImplementedError – Raised if this method is not implemented by the child class.
- Returns:
The output local plan to be used by the controller in this iteration.
- Return type:
- class pyrcf.components.local_planners.PybulletIKReferenceInterpolator(urdf_path: str, floating_base: bool = False, starting_base_position: pyrcf.core.types.Vector3D = np.zeros(3), starting_base_orientation: pyrcf.core.types.QuatType = np.array([0, 0, 0, 1]), starting_joint_positions: List[float] = None, joint_names_order: List[str] = None, filter_gain=0.05, blind_mode: bool = True, ee_names: List[str] = None, max_constraint_force: float = 10000, solver_erp: float = None, **pb_ik_kwargs)
Bases:
pyrcf.components.local_planners.local_planner_base.LocalPlannerBaseSolves IK using PybulletIKInterface for given end-effector reference and interpolates joint references.
- _pb_ik
- _alpha = 0.05
- _blind_mode = True
- _max_force = 10000
- _erp = None
- _ee_names = None
- _output_plan: pyrcf.core.types.LocalMotionPlan = None
- _prev_ee_pose_targets: Mapping[str, Tuple[pyrcf.core.types.Vector3D, pyrcf.core.types.QuatType]]
- _prev_ref: numpy.ndarray = None
- generate_local_plan(robot_state: pyrcf.core.types.RobotState, global_plan: pyrcf.core.types.GlobalMotionPlan, t: float, dt: float) pyrcf.core.types.LocalMotionPlan
The main local plan generation method to be called in the loop.
This method will be called after the global plan is generated in the loop.
This method should be implemented by any local planner implementation.
- Parameters:
robot_state (RobotState) – The current state information from the robot.
global_plan (GlobalMotionPlan) – the latest global plan generated by the global planner used in the loop.
t (float) – 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).
- Raises:
NotImplementedError – Raised if this method is not implemented by the child class.
- Returns:
The output local plan to be used by the controller in this iteration.
- Return type: