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 SmartRTL test for rapid switch between smartrtl and alt… #27656

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Tools/autotest/arducopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9868,6 +9868,23 @@ def GPSForYaw(self):
if ex is not None:
raise ex

def SMART_RTL_EnterLeave(self):
'''check SmartRTL behaviour when entering/leaving'''
# we had a bug where we would consume points when re-entering smartrtl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Not that it matters too much because it's all in the past but the bug was that points would be lost if SmartRTL mode was exited before reaching home

Would it really "Cause a panic"? A panicking pilot perhaps but not a code execution panic I don't think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bug isn't in the past. This test is being merged disabled. It still causes SITL to panic.

I've pulled it out of #17419 so the test doesn't bitrot (which it had). I'll be rebasing the fix PR on top of master soon (it's a non-trivial rebase as it conflicts badly with the recent consumption-of-points fix we merged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, sorry. I assumed this was related to my recent fix but no, this is for that long standing bug. OK thanks!


self.upload_simple_relhome_mission([
# N E U
(mavutil.mavlink.MAV_CMD_NAV_TAKEOFF, 0, 0, 10),
(mavutil.mavlink.MAV_CMD_NAV_RETURN_TO_LAUNCH, 0, 0, 0),
])
self.set_parameter('AUTO_OPTIONS', 3)
self.change_mode('AUTO')
self.wait_ready_to_arm()
self.change_mode('ALT_HOLD')
self.change_mode('SMART_RTL')
self.change_mode('ALT_HOLD')
self.change_mode('SMART_RTL')

def GPSForYawCompassLearn(self):
'''Moving baseline GPS yaw - with compass learning'''
self.context_push()
Expand Down Expand Up @@ -11881,6 +11898,7 @@ def tests2b(self): # this block currently around 9.5mins here
self.GSF_reset,
self.AP_Avoidance,
self.SMART_RTL,
self.SMART_RTL_EnterLeave,
self.RTL_TO_RALLY,
self.FlyEachFrame,
self.GPSBlending,
Expand Down Expand Up @@ -12034,6 +12052,7 @@ def disabled_tests(self):
"FlyMissionTwice": "See https://github.com/ArduPilot/ardupilot/pull/18561",
"GPSForYawCompassLearn": "Vehicle currently crashed in spectacular fashion",
"CompassMot": "Cuases an arithmetic exception in the EKF",
"SMART_RTL_EnterLeave": "Causes a panic",
}


Expand Down
Loading