as2_behavior_tree
AS2 behavior trees
Links
README
as2_behavior_tree
This module is used to implement a ROS2 node that executes navigation Behavior Trees for navigation of drone systems. The behavior_trees
module uses the Behavior-Tree.CPP library for the core Behavior Tree processing.
The behavior_trees
module provides navigation-specific behavior tree nodes and a ROS2 node implementation and launchers. It uses nav2_behavior_tree C++ template class for easily integrating ROS2 actions and services into Behavior Trees,
Index
Installation
Dependencies:
sudo apt-get install ros-$ROS_DISTRO-behaviortree-cpp-v3
sudo apt-get install ros-$ROS_DISTRO-nav2-msgs
sudo apt-get install ros-$ROS_DISTRO-nav2-behavior-tree
You may also want to install Groot to build your own trees.
AeroStack2 BT Nodes
AeroStack2 offers a pull of predefined behavior nodes to build your own Behavior Tree.
Action
Show Actions
Arm
Arms the drone. Input port is not intended to use by the user, but used because nav2_behavior_tree
service action node implementation.
Returns SUCCESS if service result is true. Otherwise, returns FAILURE.
Port |
In / Out |
Description |
---|---|---|
service_name |
In |
Service name which will be called. |
Disarm
Disarms the drone. Input port is not intended to use by the user, but used because nav2_behavior_tree
service action node implementation.
Returns SUCCESS if service result is true. Otherwise, returns FAILURE.
Port |
In / Out |
Description |
---|---|---|
service_name |
In |
Service name which will be called. |
Echo
Prints data getted by input port. Used for debugging purpouses.
Always returns SUCCESS after echoing.
Port |
In / Out |
Description |
---|---|---|
data |
In |
String to be echoed. |
FollowPath
TBD
GoTo
Go to specified position with given maximum speed and yaw.
Returns SUCCESS if action finishes successfully or cancelled. Returns FAILURE if action is aborted, goal is rejected or action server fails. While action is executing returns RUNNING.
Port |
In / Out |
Description |
---|---|---|
max_speed |
In |
Maximum speed in meters per second. |
pose |
In |
Goal pose in meters (e.g. |
yaw_angle |
In |
Yaw angle in radians. |
yaw_mode |
In |
Yaw mode (KEEP_YAW = 0; PATH_FACING = 1; FIXED_YAW = 2). |
GoTo GPS
Go to specified GPS position with given maximum speed and yaw.
Returns SUCCESS if action finishes successfully or cancelled. Returns FAILURE if action is aborted, goal is rejected or action server fails. While action is executing returns RUNNING.
Port |
In / Out |
Description |
---|---|---|
alittude |
In |
Altitude in meters. |
latitude |
In |
Latitude in degrees. |
longitude |
In |
Longitude in degrees. |
max_speed |
In |
Maximum speed in meters per second. |
yaw_angle |
In |
Yaw angle in radians. |
yaw_mode |
In |
Yaw mode (KEEP_YAW = 0; PATH_FACING = 1; FIXED_YAW = 2). |
Land
Land at current position with given speed.
Returns SUCCESS if action finishes successfully or cancelled. Returns FAILURE if action is aborted, goal is rejected or action server fails. While action is executing returns RUNNING.
Port |
In / Out |
Description |
---|---|---|
speed |
In |
Land speed in meters per second. |
Offboard
Set offboard mode. Input port is not intended to use by the user, but used because nav2_behavior_tree
service action node implementation.
Returns SUCCESS if service result is true. Otherwise, returns FAILURE.
Port |
In / Out |
Description |
---|---|---|
service_name |
In |
Service name which will be called. |
SendEvent
Send event by topic.
Always returns SUCCESS after sending the event.
Port |
In / Out |
Description |
---|---|---|
data |
In |
Data to send (string). |
topic_name |
In |
Topic name where data will be sent. |
Takeoff
Takeoff at current position with given height and speed.
Returns SUCCESS if action finishes successfully or cancelled. Returns FAILURE if action is aborted, goal is rejected or action server fails. While action is executing returns RUNNING.
Port |
In / Out |
Description |
---|---|---|
height |
In |
Takeoff height in meters. |
speed |
In |
Takeoff speed in meters per second. |
Condition
Show Conditions
IsFlying
Returns wheter the drone is flying or not.
Returns SUCCESS is drone state is flying, otherwise returns FAILURE.
Control
-
Decorator
Show Decorators
WaitForEvent
Listens for event received in topic and outputs event msg content.
Returns SUCCESS on first event received, until that returns RUNNING.
Port |
In / Out |
Description |
---|---|---|
topic_name |
In |
Topic name where event will be published. |
result |
Out |
Content of event msg. |
How to create new nodes?
Three steps: