This workspace integrates both BehaviorTree.CPP (BTCPP) and ROS2 Jazzy, offering a robust environment for developing behavior trees and ROS2 applications. Behavior trees are widely used in AI, particularly in robotics and games, for managing complex decision-making processes. ROS2 (Robot Operating System 2) is a set of software libraries and tools for building robot applications.
BehaviorTree.CPP is an open-source C++ library for building behavior trees. It offers a customizable and user-friendly framework supporting asynchronous actions, reactive behaviors, and integration with various middleware and libraries. For more information, visit the official BehaviorTree.CPP website or the GitHub repository.
ROS2 Jazzy is the latest stable release of the Robot Operating System 2, providing reliable tools and libraries that are essential for robotics development. It improves upon previous versions with enhanced security, real-time performance, and cross-platform support. More details can be found on the ROS2 website.
This workspace includes a Docker environment tailored for developing with BehaviorTree.CPP and ROS2. It ensures a consistent setup across various systems and simplifies dependency management, making it easier to start developing and testing your applications immediately.
To begin using this Docker-based environment, follow these steps:
-
Clone the repository:
git clone https://github.com/mdirzpr/btcpp_ros2_ws.git
-
Build the Docker image:
cd btcpp_ros2_ws docker compose build
-
Start a container:
docker compose run btcpp_ros2
For more detailed instructions on working with Docker, refer to the official Docker documentation.
Here are the steps to test the 'BehaviorTree.CPP' library separated for clarity:
-
Change to the Project Directory: Navigate to the directory containing the example project.
cd src/BT_example/pick_place
-
Create a Build Directory: Set up a new directory for building the project. If it already exists, this command will have no effect.
mkdir build
-
Enter the Build Directory: Move into the newly created build directory.
cd build
-
Generate Makefiles: Run cmake to prepare the makefiles for building. This step configures the build environment.
cmake ..
-
Compile the Project: Use make to compile the source code into an executable.
make
-
Run the Executable: Execute the compiled binary to see the behavior tree in action.
./pickPlace
To test ROS2, run the demo_nodes_cpp
talker and listener nodes:
-
In one terminal, start the talker:
ros2 run demo_nodes_cpp talker
-
In another terminal, start the listener:
ros2 run demo_nodes_cpp listener
For discussions, updates, and networking with other users of BehaviorTree.CPP and ROS2, consider joining the BehaviorTree LinkedIn Group.
- Mahdi Rezapour
- Email: [email protected]