SMACC2
Loading...
Searching...
No Matches
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 onInitialize() override;
37
38 void setDesiredGlobalPlanner(std::string);
39
40 void setDesiredController(std::string);
41
42 void commitPublish();
43
44 // STANDARD PLANNERS
45
46 void setBackwardPlanner(bool commit = true);
47
48 void setUndoPathBackwardPlanner(bool commit = true);
49
50 void setForwardPlanner(bool commit = true);
51
52 void setPureSpinningPlanner(bool commit = true);
53
54 // sets ROS defaults local and global planners
55 void setDefaultPlanners(bool commit = true);
56
57private:
58 std::string desired_planner_;
59
61
63
64 rclcpp::Publisher<std_msgs::msg::String>::SharedPtr planner_selector_pub_;
65
66 rclcpp::Publisher<std_msgs::msg::String>::SharedPtr controller_selector_pub_;
67
68 rclcpp::Publisher<std_msgs::msg::String>::SharedPtr goal_checker_selector_pub_;
69};
70} // namespace cl_nav2z
void setDesiredGlobalPlanner(std::string)
void setBackwardPlanner(bool commit=true)
rclcpp::Publisher< std_msgs::msg::String >::SharedPtr controller_selector_pub_
void setForwardPlanner(bool commit=true)
void setDefaultPlanners(bool commit=true)
void setPureSpinningPlanner(bool commit=true)
void setDesiredController(std::string)
rclcpp::Publisher< std_msgs::msg::String >::SharedPtr goal_checker_selector_pub_
rclcpp::Publisher< std_msgs::msg::String >::SharedPtr planner_selector_pub_
void setUndoPathBackwardPlanner(bool commit=true)