PX4/Avoidance - Why the algorithms are standalone?

Hi!

I’m completely new with PX4, so I’m very sorry if this question is duplicate or if it has already been answered somewhere, but I did not find any information myself. I’m planning to build a drone that would be able to fly autonomously through forests and after the mission land safely to unknown environment. For that reason I found PX4/Avoidance ROS node for obstacle detection and avoidance very interesting. However, all of the three algorithms of PX4/Avoidance are standalone and not meant to be used together. I wonder what’s the reason behind this? Is it just that nobody have not had time or interest to combine safe landing planner and local or global planner? Or would that be somehow difficult or otherwise “bad idea”?

Thank you in advance!

Hi,

Welcome to PX4!

Take a look at the code https://github.com/PX4/PX4-Avoidance. Both the local and the global planner listen to /mavros/trajectory/desired topics from the flight controller (via MAVROS) and then responds back after calculation to /mavros/trajectory/generated. There is no way to distinguish if the intention was to do local or global planning.

Although this is a fantastic implementation of using a companion computer to enhance the flight experience of a PX4 based drone, it is not a complete solution. If you want to build a drone as you envisage you would need both a local and a global planner as well as an intelligent lander (as offers by the PX4-Avoidance examples), but more importantly you would need a flight control node that executes the flight plan. Take-off, plan a path, fly the path with local obstacle avoidance, land, and very importantly deal with exceptions like if a no known path exists, or the local planner steers the drone into a “local maximum”.
To achieve your envisaged capability you would need to implement a complete navigation stack. (Take care though, the linked navigation stack is only 2D capable. Your drone would need 3D. It can be done though.)