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

[BACKPORT] 1.10: Do not overwrite landing gear state #13412

Merged
merged 2 commits into from
Nov 7, 2019
Merged
Changes from 1 commit
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
Next Next commit
Reposition landing gear check so that it is not overwritten by setpoi…
…nt operations.

[SQUASH ME] trivial style fix
mwiatt authored and MaEtUgR committed Nov 7, 2019

Verified

This commit was signed with the committer’s verified signature.
commit 4d7d3adadda6005fb7be590209740167ab97f6ed
12 changes: 6 additions & 6 deletions src/lib/FlightTasks/tasks/AutoMapper/FlightTaskAutoMapper.cpp
Original file line number Diff line number Diff line change
@@ -70,6 +70,12 @@ bool FlightTaskAutoMapper::update()
_thrust_setpoint = Vector3f(NAN, NAN, NAN);
}

// during mission and reposition, raise the landing gears but only
// if altitude is high enough
if (_highEnoughForLandingGear()) {
_gear.landing_gear = _mission_gear;
}

if (_type == WaypointType::idle) {
_generateIdleSetpoints();

@@ -92,12 +98,6 @@ bool FlightTaskAutoMapper::update()
_yawspeed_setpoint);
}

// during mission and reposition, raise the landing gears but only
// if altitude is high enough
if (_highEnoughForLandingGear()) {
_gear.landing_gear = _mission_gear;
}

// update previous type
_type_previous = _type;

12 changes: 6 additions & 6 deletions src/lib/FlightTasks/tasks/AutoMapper2/FlightTaskAutoMapper2.cpp
Original file line number Diff line number Diff line change
@@ -62,6 +62,12 @@ bool FlightTaskAutoMapper2::update()
_thrust_setpoint = Vector3f(NAN, NAN, NAN);
}

// during mission and reposition, raise the landing gears but only
// if altitude is high enough
if (_highEnoughForLandingGear()) {
_gear.landing_gear = landing_gear_s::GEAR_UP;
}

switch (_type) {
case WaypointType::idle:
_prepareIdleSetpoints();
@@ -100,12 +106,6 @@ bool FlightTaskAutoMapper2::update()

_generateSetpoints();

// during mission and reposition, raise the landing gears but only
// if altitude is high enough
if (_highEnoughForLandingGear()) {
_gear.landing_gear = landing_gear_s::GEAR_UP;
}

// update previous type
_type_previous = _type;