1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-18 22:05:15 +03:00

WP mission Home WP option (#6920)

* Initial build

* Add new waypoint type FlyBy Home (FBH)

* Revert "Add new waypoint type FlyBy Home (FBH)"

This reverts commit a37dec5695.

* Remove FBH WP type, use Home flag instead

* Fixes
This commit is contained in:
breadoven 2021-06-13 14:07:45 +01:00 committed by GitHub
parent 940169cf82
commit 1b2d75dec7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 15 deletions

View file

@ -1460,7 +1460,7 @@ static void cliWaypoints(char *cmdline)
if (!(validArgumentCount == 6 || validArgumentCount == 8)) { if (!(validArgumentCount == 6 || validArgumentCount == 8)) {
cliShowParseError(); cliShowParseError();
} else if (!(action == 0 || action == NAV_WP_ACTION_WAYPOINT || action == NAV_WP_ACTION_RTH || action == NAV_WP_ACTION_JUMP || action == NAV_WP_ACTION_HOLD_TIME || action == NAV_WP_ACTION_LAND || action == NAV_WP_ACTION_SET_POI || action == NAV_WP_ACTION_SET_HEAD) || !(flag == 0 || flag == NAV_WP_FLAG_LAST)) { } else if (!(action == 0 || action == NAV_WP_ACTION_WAYPOINT || action == NAV_WP_ACTION_RTH || action == NAV_WP_ACTION_JUMP || action == NAV_WP_ACTION_HOLD_TIME || action == NAV_WP_ACTION_LAND || action == NAV_WP_ACTION_SET_POI || action == NAV_WP_ACTION_SET_HEAD) || !(flag == 0 || flag == NAV_WP_FLAG_LAST || flag == NAV_WP_FLAG_HOME)) {
cliShowParseError(); cliShowParseError();
} else { } else {
posControl.waypointList[i].action = action; posControl.waypointList[i].action = action;
@ -2930,28 +2930,28 @@ static void printImu2Status(void)
cliPrintLinef("Acc: %d", secondaryImuState.calibrationStatus.acc); cliPrintLinef("Acc: %d", secondaryImuState.calibrationStatus.acc);
cliPrintLinef("Mag: %d", secondaryImuState.calibrationStatus.mag); cliPrintLinef("Mag: %d", secondaryImuState.calibrationStatus.mag);
cliPrintLine("Calibration gains:"); cliPrintLine("Calibration gains:");
cliPrintLinef( cliPrintLinef(
"Gyro: %d %d %d", "Gyro: %d %d %d",
secondaryImuConfig()->calibrationOffsetGyro[X], secondaryImuConfig()->calibrationOffsetGyro[X],
secondaryImuConfig()->calibrationOffsetGyro[Y], secondaryImuConfig()->calibrationOffsetGyro[Y],
secondaryImuConfig()->calibrationOffsetGyro[Z] secondaryImuConfig()->calibrationOffsetGyro[Z]
); );
cliPrintLinef( cliPrintLinef(
"Acc: %d %d %d", "Acc: %d %d %d",
secondaryImuConfig()->calibrationOffsetAcc[X], secondaryImuConfig()->calibrationOffsetAcc[X],
secondaryImuConfig()->calibrationOffsetAcc[Y], secondaryImuConfig()->calibrationOffsetAcc[Y],
secondaryImuConfig()->calibrationOffsetAcc[Z] secondaryImuConfig()->calibrationOffsetAcc[Z]
); );
cliPrintLinef( cliPrintLinef(
"Mag: %d %d %d", "Mag: %d %d %d",
secondaryImuConfig()->calibrationOffsetMag[X], secondaryImuConfig()->calibrationOffsetMag[X],
secondaryImuConfig()->calibrationOffsetMag[Y], secondaryImuConfig()->calibrationOffsetMag[Y],
secondaryImuConfig()->calibrationOffsetMag[Z] secondaryImuConfig()->calibrationOffsetMag[Z]
); );
cliPrintLinef( cliPrintLinef(
"Radius: %d %d", "Radius: %d %d",
secondaryImuConfig()->calibrationRadiusAcc, secondaryImuConfig()->calibrationRadiusAcc,
secondaryImuConfig()->calibrationRadiusMag secondaryImuConfig()->calibrationRadiusMag
); );
} }

View file

@ -2933,8 +2933,15 @@ static void mapWaypointToLocalPosition(fpVector3_t * localPos, const navWaypoint
{ {
gpsLocation_t wpLLH; gpsLocation_t wpLLH;
wpLLH.lat = waypoint->lat; /* Default to home position if lat & lon = 0 or HOME flag set
wpLLH.lon = waypoint->lon; * Applicable to WAYPOINT, HOLD_TIME & LANDING WP types */
if ((waypoint->lat == 0 && waypoint->lon == 0) || waypoint->flag == NAV_WP_FLAG_HOME) {
wpLLH.lat = GPS_home.lat;
wpLLH.lon = GPS_home.lon;
} else {
wpLLH.lat = waypoint->lat;
wpLLH.lon = waypoint->lon;
}
wpLLH.alt = waypoint->alt; wpLLH.alt = waypoint->alt;
geoConvertGeodeticToLocal(localPos, &posControl.gpsOrigin, &wpLLH, altConv); geoConvertGeodeticToLocal(localPos, &posControl.gpsOrigin, &wpLLH, altConv);

View file

@ -306,6 +306,7 @@ typedef enum {
} navWaypointHeadings_e; } navWaypointHeadings_e;
typedef enum { typedef enum {
NAV_WP_FLAG_HOME = 0x48,
NAV_WP_FLAG_LAST = 0xA5 NAV_WP_FLAG_LAST = 0xA5
} navWaypointFlags_e; } navWaypointFlags_e;