1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-24 00:35:34 +03:00

make navTargetPos int32_t to allow logging of altitudes higher than 327m

This commit is contained in:
giacomo892 2018-07-16 11:01:03 +02:00
parent 1c06b30bde
commit 440514087b
3 changed files with 6 additions and 6 deletions

View file

@ -419,7 +419,7 @@ typedef struct blackboxMainState_s {
int16_t navRealVel[XYZ_AXIS_COUNT]; int16_t navRealVel[XYZ_AXIS_COUNT];
int16_t navAccNEU[XYZ_AXIS_COUNT]; int16_t navAccNEU[XYZ_AXIS_COUNT];
int16_t navTargetVel[XYZ_AXIS_COUNT]; int16_t navTargetVel[XYZ_AXIS_COUNT];
int16_t navTargetPos[XYZ_AXIS_COUNT]; int32_t navTargetPos[XYZ_AXIS_COUNT];
int16_t navHeading; int16_t navHeading;
int16_t navTargetHeading; int16_t navTargetHeading;
int16_t navSurface; int16_t navSurface;

View file

@ -163,7 +163,7 @@ int16_t navActualVelocity[3];
int16_t navDesiredVelocity[3]; int16_t navDesiredVelocity[3];
int16_t navActualHeading; int16_t navActualHeading;
int16_t navDesiredHeading; int16_t navDesiredHeading;
int16_t navTargetPosition[3]; int32_t navTargetPosition[3];
int32_t navLatestActualPosition[3]; int32_t navLatestActualPosition[3];
int16_t navActualSurface; int16_t navActualSurface;
uint16_t navFlags; uint16_t navFlags;
@ -2644,9 +2644,9 @@ void applyWaypointNavigationAndAltitudeHold(void)
if (posControl.flags.isAdjustingAltitude) navFlags |= (1 << 7); if (posControl.flags.isAdjustingAltitude) navFlags |= (1 << 7);
if (posControl.flags.isAdjustingHeading) navFlags |= (1 << 8); if (posControl.flags.isAdjustingHeading) navFlags |= (1 << 8);
navTargetPosition[X] = constrain(lrintf(posControl.desiredState.pos.x), -32678, 32767); navTargetPosition[X] = lrintf(posControl.desiredState.pos.x);
navTargetPosition[Y] = constrain(lrintf(posControl.desiredState.pos.y), -32678, 32767); navTargetPosition[Y] = lrintf(posControl.desiredState.pos.y);
navTargetPosition[Z] = constrain(lrintf(posControl.desiredState.pos.z), -32678, 32767); navTargetPosition[Z] = lrintf(posControl.desiredState.pos.z);
#endif #endif
} }

View file

@ -413,7 +413,7 @@ extern navSystemStatus_t NAV_Status;
extern int16_t navCurrentState; extern int16_t navCurrentState;
extern int16_t navActualVelocity[3]; extern int16_t navActualVelocity[3];
extern int16_t navDesiredVelocity[3]; extern int16_t navDesiredVelocity[3];
extern int16_t navTargetPosition[3]; extern int32_t navTargetPosition[3];
extern int32_t navLatestActualPosition[3]; extern int32_t navLatestActualPosition[3];
extern int16_t navActualSurface; extern int16_t navActualSurface;
extern uint16_t navFlags; extern uint16_t navFlags;