-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
Plane: fixed takeoff direction with no yaw source #28730
Open
tridge
wants to merge
2
commits into
ArduPilot:master
Choose a base branch
from
tridge:pr-takeoff-direction-fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
import math | ||
import os | ||
import signal | ||
import copy | ||
|
||
from pymavlink import quaternion | ||
from pymavlink import mavutil | ||
|
@@ -4804,6 +4805,40 @@ def TakeoffTakeoff4(self): | |
|
||
self.fly_home_land_and_disarm() | ||
|
||
def TakeoffTakeoff5(self): | ||
'''Test the behaviour of a takeoff with no compass''' | ||
self.set_parameters({ | ||
"COMPASS_USE": 0, | ||
"COMPASS_USE2": 0, | ||
"COMPASS_USE3": 0, | ||
}) | ||
start_loc = copy.copy(SITL_START_LOCATION) | ||
start_loc.heading = 175 | ||
self.customise_SITL_commandline(["--home=%.9f,%.9f,%.2f,%.1f" % ( | ||
start_loc.lat, start_loc.lng, start_loc.alt, start_loc.heading)]) | ||
self.reboot_sitl() | ||
self.change_mode("TAKEOFF") | ||
|
||
# waiting for the EKF to be happy won't work | ||
self.delay_sim_time(20) | ||
self.arm_vehicle() | ||
|
||
target_alt = self.get_parameter("TKOFF_ALT") | ||
self.wait_altitude(target_alt-5, target_alt, relative=True) | ||
|
||
# Wait a bit for the Takeoff altitude to settle. | ||
self.delay_sim_time(5) | ||
|
||
bearing_margin = 35 | ||
loc = self.mav.location() | ||
bearing_from_home = self.get_bearing(start_loc, loc) | ||
if bearing_from_home < 0: | ||
bearing_from_home += 360 | ||
if abs(bearing_from_home - start_loc.heading) > bearing_margin: | ||
raise NotAchievedException(f"Did not takeoff in the right direction {bearing_from_home}") | ||
|
||
self.fly_home_land_and_disarm() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the test is only about the takeoff, does it make sense to not wait for the landing, but end the test early here? This would alleviate the test server a bit. |
||
|
||
def TakeoffGround(self): | ||
'''Test a rolling TAKEOFF.''' | ||
|
||
|
@@ -6416,6 +6451,7 @@ def tests1b(self): | |
self.TakeoffTakeoff2, | ||
self.TakeoffTakeoff3, | ||
self.TakeoffTakeoff4, | ||
self.TakeoffTakeoff5, | ||
self.TakeoffGround, | ||
self.TakeoffIdleThrottle, | ||
self.ForcedDCM, | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So basically you will not allow the heading to "lock-in" until some groundspeed is gained, deeming the heading valid.
Sounds reasonable.