manual_node.h
Go to the documentation of this file.
1 /* Copyright (C) 2020-2022 Davide Faconti - All Rights Reserved
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
4 * to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
5 * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
10 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 #pragma once
14 
16 
17 namespace BT
18 {
23 {
24 public:
25  ManualSelectorNode(const std::string& name, const NodeConfiguration& config);
26 
27  virtual ~ManualSelectorNode() override = default;
28 
29  virtual void halt() override;
30 
32  {
33  return {InputPort<bool>(REPEAT_LAST_SELECTION, false,
34  "If true, execute again the same child that was selected the "
35  "last "
36  "time")};
37  }
38 
39 private:
40  static constexpr const char* REPEAT_LAST_SELECTION = "repeat_last_selection";
41 
42  virtual BT::NodeStatus tick() override;
45 
47  {
48  NUM_SUCCESS = 253,
49  NUM_FAILURE = 254,
50  NUM_RUNNING = 255,
51  };
52 
53  NodeStatus selectStatus() const;
54 
55  uint8_t selectChild() const;
56 };
57 
58 } // namespace BT
virtual void halt() override
Definition: manual_node.cpp:29
Use a Terminal User Interface (ncurses) to select a certain child manually.
Definition: manual_node.h:22
static PortsList providedPorts()
Definition: manual_node.h:31
const NodeConfiguration & config() const
Definition: tree_node.cpp:127
static constexpr const char * REPEAT_LAST_SELECTION
Definition: manual_node.h:40
uint8_t selectChild() const
ManualSelectorNode(const std::string &name, const NodeConfiguration &config)
Definition: manual_node.cpp:20
const std::string & name() const
Name of the instance, not the type.
Definition: tree_node.cpp:101
virtual ~ManualSelectorNode() override=default
NodeStatus selectStatus() const
Definition: manual_node.cpp:85
std::unordered_map< std::string, PortInfo > PortsList
Definition: basic_types.h:333
NodeStatus
Definition: basic_types.h:35
virtual BT::NodeStatus tick() override
Method to be implemented by the user.
Definition: manual_node.cpp:39


behaviortree_cpp_v3
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Mon Jul 3 2023 02:50:14