mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-21 15:25:29 +03:00
Add navigationGetHomeHeading()
Returns the heading for the home point, as recorded when home was stored. Note that it won't work properly on FW without a mag yet, since we'll need to adjust the value after we acquire a valid heading.
This commit is contained in:
parent
f8f31f3d33
commit
daec1b9aff
2 changed files with 13 additions and 0 deletions
|
@ -2713,6 +2713,12 @@ bool isNavLaunchEnabled(void)
|
|||
{
|
||||
return IS_RC_MODE_ACTIVE(BOXNAVLAUNCH) || feature(FEATURE_FW_LAUNCH);
|
||||
}
|
||||
|
||||
int32_t navigationGetHomeHeading(void)
|
||||
{
|
||||
return posControl.homePosition.yaw;
|
||||
}
|
||||
|
||||
#else // NAV
|
||||
|
||||
#ifdef USE_GPS
|
||||
|
|
|
@ -320,6 +320,12 @@ bool navigationRTHAllowsLanding(void);
|
|||
|
||||
bool isNavLaunchEnabled(void);
|
||||
|
||||
/* Returns the heading recorded when home position was acquired.
|
||||
* Note that the navigation system uses deg*100 as unit and angles
|
||||
* are in the [0, 360 * 100) interval.
|
||||
*/
|
||||
int32_t navigationGetHomeHeading(void);
|
||||
|
||||
/* Compatibility data */
|
||||
extern navSystemStatus_t NAV_Status;
|
||||
|
||||
|
@ -343,5 +349,6 @@ extern int16_t navAccNEU[3];
|
|||
#define getEstimatedActualVelocity(axis) (0)
|
||||
#define navigationIsControllingThrottle() (0)
|
||||
#define navigationRTHAllowsLanding() (0)
|
||||
#define navigationGetHomeHeading(0)
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue