17 #ifndef NAV2_CONTROLLER__PLUGINS__FEASIBLE_PATH_HANDLER_HPP_
18 #define NAV2_CONTROLLER__PLUGINS__FEASIBLE_PATH_HANDLER_HPP_
24 #include "nav2_core/path_handler.hpp"
25 #include "nav2_ros_common/lifecycle_node.hpp"
26 #include "nav2_ros_common/tf2_factories.hpp"
28 namespace nav2_controller
59 const nav2::LifecycleNode::WeakPtr & parent,
60 const rclcpp::Logger & logger,
61 const std::string & plugin_name,
62 const std::shared_ptr<nav2_costmap_2d::Costmap2DROS> costmap_ros,
63 nav2::TransformBuffer::SharedPtr tf)
override;
69 void setPlan(
const nav_msgs::msg::Path & path)
override;
80 const geometry_msgs::msg::PoseStamped & pose)
override;
89 const nav2_core::PathIterator & closest_point,
90 const nav2_core::PathIterator & pruned_plan_end)
override;
98 const builtin_interfaces::msg::Time & stamp)
override;
104 nav_msgs::msg::Path
getPlan() {
return global_plan_;}
113 const geometry_msgs::msg::PoseStamped & pose);
133 void prunePlan(nav_msgs::msg::Path & plan,
const nav2_core::PathIterator end);
137 rclcpp::node_interfaces::PostSetParametersCallbackHandle::SharedPtr post_set_params_handler_;
138 rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr on_set_params_handler_;
139 nav2::LifecycleNode::WeakPtr node_;
140 rclcpp::Logger logger_ {rclcpp::get_logger(
"FeasiblePathHandler")};
141 std::string plugin_name_;
142 nav2::TransformBuffer::SharedPtr tf_;
143 std::shared_ptr<nav2_costmap_2d::Costmap2DROS> costmap_ros_;
144 nav_msgs::msg::Path global_plan_;
145 nav_msgs::msg::Path global_plan_up_to_constraint_;
146 geometry_msgs::msg::PoseStamped global_pose_;
147 unsigned int constraint_locale_{0u};
148 bool reject_unit_path_, enforce_path_inversion_, enforce_path_rotation_;
149 double max_robot_pose_search_dist_, transform_tolerance_, prune_distance_;
150 float inversion_xy_tolerance_, inversion_yaw_tolerance_, minimum_rotation_angle_;
161 const std::vector<rclcpp::Parameter> & parameters);
This plugin manages the global plan by clipping it to the local segment, typically bounded by the loc...
~FeasiblePathHandler()
Destroy the Feasible Path Handler object.
double getCostmapMaxExtent() const
void prunePlan(nav_msgs::msg::Path &plan, const nav2_core::PathIterator end)
Prune a path to only interesting portions.
nav_msgs::msg::Path transformLocalPlan(const nav2_core::PathIterator &closest_point, const nav2_core::PathIterator &pruned_plan_end) override
Transforms a predefined segment of the global plan into the costmap global frame.
bool isWithinInversionTolerances(const geometry_msgs::msg::PoseStamped &robot_pose)
Check if the robot pose is within the set inversion tolerances.
geometry_msgs::msg::PoseStamped transformToGlobalPlanFrame(const geometry_msgs::msg::PoseStamped &pose)
Transform a pose to the global reference frame.
nav_msgs::msg::Path getPlan()
Gets the global plan.
FeasiblePathHandler()=default
Construct a new Feasible Path Handler object.
void setPlan(const nav_msgs::msg::Path &path) override
Set new reference plan.
void updateParametersCallback(const std::vector< rclcpp::Parameter > ¶meters)
Apply parameter updates after validation This callback is executed when parameters have been successf...
geometry_msgs::msg::PoseStamped getTransformedGoal(const builtin_interfaces::msg::Time &stamp) override
Get the global goal pose transformed to the costmap global frame.
rcl_interfaces::msg::SetParametersResult validateParameterUpdatesCallback(const std::vector< rclcpp::Parameter > ¶meters)
Validate incoming parameter updates before applying them. This callback is triggered when one or more...
nav2_core::PathSegment findPlanSegment(const geometry_msgs::msg::PoseStamped &pose) override
Determines the portion of the global plan to be used for local control. This function locates the sta...
void initialize(const nav2::LifecycleNode::WeakPtr &parent, const rclcpp::Logger &logger, const std::string &plugin_name, const std::shared_ptr< nav2_costmap_2d::Costmap2DROS > costmap_ros, nav2::TransformBuffer::SharedPtr tf) override
Initialize parameters.
Function-object for handling the path from Planner Server.