I have started recently (since a couple of months) to work with PX4, and would appreciate if some of the more knowledgeable and experienced than me PX4 developers would care to comment on my approach. If it seems feasible, or there are other avenues which have escaped me.
I am looking to control a fixed-wing aircraft using off-board mode through MAVROS. My end goal is to be able to set a desired altitude set-point for the aircraft, while being able to control the airspeed and heading (or heading rate).
From my research into the PX4 docs, there are essentially only two ways to control the aircraft in off-board mode (doc). One is to send position set-points (either local or global); the other to send attitude set-points. The former does not seem suitable to achieve my goal, so it seems to me that I have to go with the latter.
This being said, in the fixed-wing controller diagrams (doc), there is the total energy control system (TECS), which does not seem to be accessible from off-board control, but which seems to be a step to what I am after. I was thinking of trying to integrate this library into my off-board control code, but after reading the code (dir) I am unsure if this library is independent enough of the rest of the PX4 to be moved in this manner. For starters, I was not able to figure out where the airspeed and altitude set-points go into the code. Is the code so entrenched with the rest of PX4 that it would be better to implement the TECS from scratch in the off-board code.
Thank you for taking time to read my query. Your help is invaluable to me.