Nav2 Navigation Stack - jazzy  jazzy
ROS 2 Navigation Stack
would_a_planner_recovery_help_condition.cpp
1 // Copyright (c) 2022 Joshua Wallace
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 #include "nav2_behavior_tree/plugins/condition/would_a_planner_recovery_help_condition.hpp"
16 #include <memory>
17 
18 namespace nav2_behavior_tree
19 {
20 
21 WouldAPlannerRecoveryHelp::WouldAPlannerRecoveryHelp(
22  const std::string & condition_name,
23  const BT::NodeConfiguration & conf)
24 : AreErrorCodesPresent(condition_name, conf)
25 {
26  error_codes_to_check_ = {
27  ActionResult::UNKNOWN,
28  ActionResult::NO_VALID_PATH,
29  ActionResult::TIMEOUT,
30  ThroughActionResult::UNKNOWN,
31  ThroughActionResult::TIMEOUT,
32  ThroughActionResult::NO_VALID_PATH
33  };
34 }
35 
36 } // namespace nav2_behavior_tree
37 
38 #include "behaviortree_cpp/bt_factory.h"
39 BT_REGISTER_NODES(factory)
40 {
41  factory.registerNodeType<nav2_behavior_tree::WouldAPlannerRecoveryHelp>(
42  "WouldAPlannerRecoveryHelp");
43 }