Skip to content

cameron-ridgewell/BehaviorTree.ROS

 
 

Repository files navigation

BehaviorTree.ROS

BehaviorTree.CPP is a middleware independent framework to develop Behavior Trees in C++.

Overview

The library is not particularly opinionated about the way Actions and Conditions should be created; this gives more freedom to the developer, but can also be confusing for those people which are getting started with it.

Consequently, many people in the ROS community asked for examples and guidelines; this repository try to provide some basic examples.

Currently, two wrappers are provided:

Adding Actions to the GUI

As of the time of this writing, the BehaviorTree.CPP's GUI tool, Groot, is not explicitly compatible with the ROS library. What this means is that a small number of modifications may need to be made in order for the xml from Groot to be compatible with the ROS tool.

Once Groot is installed, you can create a new Action node in the GUI,

Screenshot from 2021-04-12 16-46-59

or directly in the xml:

    <Action ID="moveTwist">
        <input_port default="0" name="angular_x"/>
        <input_port default="0" name="angular_y"/>
        <input_port default="0" name="angular_z"/>
        <input_port default="0" name="linear_x"/>
        <input_port default="0" name="linear_y"/>
        <input_port default="0" name="linear_z"/>
    </Action>

In either case, these ports will need to be defined in the C++ class as well (below as in test_bt.cpp)

  static BT::PortsList providedPorts() {
    return  {
      InputPort<double>("linear_x"),
      InputPort<double>("linear_y"),
      InputPort<double>("linear_z"),
      InputPort<double>("angular_x"),
      InputPort<double>("angular_y"),
      InputPort<double>("angular_z")};
  }

About

ROS related code on top of the framework BehaviorTree.CPP [Work In Progress]

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 92.0%
  • CMake 8.0%