1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-17 13:25:27 +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

@ -2933,8 +2933,15 @@ static void mapWaypointToLocalPosition(fpVector3_t * localPos, const navWaypoint
{
gpsLocation_t wpLLH;
wpLLH.lat = waypoint->lat;
wpLLH.lon = waypoint->lon;
/* Default to home position if lat & lon = 0 or HOME flag set
* 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;
geoConvertGeodeticToLocal(localPos, &posControl.gpsOrigin, &wpLLH, altConv);