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 test for GuidedModeThrust #26782

Merged
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
23 changes: 23 additions & 0 deletions Tools/autotest/arducopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10843,6 +10843,27 @@ def LoiterToGuidedHomeVSOrigin(self):
self.disarm_vehicle(force=True)
self.reboot_sitl() # to "unstick" home

def GuidedModeThrust(self):
'''test handling of option-bit-3, where mavlink commands are
intrepreted as thrust not climb rate'''
self.set_parameter('GUID_OPTIONS', 8)
self.change_mode('GUIDED')
self.wait_ready_to_arm()
self.arm_vehicle()
self.mav.mav.set_attitude_target_send(
0, # time_boot_ms
1, # target sysid
1, # target compid
0, # bitmask of things to ignore
mavextra.euler_to_quat([0, 0, 0]), # att
0, # roll rate (rad/s)
0, # pitch rate (rad/s)
0, # yaw rate (rad/s)
0.5
) # thrust, 0 to 1
self.wait_altitude(0.5, 100, relative=True, timeout=10)
self.do_RTL()

def tests2b(self): # this block currently around 9.5mins here
'''return list of all tests'''
ret = ([
Expand Down Expand Up @@ -10922,6 +10943,7 @@ def tests2b(self): # this block currently around 9.5mins here
self.GPSForYawCompassLearn,
self.CameraLogMessages,
self.LoiterToGuidedHomeVSOrigin,
self.GuidedModeThrust,
])
return ret

Expand Down Expand Up @@ -10952,6 +10974,7 @@ def disabled_tests(self):
"GroundEffectCompensation_touchDownExpected": "Flapping",
"FlyMissionTwice": "See https://github.com/ArduPilot/ardupilot/pull/18561",
"GPSForYawCompassLearn": "Vehicle currently crashed in spectacular fashion",
"GuidedModeThrust": "land detector raises internal error as we're not saying we're about to take off but just did",
}


Expand Down
Loading