plansys2_support_py.ExecutorClient module
PlanSys2 Executor Client.
This module provides specific classes for interacting with PlanSys2 Executor services.
- class plansys2_support_py.ExecutorClient.ExecutorClient(*args: Any, **kwargs: Any)
Bases:
NodeExecutor client for PlanSys2.
This class provides convenient methods to interact with all Executor services in PlanSys2, wrapping the ROS2 service calls with proper error handling.
- execute_plan(plan: plansys2_msgs.msg.Plan | None = None, verbose: bool = True, rate_hz: float = 5.0) bool
Execute a plan using the executor action client.
This method executes the provided plan (or computes a new plan if not provided) and monitors its execution, displaying feedback if verbose is enabled.
Parameters
- planOptional[Plan], optional
The plan to execute. If None, computes a new plan from the current domain and problem.
- verbosebool, optional
Whether to print execution feedback to the console.
- rate_hzfloat, optional
Update rate in Hz for checking execution status.
Returns
- bool
True if plan execution succeeded, False otherwise.
- get_ordered_sub_goals() List[plansys2_msgs.msg.Tree] | None
Get the ordered sub-goals from the executor.
This method retrieves the list of sub-goals that the executor has identified for achieving the current problem goal, ordered by execution priority.
Returns
- Optional[List[Tree]]
List of sub-goals as Tree objects, or None if failed.
- get_plan() plansys2_msgs.msg.Plan | None
Get the current plan from the executor.
This method retrieves the complete plan that the executor is currently working on.
Returns
- Optional[Plan]
The current plan or None if failed.
- get_remaining_plan() plansys2_msgs.msg.Plan | None
Get the remaining plan from the executor.
This method retrieves the portion of the plan that has not yet been executed, which is useful for monitoring progress or handling plan modifications.
Returns
- Optional[Plan]
The remaining plan or None if failed.