plansys2_support_py.core.PlanSolverBase module
Abstract base class for plan solvers in PlanSys2.
- class plansys2_support_py.core.PlanSolverBase.PlanSolverBase
Bases:
ABCAbstract base class for plan solvers in PlanSys2.
This class defines the interface for plan solver plugins, including methods for configuration, plan generation, domain validation, and planner execution.
- cancel() None
Request cancellation of the current planning process.
- abstractmethod configure(lc_node: rclpy.node.Node, plugin_name: str) None
Configure the plan solver with a lifecycle node and plugin name.
Parameters
- lc_nodeNode
The ROS2 lifecycle node.
- plugin_namestr
The name of the plugin.
- execute_planner(command: str, solver_timeout: rclpy.duration.Duration, plan_path: str) bool
Execute the planner with a command.
Parameters
- commandstr
The command to execute the planner.
- solver_timeoutDuration
Timeout for the solver.
- plan_pathstr
Path to store the resulting plan.
Returns
- bool
True if the planner executed successfully, False otherwise.
- abstractmethod get_plan(domain: str, problem: str, node_namespace: str = '', solver_timeout: rclpy.duration.Duration = rclpy.duration.Duration) plansys2_msgs.msg.Plan | None
Generate a plan given a PDDL domain and problem definition.
Parameters
- domainstr
The PDDL domain as a string.
- problemstr
The PDDL problem definition as a string.
- node_namespacestr, optional
The node namespace (default is ‘’).
- solver_timeoutDuration, optional
Timeout for the solver (default is 15s).
Returns
- Optional[Plan]
The resulting plan if found, otherwise None.