Skip to content

Commit 18f5e76

Browse files
committed
LP-598 Fix auto-takeoff velocity
Velocity setpoint with the wrong sign, causing the uav to remain on the ground during the first autotakeoff.
1 parent a4c0bcf commit 18f5e76

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

flight/modules/PathFollower/vtolautotakeoffcontroller.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,19 @@ void VtolAutoTakeoffController::ObjectiveUpdated(void)
132132
if (mOverride) {
133133
// override pathDesired from PathPlanner with current position,
134134
// as we deliberately don't care about the location of the waypoints on the map
135-
float velocity_down;
135+
float autotakeoff_velocity;
136136
float autotakeoff_height;
137137
PositionStateData positionState;
138138
PositionStateGet(&positionState);
139-
FlightModeSettingsAutoTakeOffVelocityGet(&velocity_down);
139+
FlightModeSettingsAutoTakeOffVelocityGet(&autotakeoff_velocity);
140140
FlightModeSettingsAutoTakeOffHeightGet(&autotakeoff_height);
141141
autotakeoff_height = fabsf(autotakeoff_height);
142142
if (autotakeoff_height < AUTOTAKEOFF_TO_INCREMENTAL_HEIGHT_MIN) {
143143
autotakeoff_height = AUTOTAKEOFF_TO_INCREMENTAL_HEIGHT_MIN;
144144
} else if (autotakeoff_height > AUTOTAKEOFF_TO_INCREMENTAL_HEIGHT_MAX) {
145145
autotakeoff_height = AUTOTAKEOFF_TO_INCREMENTAL_HEIGHT_MAX;
146146
}
147-
controlDown.UpdateVelocitySetpoint(velocity_down);
147+
controlDown.UpdateVelocitySetpoint(-autotakeoff_velocity);
148148
controlNE.UpdateVelocitySetpoint(0.0f, 0.0f);
149149
controlNE.UpdatePositionSetpoint(positionState.North, positionState.East);
150150

@@ -320,9 +320,9 @@ void VtolAutoTakeoffController::UpdateAutoPilot()
320320
// 1. Arming must be done whilst in the AutoTakeOff flight mode
321321
// 2. If the AutoTakeoff flight mode is selected and already armed, requires disarming first
322322
// 3. Wait for armed state
323-
// 4. Once the user increases the throttle position to above 50%, then and only then initiate auto-takeoff.
324-
// 5. Whilst the throttle is < 50% before takeoff, all stick inputs are being ignored.
325-
// 6. If during the autotakeoff sequence, at any stage, if the throttle stick position reduces to less than 10%, landing is initiated.
323+
// 4. Once the user increases the throttle position to above 30%, then and only then initiate auto-takeoff.
324+
// 5. Whilst the throttle is < 30% before takeoff, all stick inputs are being ignored.
325+
// 6. If during the autotakeoff sequence, at any stage, the throttle stick position reduces to less than 10%, landing is initiated.
326326

327327
switch (autotakeoffState) {
328328
case STATUSVTOLAUTOTAKEOFF_CONTROLSTATE_REQUIREUNARMEDFIRST:

0 commit comments

Comments
 (0)