Class PlannerNode

Inheritance Relationships

Base Type

  • public rclcpp_lifecycle::LifecycleNode

Class Documentation

class PlannerNode : public rclcpp_lifecycle::LifecycleNode

ROS2 Lifecycle Node that manages the planning system and handles planning requests.

This node loads planner plugins based on configuration parameters, provides services to generate plans from PDDL domains and problems, and validates domains.

Public Types

using CallbackReturnT = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn
using SolverMap = std::unordered_map<std::string, plansys2::PlanSolverBase::Ptr>

Public Functions

explicit PlannerNode(const rclcpp::NodeOptions &options = rclcpp::NodeOptions())

Constructor for the PlannerNode.

~PlannerNode()

Destructor for the PlannerNode.

CallbackReturnT on_configure(const rclcpp_lifecycle::State &state)

Configures the node.

Parameters:

state[in] The current lifecycle state.

Returns:

SUCCESS if configuration is successful, FAILURE otherwise.

CallbackReturnT on_activate(const rclcpp_lifecycle::State &state)

Activates the node.

Parameters:

state[in] The current lifecycle state.

Returns:

SUCCESS if activation is successful, FAILURE otherwise.

CallbackReturnT on_deactivate(const rclcpp_lifecycle::State &state)

Deactivates the node.

Parameters:

state[in] The current lifecycle state.

Returns:

SUCCESS if deactivation is successful, FAILURE otherwise.

CallbackReturnT on_cleanup(const rclcpp_lifecycle::State &state)

Cleans up the node.

Parameters:

state[in] The current lifecycle state.

Returns:

SUCCESS if cleanup is successful, FAILURE otherwise.

CallbackReturnT on_shutdown(const rclcpp_lifecycle::State &state)

Shuts down the node.

Parameters:

state[in] The current lifecycle state.

Returns:

SUCCESS if shutdown is successful, FAILURE otherwise.

CallbackReturnT on_error(const rclcpp_lifecycle::State &state)

Handles errors in the node.

Parameters:

state[in] The current lifecycle state.

Returns:

SUCCESS if error handling is successful, FAILURE otherwise.

void get_plan_service_callback(const std::shared_ptr<rmw_request_id_t> request_header, const std::shared_ptr<plansys2_msgs::srv::GetPlan::Request> request, const std::shared_ptr<plansys2_msgs::srv::GetPlan::Response> response)

Service callback to generate a plan for a PDDL problem.

Parameters:
  • request_header[in] ROS service request header.

  • request[in] Service request containing domain and problem PDDL strings.

  • response[out] Service response containing the generated plan and success status.

void get_plan_array_service_callback(const std::shared_ptr<rmw_request_id_t> request_header, const std::shared_ptr<plansys2_msgs::srv::GetPlanArray::Request> request, const std::shared_ptr<plansys2_msgs::srv::GetPlanArray::Response> response)

Service callback to generate multiple plans for a PDDL problem.

Parameters:
  • request_header[in] ROS service request header.

  • request[in] Service request containing domain and problem PDDL strings.

  • response[out] Service response containing an array of plans and success status.

void validate_domain_service_callback(const std::shared_ptr<rmw_request_id_t> request_header, const std::shared_ptr<plansys2_msgs::srv::ValidateDomain::Request> request, const std::shared_ptr<plansys2_msgs::srv::ValidateDomain::Response> response)

Service callback to validate a PDDL domain.

Parameters:
  • request_header[in] ROS service request header.

  • request[in] Service request containing the domain PDDL string.

  • response[out] Service response with validation result and error information.

plansys2_msgs::msg::PlanArray get_plan_array(const std::string &domain, const std::string &problem)

Generate multiple plans for a PDDL problem using all configured planners.

Parameters:
  • domain[in] PDDL domain string.

  • problem[in] PDDL problem string.

Returns:

An array of plans found by the planners.

inline void set_timeout(rclcpp::Duration solver_timeout)

Set the timeout for plan solvers.

Parameters:

solver_timeout[in] The new timeout duration.