Class PlannerClient

Inheritance Relationships

Base Type

Class Documentation

class PlannerClient : public plansys2::PlannerInterface

Client implementation of the PlannerInterface.

This class provides a client that connects to the planner services to request plans for PDDL planning problems.

Public Functions

PlannerClient()

Constructor for the PlannerClient.

Creates a ROS node and configures service clients to connect to the planner services. Also retrieves the plan_solver_timeout parameter.

virtual std::optional<plansys2_msgs::msg::Plan> getPlan(const std::string &domain, const std::string &problem, const std::string &node_namespace = "")

Generate a single plan for a PDDL planning problem.

Parameters:
  • domain[in] PDDL domain definition as a string.

  • problem[in] PDDL problem definition as a string.

  • node_namespace[in] Namespace used for organizing temporary files and resources.

Returns:

std::optional<plansys2_msgs::msg::Plan> Plan message containing the plan if found, std::nullopt if no plan could be generated.

virtual plansys2_msgs::msg::PlanArray getPlanArray(const std::string &domain, const std::string &problem, const std::string &node_namespace = "")

Generate multiple alternative plans for a PDDL planning problem.

Parameters:
  • domain[in] PDDL domain definition as a string.

  • problem[in] PDDL problem definition as a string.

  • node_namespace[in] Namespace used for organizing temporary files and resources.

Returns:

A message containing an array of plans found for the problem.