├── BTUserManual.pdf
├── LICENSE
├── README.md
├── behavior_tree
├── CMakeLists.txt
└── package.xml
├── behavior_tree_core
├── CMakeLists.txt
├── action
│ └── BT.action
├── contributors.txt
├── include
│ ├── action_node.h
│ ├── actions
│ │ ├── action_test_node.h
│ │ └── ros_action.h
│ ├── behavior_tree.h
│ ├── condition_node.h
│ ├── conditions
│ │ ├── condition_test_node.h
│ │ └── ros_condition.h
│ ├── control_node.h
│ ├── decorator_node.h
│ ├── decorators
│ │ └── negation_node.h
│ ├── dot_bt.h
│ ├── draw.h
│ ├── exceptions.h
│ ├── fallback_node.h
│ ├── fallback_node_with_memory.h
│ ├── leaf_node.h
│ ├── parallel_node.h
│ ├── sequence_node.h
│ ├── sequence_node_with_memory.h
│ ├── tick_engine.h
│ └── tree_node.h
├── package.xml
├── src
│ ├── action_node.cpp
│ ├── actions
│ │ ├── action_test_node.cpp
│ │ └── ros_action.cpp
│ ├── behavior_tree.cpp
│ ├── condition_node.cpp
│ ├── conditions
│ │ ├── condition_test_node.cpp
│ │ └── ros_condition.cpp
│ ├── control_node.cpp
│ ├── decorator_node.cpp
│ ├── decorators
│ │ └── negation_node.cpp
│ ├── dot_bt.cpp
│ ├── draw.cpp
│ ├── exceptions.cpp
│ ├── fallback_node.cpp
│ ├── fallback_node_with_memory.cpp
│ ├── gtest
│ │ ├── external_ros_nodes_test.cpp
│ │ └── gtest_tree.cpp
│ ├── leaf_node.cpp
│ ├── parallel_node.cpp
│ ├── sequence_node.cpp
│ ├── sequence_node_with_memory.cpp
│ ├── tick_engine.cpp
│ ├── tree.cpp
│ └── tree_node.cpp
└── templates
│ ├── action_node_template.cpp
│ └── condition_node_template.cpp
├── behavior_tree_leaves
├── CMakeLists.txt
├── contributors.txt
├── example_nodes
│ ├── cpp
│ │ ├── action_example.cpp
│ │ ├── bt_action.h
│ │ ├── class_example.cpp
│ │ └── condition_example.cpp
│ └── python
│ │ ├── action_example.py
│ │ ├── bt_action.py
│ │ ├── class_example.py
│ │ └── condition_example.py
├── launch
│ └── test_behavior_tree.launch
├── package.xml
└── src
│ ├── action_client.cpp
│ └── condition_client.cpp
└── contributors.txt
/BTUserManual.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miccol/ROS-Behavior-Tree/578180fc73314acf5d15d3bc2e7ccb4d691de00b/BTUserManual.pdf
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 - 2018 Michele Colledanchise
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | NEWS!
2 | -----------
3 |
4 |
5 |
6 |
7 | Our book **Behavior Trees in Robotics and AI**, published by CRC Press Taylor & Francis, is available for purchase (ebook and hardcover) on the CRC Press Store or Amazon. The Preprint version (**free**) is available here: https://arxiv.org/abs/1709.00084
8 | **Tutorials** available at https://btirai.github.io/
9 |
10 |
11 |
12 |
13 |
14 | -----------
15 |
16 |
17 | NOTE:
18 | ------
19 | The [YARP version](https://github.com/miccol/YARP-Behavior-Trees) of this library has a GUI as the following:
20 | 
21 |
22 |
23 | ROS-Behavior-Tree 
24 | ====
25 | 
26 | A ROS behavior tree library. The leaf nodes (user defined) can be either in `C++` or `python`. Read the user manual for more information.
27 |
28 | REFERENCE
29 | ------------
30 | Please refer to the following paper when using the library:
31 |
32 | **How Behavior Trees Modularize Hybrid Control Systems and Generalize Sequential Behavior Compositions, the Subsumption Architecture, and Decision Trees.** Michele Colledanchise and Petter Ogren. IEEE Transaction on Robotics 2017.
33 |
34 | bibtex entry:
35 |
36 | `@ARTICLE{TRO17Colledanchise,`
37 | `author={M. Colledanchise and P. Ögren},`
38 | `journal={IEEE Transactions on Robotics},`
39 | `title={{How Behavior Trees Modularize Hybrid Control Systems and Generalize Sequential Behavior Compositions, the Subsumption Architecture, and Decision Trees}},`
40 | `year={2017},`
41 | `volume={33},`
42 | `number={2},`
43 | `pages={372-389},`
44 | `keywords={Computer architecture;Decision trees;High definition video;Robot control;Switches;Behavior trees (BTs);decision trees;finite state machines (FSMs);hybrid dynamical systems (HDSs);modularity;sequential behavior compositions;subsumption architecture}, `
45 | `doi={10.1109/TRO.2016.2633567},`
46 | `ISSN={1552-3098},`
47 | `month={April},}`
48 |
49 | INFO
50 | ------------
51 | Contains 2 packages: behavior_tree_core and behavior_tree_leaves.
52 |
53 | behavior_tree_core: Contains the core BT source code, including the tree and the leaf nodes.
54 |
55 | behavior_tree_leaves: Contains action and condition specifications for BT leaf nodes **running as external ROS nodes**.
56 |
57 | User manual available in the project folder (BTUserManual.pdf):
58 |
59 |
60 |
61 |
62 | BUILD STATUS
63 | ------------
64 |
65 |
66 |
67 | |
68 | Hydro |
69 | Indigo |
70 | Jade |
71 | Kinetic |
72 |
73 | Release |
74 |
75 |
76 | |
77 |
78 |
79 | |
80 |
81 |
82 | |
83 |
84 |
85 | |
86 |
87 |
88 |
89 | DEPENDENCIES
90 | ------------
91 |
92 | Regarding visualization purposes:
93 | * [Opengl](https://www.opengl.org/)
94 | * [Glut](https://www.opengl.org/resources/libraries/glut/)
95 | * [xdot](https://github.com/jbohren/xdot): For visualizing using DOT language.
96 | * [rqt_dot](https://github.com/jbohren/rqt_dot): For visualizing the tree in RQT with DOT language.
97 |
98 | Regarding unit tests:
99 | * [GTest](https://github.com/google/googletest)
100 |
101 | BT NODES SUPPORT
102 | ----------------
103 | **Selector:** Selector nodes are used to find and execute the first child that does not fail. A Selector node will return immediately with a status code of success or running when one of its children returns success or running. The children are ticked in order of importance, from `left` to `right`.
104 |
105 | **Sequence:** Sequence nodes are used to find and execute the first child that has not yet succeeded. A sequence node will return immediately with a status code of `failure` or `running` when one of its children returns failure or running. The children are ticked in order, from `left` to `right`.
106 |
107 | **Parallel:** The parallel node ticks its children in parallel and returns success if `M ≤ N` children return success, it returns failure if `N − M + 1` children return failure, and it returns running otherwise.
108 |
109 | **Decorator:** The decorator node manipulates the return status of its child according to the policy defined by the user (e.g. it inverts the success/failure status of the child). In this library the decorators implemented are the two common ones: *Decorator Retry* which retries the execution of a node if this fails; and *Decorator Negation* That inverts the Success/Failure outcome.
110 |
111 | **Action:** An Action node performs an action, and returns Success if the action is completed, Failure if it can not be completed and Running if completion is under way.
112 |
113 | **Condition:** A Condition node determines if a desired condition `c` has been met. Conditions are technically a subset of the Actions, but are given a separate category and graphical symbol to improve readability of the BT and emphasize the fact that they never return running and do not change any internal states/variables of the BT.
114 |
115 |
116 |
117 |
118 |
119 | SETUP
120 | -----------
121 | **USER MANUAL available inside the repo's folder**
122 |
123 | The first step to use BT++ is to retrieve its source code. You can either download it
124 | here (https://github.com/miccol/ROS-Behavior-Tree) or clone the repository:
125 |
126 | `$ cd /path/to/catkin_ws/src`
127 | `$ git clone https://github.com/miccol/ROS-Behavior-Tree.git`
128 |
129 | Once you have the repository. Compile the library:
130 |
131 | `$ cd /path/to/catkin_ws/`
132 | `$ catkin_make`
133 |
134 | Check the installation by launching an example.
135 |
136 | `$ roslaunch behavior_tree_leaves test_behavior_tree.launch`
137 |
138 | Run `rqt_dot` plugin for the visualization in ROS and put the ROS topic in
139 | which the tree is published. The default topic is `/bt_dotcode`.
140 |
141 | ```
142 | rosrun rqt_dot rqt_dot
143 | ```
144 | NOTES
145 | -------
146 | In case you are puzzled about why a sequence (or fallback) node with 2 or more actions as children never get past the first action, see [this](https://github.com/miccol/ROS-Behavior-Tree/issues/16) discussion.
147 |
148 | LICENSE
149 | -------
150 | The MIT License (MIT)
151 |
152 | Copyright (c) 2014-2018 Michele Colledanchise
153 |
154 | Permission is hereby granted, free of charge, to any person obtaining a copy
155 | of this software and associated documentation files (the "Software"), to deal
156 | in the Software without restriction, including without limitation the rights
157 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
158 | copies of the Software, and to permit persons to whom the Software is
159 | furnished to do so, subject to the following conditions:
160 |
161 | The above copyright notice and this permission notice shall be included in all
162 | copies or substantial portions of the Software.
163 |
164 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
165 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
166 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
167 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
168 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
169 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
170 | SOFTWARE.
171 |
--------------------------------------------------------------------------------
/behavior_tree/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(behavior_tree)
3 | find_package(catkin REQUIRED)
4 | catkin_metapackage()
5 |
--------------------------------------------------------------------------------
/behavior_tree/package.xml:
--------------------------------------------------------------------------------
1 |
2 | behavior_tree
3 | 1.0.0
4 | A ROS behavior tree library. The leaf nodes (user defined) can be either in C++ or python
5 |
6 | Michele Colledanchise
7 | MIT
8 | Michele Colledanchise
9 | Rocco Santomo
10 | Petter Ögren
11 |
12 | catkin
13 | behavior_tree_core
14 | behavior_tree_leaves
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/behavior_tree_core/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(behavior_tree_core)
3 |
4 |
5 |
6 | find_package(catkin REQUIRED COMPONENTS
7 | actionlib
8 | actionlib_msgs
9 | message_generation
10 | roscpp
11 | rospy
12 | std_msgs
13 | roslaunch
14 | genmsg
15 | )
16 |
17 |
18 | add_action_files(
19 | DIRECTORY action
20 | FILES BT.action
21 | )
22 |
23 |
24 | generate_messages(
25 | DEPENDENCIES actionlib_msgs std_msgs # Or other packages containing msgs
26 | )
27 |
28 |
29 | add_definitions(-Wall -lglut -lGL -std=c++0x)
30 |
31 | catkin_package(
32 | CATKIN_DEPENDS actionlib_msgs
33 | INCLUDE_DIRS include
34 | LIBRARIES ${PROJECT_NAME}
35 | )
36 |
37 |
38 |
39 | #########################################################
40 | # FIND GLUT
41 | #########################################################
42 | find_package(GLUT REQUIRED)
43 | include_directories(${GLUT_INCLUDE_DIRS})
44 | link_directories(${GLUT_LIBRARY_DIRS})
45 | add_definitions(${GLUT_DEFINITIONS})
46 | if(NOT GLUT_FOUND)
47 | message(ERROR " GLUT not found!")
48 | endif(NOT GLUT_FOUND)
49 |
50 | #########################################################
51 | # FIND OPENGL
52 | #########################################################
53 | find_package(OpenGL REQUIRED)
54 | include_directories(${OpenGL_INCLUDE_DIRS})
55 | link_directories(${OpenGL_LIBRARY_DIRS})
56 | add_definitions(${OpenGL_DEFINITIONS})
57 | if(NOT OPENGL_FOUND)
58 | message(ERROR " OPENGL not found!")
59 | endif(NOT OPENGL_FOUND)
60 |
61 | #########################################################
62 | # FIND GTest
63 | #########################################################
64 | find_package(GTest)
65 | include_directories(${GTEST_INCLUDE_DIRS})
66 |
67 |
68 | INCLUDE_DIRECTORIES(${catkin_INCLUDE_DIRS} include)
69 |
70 | file(GLOB_RECURSE BTHeadLibrary include/*.h)
71 |
72 | set(BTSrcLibrary
73 | src/action_node.cpp
74 | src/behavior_tree.cpp
75 | src/condition_node.cpp
76 | src/control_node.cpp
77 | src/decorators/negation_node.cpp
78 | #src/decorator_retry_node.cpp
79 | #src/decorator_negation_node.cpp
80 | src/draw.cpp
81 | src/exceptions.cpp
82 | src/leaf_node.cpp
83 | src/tick_engine.cpp
84 | src/parallel_node.cpp
85 | src/fallback_node.cpp
86 | src/sequence_node.cpp
87 | src/decorator_node.cpp
88 | src/fallback_node_with_memory.cpp
89 | src/sequence_node_with_memory.cpp
90 | src/tree_node.cpp
91 | src/actions/action_test_node.cpp
92 | src/conditions/condition_test_node.cpp
93 | src/actions/ros_action.cpp
94 | src/conditions/ros_condition.cpp
95 | src/dot_bt.cpp
96 | )
97 |
98 | # Compile the core library with name ${PROJECT_NAME}=behavior_tree_core
99 | # You can create executables which target to this library for using BTs
100 | add_library(${PROJECT_NAME} ${BTSrcLibrary} ${BTHeadLibrary})
101 | target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})
102 | add_dependencies(${PROJECT_NAME} behavior_tree_core_generate_messages_cpp)
103 |
104 | add_executable(tree src/tree.cpp)
105 | target_link_libraries(tree
106 | ${catkin_LIBRARIES}
107 | ${PROJECT_NAME})
108 |
109 | add_executable(gtest_tree src/gtest/gtest_tree.cpp)
110 | target_link_libraries(gtest_tree
111 | ${catkin_LIBRARIES}
112 | ${PROJECT_NAME}
113 | ${GTEST_LIBRARIES})
114 |
115 | add_executable(gtest_ros src/gtest/external_ros_nodes_test.cpp)
116 | target_link_libraries(gtest_ros
117 | ${catkin_LIBRARIES}
118 | ${PROJECT_NAME}
119 | ${GTEST_LIBRARIES})
120 |
121 |
122 | #add_executable(ros_test src/ros_test.cpp ${BTSrcLibrary} ${BTHeadLibrary})
123 | #target_link_libraries(ros_test ${catkin_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})
124 | #add_dependencies(ros_test behavior_tree_core_generate_messages_cpp)
125 |
126 |
127 |
--------------------------------------------------------------------------------
/behavior_tree_core/action/BT.action:
--------------------------------------------------------------------------------
1 | #goal definition
2 | int32 parameter #no goal needed for BT tick. But It could be useful to have a parameter for action (e.g.goto x,y)
3 | ---
4 | #result definition RUNNING = 0, SUCCESS = 1, FAILURE = 2
5 | int32 status
6 | ---
7 | #feedback
8 | int32 status
9 |
--------------------------------------------------------------------------------
/behavior_tree_core/contributors.txt:
--------------------------------------------------------------------------------
1 | Michele Colledanchise
2 |
--------------------------------------------------------------------------------
/behavior_tree_core/include/action_node.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2015-2017 Michele Colledanchise - 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 ACTION_NODE_H
14 | #define ACTION_NODE_H
15 |
16 | #include
17 | #include
18 | namespace BT
19 | {
20 |
21 | class ActionNode : public LeafNode
22 | {
23 | public:
24 | // Constructor
25 | explicit ActionNode(std::string name);
26 | ~ActionNode();
27 |
28 | // The method that is going to be executed by the thread
29 | virtual void WaitForTick() = 0;
30 | BT::ReturnStatus Tick();
31 |
32 | // The method used to interrupt the execution of the node
33 | virtual void Halt() = 0;
34 |
35 | // Methods used to access the node state without the
36 | // conditional waiting (only mutual access)
37 | bool WriteState(ReturnStatus new_state);
38 | int DrawType();
39 | };
40 | } // namespace BT
41 |
42 | #endif // ACTION_NODE_H
43 |
--------------------------------------------------------------------------------
/behavior_tree_core/include/actions/action_test_node.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2015-2017 Michele Colledanchise - 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 |
14 | #ifndef ACTIONS_ACTION_TEST_NODE_H
15 | #define ACTIONS_ACTION_TEST_NODE_H
16 |
17 | #include
18 | #include
19 | namespace BT
20 | {
21 | class ActionTestNode : public ActionNode
22 | {
23 | public:
24 | // Constructor
25 | explicit ActionTestNode(std::string Name);
26 | ~ActionTestNode();
27 |
28 | void WaitForTick();
29 | void set_time(int time);
30 |
31 | void Halt();
32 | void set_boolean_value(bool boolean_value);
33 | private:
34 | int time_;
35 | bool boolean_value_;
36 | };
37 | } // namespace BT
38 |
39 | #endif // ACTIONS_ACTION_TEST_NODE_H
40 |
--------------------------------------------------------------------------------
/behavior_tree_core/include/actions/ros_action.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2015-2017 Michele Colledanchise - 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 |
14 | #ifndef ACTIONS_ROS_ACTION_H
15 | #define ACTIONS_ROS_ACTION_H
16 |
17 | #include
18 | #include
19 |
20 | #include
21 | #include
22 | #include
23 |
24 |
25 |
26 | namespace BT
27 | {
28 | class ROSAction : public ActionNode
29 | {
30 | protected:
31 | actionlib::SimpleActionClient action_client_;
32 | behavior_tree_core::BTResult node_result;
33 | behavior_tree_core::BTGoal goal;
34 | public:
35 | // Constructor
36 | explicit ROSAction(std::string name);
37 | ~ROSAction();
38 |
39 | // The method that is going to be executed by the thread
40 | void WaitForTick();
41 |
42 | // The method used to interrupt the execution of the node
43 | void Halt();
44 | };
45 | } // namespace BT
46 |
47 | #endif // ACTIONS_ROS_ACTION_H
48 |
--------------------------------------------------------------------------------
/behavior_tree_core/include/behavior_tree.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2015-2017 Michele Colledanchise - 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 BEHAVIOR_TREE_H
14 | #define BEHAVIOR_TREE_H
15 |
16 |
17 |
18 |
19 |
20 | #include
21 |
22 | #include
23 | #include
24 | #include
25 |
26 | #include
27 | #include
28 |
29 | #include
30 | #include
31 |
32 |
33 | #include
34 | #include
35 | #include
36 | #include
37 |
38 |
39 | #include
40 |
41 | #include
42 | #include