-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Position publish disarmed attitude #13210
Conversation
Side note - if you name your branches with a |
Very good hint, I should adapt my naming scheme then 👍 |
67f514e
to
85a268d
Compare
I rebased since @sfuhrer is doing VTOL testing. I might be able to add this to the testing. |
@MaEtUgR testflown on a standard VTOL: https://review.px4.io/plot_app?log=0122c386-8af6-4a24-8bb2-36a23a00938e I had some airspeed measurement issues on the flight, can't image them to be related to this PR though. Beside that, everything functioned as it should (tested in STAB, ALT/POS, both MC and FW). |
@MaEtUgR second testflight: https://review.px4.io/plot_app?log=4db9ffd5-1e1d-4e37-96ba-5217dcd9683f |
I tested this PR on the tailsitter of the two motors, which solved the problem here: |
Yeah, I really want to get it in. I just didn't get through to do the offboard test. Passing the MAVSDK attitude offboard test should be enough and then it's ready to merge. |
85a268d
to
2858470
Compare
I successfully ran the MAVSDK offboard test on SITL: I realized one thing though: The warnings likely reveal another race condition between the flight stack modules. When GPS fusion starts and it switches to Hold there are the messages
These do not show on master since to flight task is running and therefore noone cares if the data is not even available in the first loop iteration after switching the mode. |
Indeed the commander switches to hold when global position is valid, the position controller starts the task, it expects valid triplets and doesn't find any so reports based on the check here: https://github.com/PX4/Firmware/blob/99a7491cdef655cefdd7aef66ea4a9ec97906db7/src/lib/flight_tasks/tasks/Auto/FlightTaskAuto.cpp#L139 The others are the fallback because there's no way to autonomously stay in air but there's also no RC connected in my example so it continues and ends up in the failsafe task for this one loop iteration where the data is missing. It's nothing caused by this pr and it's also not unsafe it's just not nice and gets revealed by the warnings. |
such that the controller always publishes attitude setpoints and there are no initialization issues.
since the position controller publishes them again already when disarmed.
2858470
to
af5e8e5
Compare
I rebased to be ready for merging again. The only conflict was the line https://github.com/PX4/Firmware/pull/12650/files#diff-81c4f50bdf837c4183b5d3cb81eb40eaL359-L360 close to my change was removed but it doesn't interfere. |
Updated again. Any reviews? |
Describe problem solved by this pull request
Smooth takeoff issues were only hotfixed but the root cause never solved.
These are all side effects of the position controller not running when disarmed.
This also has other negative side effects like:
Describe your solution
I start the flight task, run the position controller and publish the attitude setpoint as soon as the navigation state is set by the commander also when disarmed. In navigation states where no flight task is running the position controller is still not run and nothing published e.g. stabilized mode since #10805, offboard if the attitude setpoint is coming via MAVLink or when flying fixed wing.
Describe possible alternatives
What's still missing is that the Attitude controller can handle invalid setpoints e.g. timeouts, NAN values and so on.
Test data / coverage
SITL gazebo
Still open tests:
Flaps check using RC in multicopter altitude when disarmed(unsolved)Outdoor multicopter test with Stabilized and Altitude, Position, Takeoffs(covered by in depth VTOL multicopter mode tested)