Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Integrating Behavior Trees with ArduPilot-ROS #33

Open
snktshrma opened this issue Nov 25, 2024 · 3 comments
Open

Proposal: Integrating Behavior Trees with ArduPilot-ROS #33

snktshrma opened this issue Nov 25, 2024 · 3 comments

Comments

@snktshrma
Copy link

Hi there,
This proposal outlines the plan to introduce Behavior Tree (BT) support to ArduPilot using ROS2 AP-DDS interface. @Ryanf55 suggested this framework to allow users to have a modular and flexible interface. This is inspired by how Nav2 in ROS 2 uses BTs to handle planning, failsafes, and advanced integrations.

Overview

The idea is to use BTs to manage tasks like planning, failsafes, and mission execution in a more intuitive way. This would also simplify integrating advanced features like SLAM modules, depth estimators, external planners and even external systems like Nav2. It will also make it easy to allow users integrate existing features like cartographer SLAM to their systems and have flexible control over the system. Users would benefit from a drag-and-drop approach to behavior design, using tools like Groot to build and debug BTs visually.

Here’s the rough plan:

  • Start with some groundwork; explore BehaviorTree.CPP or similar libraries and experiment with a basic integration and controlling the vehicle.
  • Create BT nodes for common ArduPilot tasks like waypoints, failsafe triggers, or high-level planning.
  • Integrate with Groot so users can visually design and debug trees.
  • Test with real-world scenarios (e.g., mission planning or obstacle avoidance, etc).

This is just the starting point, and I'm happy to refine or adjust the plan based on feedback.

Looking forward to your feedbacks!

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Nov 25, 2024

Looks like a good start. It would be great if you could find other open source examples of behavior trees in use beyond nav2 so we can compare to!

@snktshrma
Copy link
Author

Hi! I’ve had some time to work further on this and have implemented some boilerplate scripts and base-level functionality in the ardupilot_bt repo.

I attempted to make a PR, but the repository needs restructuring to accommodate multiple packages, such as one for Cartographer, one for behavior trees, etc., under ardupilot_ros.

Additionally, we need better DDS support to incorporate topics and services for features like vehicle state (armed, mode, etc.), similar to what MAVROS offers.

For the next steps, I’ll work on adding more interfaces and topics/services to AP_DDS, specifically targeted towards behavior tree support.

I’d really appreciate your suggestions, @Ryanf55.

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Dec 27, 2024

Nice!

A PR to restructure would be fine using git mv so we can add new packages. ardupilot_ros can be a metapackage that depends on all the others. Start with that and then we can pull in your bt work?

All the things you listed are already supported.

You can also arm with the ArmMotors.srv and change modes with the ModeSwitch.srv

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

No branches or pull requests

2 participants