Nav2 Navigation Stack - rolling  main
ROS 2 Navigation Stack
would_a_controller_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_controller_recovery_help_condition.hpp"
16 #include <memory>
17 
18 namespace nav2_behavior_tree
19 {
20 
21 WouldAControllerRecoveryHelp::WouldAControllerRecoveryHelp(
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::PATIENCE_EXCEEDED,
29  ActionResult::FAILED_TO_MAKE_PROGRESS,
30  ActionResult::NO_VALID_CONTROL
31  };
32 }
33 
34 } // namespace nav2_behavior_tree
35 
36 #include "behaviortree_cpp/bt_factory.h"
37 BT_REGISTER_NODES(factory)
38 {
39  factory.registerNodeType<nav2_behavior_tree::WouldAControllerRecoveryHelp>(
40  "WouldAControllerRecoveryHelp");
41 }