Skip to content

Comments

Upgrade plansys2_bt_example to Behaviortree.CPP v4#43

Merged
fmrico merged 1 commit intoPlanSys2:rollingfrom
robodrome:btcpp4
Feb 25, 2024
Merged

Upgrade plansys2_bt_example to Behaviortree.CPP v4#43
fmrico merged 1 commit intoPlanSys2:rollingfrom
robodrome:btcpp4

Conversation

@robodrome
Copy link
Contributor

Update Summary for plansys2_bt_example

Overview

Here are the details of the updates applied to the plansys2_bt_example package, part of the ROS 2 Planning System examples. The primary focus of these updates is to ensure compatibility with the latest version of BehaviorTree.CPP (v4), including syntax adjustments in behavior tree XML files and updates in include paths from behaviortree_cpp_v3 to behaviortree_cpp (v4).

Changes

Behavior Trees XML Configuration

  • Root Element Update: The root element in behavior tree XML files (move.xml, recharge.xml, transport.xml) now includes the BTCPP_format="4" attribute, indicating the use of BehaviorTree.CPP version 4.

  • Argument Syntax Update: In move.xml and transport.xml, the syntax for accessing arguments has been updated from ${argX} to {argX}, aligning with the updated parsing requirements of BehaviorTree.CPP.

Include Paths and API Usage

  • API Path Updates: The include paths in several .hpp and .cpp files have been updated from behaviortree_cpp_v3/* to behaviortree_cpp/*, reflecting the transition to the newer version of the library. This change affects the following nodes:
    • ApproachObject
    • CloseGripper
    • Move
    • OpenGripper
    • Recharge

Code Adjustments in Node Implementations

  • Blackboard Access Error Handling: In Move.cpp, error handling has been added when retrieving the node from the blackboard, enhancing the robustness of the implementation.

Documentation and Setup Instructions

  • README.md Enhancements:
    • A new Prerequisites section has been added, highlighting the need to install ros-humble-turtlebot3* packages.
    • The setup and execution commands have been updated to use the correct sourcing paths and execution commands.
    • A note has been added to indicate that the current setup may not be fully functional with BT.CPP v4, suggesting that adjustments are still being made for full compatibility.

Test

The instructions in plansys2_bt_example work without errors.

Conclusion

The plansys2_bt_example package has been updated to leverage the latest features and improvements of BehaviorTree.CPP version 4. These updates not only ensure compatibility with the latest behavior tree standards but also improve the documentation and setup instructions for users.

@robodrome
Copy link
Contributor Author

robodrome commented Feb 21, 2024

I think this PR is failing because the test workflow doesn't include behaviortree_cpp but the old behaviortree_cpp_v3. I expect that as soon ros2_planning_system is upgraded to use BT.CPP v4 see PlanSys2/ros2_planning_system#293 (comment) this PR will pass.

@fmrico
Copy link
Contributor

fmrico commented Feb 25, 2024

Thanks @robodrome

Merging!! 🚀

@fmrico fmrico merged commit 4c4fe95 into PlanSys2:rolling Feb 25, 2024
@robodrome robodrome deleted the btcpp4 branch February 25, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants