Nav2 Navigation Stack - rolling  main
ROS 2 Navigation Stack
parameter_handler.hpp
1 // Copyright (c) 2022 Samsung Research America
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_WAYPOINT_FOLLOWER__PARAMETER_HANDLER_HPP_
16 #define NAV2_WAYPOINT_FOLLOWER__PARAMETER_HANDLER_HPP_
17 
18 #include <string>
19 #include <vector>
20 #include <memory>
21 #include <algorithm>
22 #include <mutex>
23 
24 #include "rclcpp/rclcpp.hpp"
25 #include "nav2_ros_common/lifecycle_node.hpp"
26 #include "nav2_util/parameter_handler.hpp"
27 #include "nav2_ros_common/node_utils.hpp"
28 
29 namespace nav2_waypoint_follower
30 {
31 
32 struct Parameters
33 {
34  bool stop_on_failure;
35  int loop_rate;
36  std::string waypoint_task_executor_id;
37  std::string waypoint_task_executor_type;
38  std::string global_frame_id;
39 };
40 
46 {
47 public:
52  const nav2::LifecycleNode::SharedPtr & node,
53  const rclcpp::Logger & logger);
54 
55 protected:
64  rcl_interfaces::msg::SetParametersResult validateParameterUpdatesCallback(
65  const std::vector<rclcpp::Parameter> & parameters) override;
66 
73  void updateParametersCallback(const std::vector<rclcpp::Parameter> & parameters) override;
74 };
75 
76 } // namespace nav2_waypoint_follower
77 
78 #endif // NAV2_WAYPOINT_FOLLOWER__PARAMETER_HANDLER_HPP_
Handles parameters and dynamic parameters for Planner Server.
void updateParametersCallback(const std::vector< rclcpp::Parameter > &parameters) override
Apply parameter updates after validation This callback is executed when parameters have been successf...
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, const rclcpp::Logger &logger)
Constructor for nav2_waypoint_follower::ParameterHandler.