diff --git a/flight/Modules/Guidance/guidance.c b/flight/Modules/Guidance/guidance.c index 45acc68c9..0749b10a6 100644 --- a/flight/Modules/Guidance/guidance.c +++ b/flight/Modules/Guidance/guidance.c @@ -390,7 +390,7 @@ static void updateVtolDesiredAttitude() StabilizationSettingsGet(&stabSettings); NedAccelGet(&nedAccel); - float northVel, eastVel, downVel; + float northVel = 0, eastVel = 0, downVel = 0; switch (guidanceSettings.VelocitySource) { case GUIDANCESETTINGS_VELOCITYSOURCE_EKF: northVel = velocityActual.North; @@ -414,6 +414,7 @@ static void updateVtolDesiredAttitude() downVel = velocityActual.Down; } default: + PIOS_Assert(0); break; }