SMACC2
planner_switcher.hpp
Go to the documentation of this file.
1// Copyright 2021 RobosoftAI Inc.
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/*****************************************************************************************************************
16 *
17 * Authors: Pablo Inigo Blasco, Brett Aldrich
18 *
19 ******************************************************************************************************************/
20#pragma once
21
22#include <rclcpp/rclcpp.hpp>
24#include <smacc2/component.hpp>
25#include <std_msgs/msg/string.hpp>
26
27namespace cl_nav2z
28{
29// this component is used to switch the current planner and controller interacting
30// with the remote navigation2 stack nodes (bt_navigator, planner_server, controller_server)
32{
33public:
35
36 void setBackwardPlanner();
37
39
40 void setForwardPlanner();
41
43
44 void onInitialize() override;
45
46 // sets ROS defaults local and global planners
47 void setDefaultPlanners();
48
49private:
51
53
55
56 void updatePlanners();
57
58 rclcpp::Publisher<std_msgs::msg::String>::SharedPtr planner_selector_pub_;
59
60 rclcpp::Publisher<std_msgs::msg::String>::SharedPtr controller_selector_pub_;
61
62 rclcpp::Publisher<std_msgs::msg::String>::SharedPtr goal_checker_selector_pub_;
63};
64} // namespace cl_nav2z
rclcpp::Publisher< std_msgs::msg::String >::SharedPtr controller_selector_pub_
rclcpp::Publisher< std_msgs::msg::String >::SharedPtr goal_checker_selector_pub_
rclcpp::Publisher< std_msgs::msg::String >::SharedPtr planner_selector_pub_