Nav2 Navigation Stack - lyrical  lyrical
ROS 2 Navigation Stack
parameter_handler.hpp
1 // Copyright (c) 2023 Alberto J. Tudela Roldán
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef NAV2_GRACEFUL_CONTROLLER__PARAMETER_HANDLER_HPP_
16 #define NAV2_GRACEFUL_CONTROLLER__PARAMETER_HANDLER_HPP_
17 
18 #include <string>
19 #include <vector>
20 #include <memory>
21 #include <algorithm>
22 #include <mutex>
23 
24 #include "nav2_util/parameter_handler.hpp"
25 #include "nav2_ros_common/lifecycle_node.hpp"
26 #include "nav2_ros_common/node_utils.hpp"
27 
28 namespace nav2_graceful_controller
29 {
30 
31 struct Parameters
32 {
33  double min_lookahead;
34  double max_lookahead;
35  double k_phi;
36  double k_delta;
37  double beta;
38  double lambda;
39  double v_linear_min;
40  double v_linear_max;
41  double v_linear_max_initial;
42  double v_angular_max;
43  double v_angular_max_initial;
44  double v_angular_min_in_place;
45  double slowdown_radius;
46  double deceleration_max;
47  bool initial_rotation;
48  double initial_rotation_tolerance;
49  bool prefer_final_rotation;
50  double rotation_scaling_factor;
51  bool allow_backward;
52  double in_place_collision_resolution;
53  bool use_collision_detection;
54  double footprint_scaling_linear_vel;
55  double footprint_scaling_factor;
56  double footprint_scaling_step;
57  int obstacle_cost_margin;
58  double final_rotation_search_step;
59 };
60 
66 {
67 public:
72  const nav2::LifecycleNode::SharedPtr & node,
73  std::string & plugin_name,
74  rclcpp::Logger & logger);
75 
76 protected:
85  rcl_interfaces::msg::SetParametersResult validateParameterUpdatesCallback(
86  const std::vector<rclcpp::Parameter> & parameters) override;
87 
94  void updateParametersCallback(const std::vector<rclcpp::Parameter> & parameters) override;
95 
96  std::string plugin_name_;
97 };
98 
99 } // namespace nav2_graceful_controller
100 
101 #endif // NAV2_GRACEFUL_CONTROLLER__PARAMETER_HANDLER_HPP_
Handles parameters and dynamic parameters for GracefulMotionController.
rcl_interfaces::msg::SetParametersResult validateParameterUpdatesCallback(const std::vector< rclcpp::Parameter > &parameters) override
Validate incoming parameter updates before applying them. This callback is triggered when one or more...
ParameterHandler(const nav2::LifecycleNode::SharedPtr &node, std::string &plugin_name, rclcpp::Logger &logger)
Constructor for nav2_graceful_controller::ParameterHandler.
void updateParametersCallback(const std::vector< rclcpp::Parameter > &parameters) override
Apply parameter updates after validation This callback is executed when parameters have been successf...