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

autotest: add a test for switching to auto with low speed and alt #27483

Closed

Conversation

peterbarker
Copy link
Contributor

SITL/autotest reproduction of something which happened in a real flight.

After switching to auto, TECS doesn't seem to get updated, throttle goes to zero, vehicle flies into ground (or close to it, in the real flight).

image

Note the messages includes "holding course", but never "Takeoff level-off starting at". That's because relative_alt_cm is below 1000cm. That's unlikely to change if our throttle is zero and we're below that value to start with.

We are suppressing throttle because we are below 5m-rel-alt:
image

@tridge
Copy link
Contributor

tridge commented Jul 8, 2024

@peterbarker ok, so it is the throttle suppression heuristics?

@peterbarker
Copy link
Contributor Author

@peterbarker ok, so it is the throttle suppression heuristics?

Yes, it appeared so in my debugging session.

I modified the test:

diff --git a/Tools/autotest/arduplane.py b/Tools/autotest/arduplane.py
index d8b22a8383f..8b94c218385 100644
--- a/Tools/autotest/arduplane.py
+++ b/Tools/autotest/arduplane.py
@@ -5447,6 +5447,8 @@ class AutoTestPlane(vehicle_test_suite.TestSuite):
         self.takeoff_in_FBWA(3, throttle=1450)
         self.set_rc(3, 1200)
         self.change_mode('AUTO')
+        self.delay_sim_time(0.5)
+        self.send_debug_trap()
         self.wait_current_waypoint(3)
         self.fly_home_land_and_disarm()

and ran the simulation

./Tools/autotest/autotest.py --gdb --debug test.Plane.AutoTakeoffWhileFlying  --disable-break -B Plane::suppress_throttle

... then in gdb

ena
c

to start walking through the relevant code.

@tridge
Copy link
Contributor

tridge commented Jul 9, 2024

we've decided a FLIGHT_OPTIONS bit to disable the suppression code would be worthwhile

@peterbarker peterbarker closed this Jul 9, 2024
@peterbarker peterbarker deleted the pr/take-off-in-auto-bug branch July 9, 2024 01:55
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.

None yet

3 participants