parallel_robot.h
Go to the documentation of this file.
1 #ifndef PARALLEL_ROBOT_
2 #define PARALLEL_ROBOT_
3 
4 #pragma once
5 
6 #include <set>
7 #include "behaviortree_cpp_v3/control_node.h"
8 
9 class Parallel_robot : public BT::ControlNode{
10 public:
11  Parallel_robot(const std::string& name, int success_threshold, int failure_threshold = 1);
12  Parallel_robot(const std::string& name, const BT::NodeConfiguration& config);
13 
14  static BT::PortsList providedPorts(){
15  return {BT::InputPort<int>(THRESHOLD_SUCCESS, "number of childen which need to succeed "
16  "to "
17  "trigger a SUCCESS"),
18  BT::InputPort<int>(THRESHOLD_FAILURE, 1,
19  "number of childen which need to fail to trigger a FAILURE")};
20  }
21 
22  ~Parallel_robot() override = default;
23 
24  virtual void halt() override;
25 
26  size_t successThreshold() const;
27  size_t failureThreshold() const;
28  void setSuccessThreshold(int threshold_M);
29  void setFailureThreshold(int threshold_M);
30 
31 private:
34 
35  std::set<int> skip_list_;
36 
38  static constexpr const char* THRESHOLD_SUCCESS = "success_threshold";
39  static constexpr const char* THRESHOLD_FAILURE = "failure_threshold";
40 
41  virtual BT::NodeStatus tick() override;
42 };
43 
44 #endif
45 
46 
Parallel_robot::tick
virtual BT::NodeStatus tick() override
Definition: parallel_robot.cpp:39
Parallel_robot::THRESHOLD_FAILURE
static constexpr const char * THRESHOLD_FAILURE
Definition: parallel_robot.h:39
Parallel_robot::setFailureThreshold
void setFailureThreshold(int threshold_M)
Definition: parallel_robot.cpp:143
Parallel_robot::setSuccessThreshold
void setSuccessThreshold(int threshold_M)
Definition: parallel_robot.cpp:139
Parallel_robot::skip_list_
std::set< int > skip_list_
Definition: parallel_robot.h:35
Parallel_robot::THRESHOLD_SUCCESS
static constexpr const char * THRESHOLD_SUCCESS
Definition: parallel_robot.h:38
Parallel_robot::failureThreshold
size_t failureThreshold() const
Definition: parallel_robot.cpp:133
Parallel_robot::failure_threshold_
int failure_threshold_
Definition: parallel_robot.h:33
Parallel_robot
Definition: parallel_robot.h:9
Parallel_robot::success_threshold_
int success_threshold_
Definition: parallel_robot.h:32
Parallel_robot::read_parameter_from_ports_
bool read_parameter_from_ports_
Definition: parallel_robot.h:37
Parallel_robot::Parallel_robot
Parallel_robot(const std::string &name, int success_threshold, int failure_threshold=1)
Definition: parallel_robot.cpp:24
Parallel_robot::providedPorts
static BT::PortsList providedPorts()
Definition: parallel_robot.h:14
Parallel_robot::successThreshold
size_t successThreshold() const
Definition: parallel_robot.cpp:126
Parallel_robot::halt
virtual void halt() override
Definition: parallel_robot.cpp:120
Parallel_robot::~Parallel_robot
~Parallel_robot() override=default


multi_cell_builder
Author(s): Matteo Anedda
autogenerated on Sun Apr 9 2023 23:59:51