manual_node.h
Go to the documentation of this file.
1 /* Copyright (C) 2020 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 #ifndef MANUAL_SELECTION_NODE_H
14 #define MANUAL_SELECTION_NODE_H
15 
17 
18 namespace BT
19 {
24 {
25  public:
26  ManualSelectorNode(const std::string& name, const NodeConfiguration& config);
27 
28  virtual ~ManualSelectorNode() override = default;
29 
30  virtual void halt() override;
31 
33  {
34  return { InputPort<bool>(REPEAT_LAST_SELECTION, false,
35  "If true, execute again the same child that was selected the last time") };
36  }
37 
38  private:
39 
40  static constexpr const char* REPEAT_LAST_SELECTION = "repeat_last_selection";
41 
42  virtual BT::NodeStatus tick() override;
45 
47  NUM_SUCCESS = 253,
48  NUM_FAILURE = 254,
49  NUM_RUNNING = 255,
50  };
51 
52  NodeStatus selectStatus() const;
53 
54  uint8_t selectChild() const;
55 };
56 
57 }
58 
59 #endif // MANUAL_SELECTION_NODE_H
virtual void halt() override
Definition: manual_node.cpp:30
Use a Terminal User Interface (ncurses) to select a certain child manually.
Definition: manual_node.h:23
static PortsList providedPorts()
Definition: manual_node.h:32
const std::string & name() const
Name of the instance, not the type.
Definition: tree_node.cpp:73
const NodeConfiguration & config() const
Definition: tree_node.cpp:99
static constexpr const char * REPEAT_LAST_SELECTION
Definition: manual_node.h:40
ManualSelectorNode(const std::string &name, const NodeConfiguration &config)
Definition: manual_node.cpp:22
virtual ~ManualSelectorNode() override=default
std::unordered_map< std::string, PortInfo > PortsList
Definition: basic_types.h:317
NodeStatus selectStatus() const
Definition: manual_node.cpp:82
uint8_t selectChild() const
NodeStatus
Definition: basic_types.h:35
virtual BT::NodeStatus tick() override
Method to be implemented by the user.
Definition: manual_node.cpp:40


behaviotree_cpp_v3
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Tue May 4 2021 02:56:25