mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 09:45:33 +03:00
Drop NAV_BLACKBOX define
This commit is contained in:
parent
1ee5ed366e
commit
2e84ca62c5
5 changed files with 8 additions and 36 deletions
|
@ -199,7 +199,7 @@ navigationPosControl_t posControl;
|
|||
navSystemStatus_t NAV_Status;
|
||||
EXTENDED_FASTRAM multicopterPosXyCoefficients_t multicopterPosXyCoefficients;
|
||||
|
||||
#if defined(NAV_BLACKBOX)
|
||||
// Blackbox states
|
||||
int16_t navCurrentState;
|
||||
int16_t navActualVelocity[3];
|
||||
int16_t navDesiredVelocity[3];
|
||||
|
@ -212,7 +212,7 @@ uint16_t navFlags;
|
|||
uint16_t navEPH;
|
||||
uint16_t navEPV;
|
||||
int16_t navAccNEU[3];
|
||||
#endif
|
||||
//End of blackbox states
|
||||
|
||||
static fpVector3_t * rthGetHomeTargetPosition(rthTargetMode_e mode);
|
||||
static void updateDesiredRTHAltitude(void);
|
||||
|
@ -1950,12 +1950,11 @@ void updateActualHorizontalPositionAndVelocity(bool estPosValid, bool estVelVali
|
|||
posControl.flags.horizontalPositionDataNew = 0;
|
||||
}
|
||||
|
||||
#if defined(NAV_BLACKBOX)
|
||||
//Update blackbox data
|
||||
navLatestActualPosition[X] = newX;
|
||||
navLatestActualPosition[Y] = newY;
|
||||
navActualVelocity[X] = constrain(newVelX, -32678, 32767);
|
||||
navActualVelocity[Y] = constrain(newVelY, -32678, 32767);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
|
@ -2005,10 +2004,9 @@ void updateActualAltitudeAndClimbRate(bool estimateValid, float newAltitude, flo
|
|||
posControl.actualState.surfaceMin = -1;
|
||||
}
|
||||
|
||||
#if defined(NAV_BLACKBOX)
|
||||
//Update blackbox data
|
||||
navLatestActualPosition[Z] = navGetCurrentActualPositionAndVelocity()->pos.z;
|
||||
navActualVelocity[Z] = constrain(navGetCurrentActualPositionAndVelocity()->vel.z, -32678, 32767);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
|
@ -3066,7 +3064,7 @@ void applyWaypointNavigationAndAltitudeHold(void)
|
|||
{
|
||||
const timeUs_t currentTimeUs = micros();
|
||||
|
||||
#if defined(NAV_BLACKBOX)
|
||||
//Updata blackbox data
|
||||
navFlags = 0;
|
||||
if (posControl.flags.estAltStatus == EST_TRUSTED) navFlags |= (1 << 0);
|
||||
if (posControl.flags.estAglStatus == EST_TRUSTED) navFlags |= (1 << 1);
|
||||
|
@ -3076,7 +3074,6 @@ void applyWaypointNavigationAndAltitudeHold(void)
|
|||
if (isGPSGlitchDetected()) navFlags |= (1 << 4);
|
||||
#endif
|
||||
if (posControl.flags.estHeadingStatus == EST_TRUSTED) navFlags |= (1 << 5);
|
||||
#endif
|
||||
|
||||
// Reset all navigation requests - NAV controllers will set them if necessary
|
||||
DISABLE_STATE(NAV_MOTOR_STOP_OR_IDLE);
|
||||
|
@ -3110,8 +3107,7 @@ void applyWaypointNavigationAndAltitudeHold(void)
|
|||
if (posControl.flags.verticalPositionDataConsumed)
|
||||
posControl.flags.verticalPositionDataNew = 0;
|
||||
|
||||
|
||||
#if defined(NAV_BLACKBOX)
|
||||
//Update blackbox data
|
||||
if (posControl.flags.isAdjustingPosition) navFlags |= (1 << 6);
|
||||
if (posControl.flags.isAdjustingAltitude) navFlags |= (1 << 7);
|
||||
if (posControl.flags.isAdjustingHeading) navFlags |= (1 << 8);
|
||||
|
@ -3119,7 +3115,6 @@ void applyWaypointNavigationAndAltitudeHold(void)
|
|||
navTargetPosition[X] = lrintf(posControl.desiredState.pos.x);
|
||||
navTargetPosition[Y] = lrintf(posControl.desiredState.pos.y);
|
||||
navTargetPosition[Z] = lrintf(posControl.desiredState.pos.z);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
|
@ -3463,9 +3458,8 @@ void updateWaypointsAndNavigationMode(void)
|
|||
// Map navMode back to enabled flight modes
|
||||
switchNavigationFlightModes();
|
||||
|
||||
#if defined(NAV_BLACKBOX)
|
||||
//Update Blackbox data
|
||||
navCurrentState = (int16_t)posControl.navPersistentId;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue