mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-24 08:45:31 +03:00
improve function definition
This commit is contained in:
parent
e7a894b294
commit
ff3cfdf704
4 changed files with 5 additions and 5 deletions
|
@ -3062,8 +3062,8 @@ bool isLastMissionWaypoint(void)
|
||||||
(posControl.waypointList[posControl.activeWaypointIndex].flag == NAV_WP_FLAG_LAST));
|
(posControl.waypointList[posControl.activeWaypointIndex].flag == NAV_WP_FLAG_LAST));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checks if approaching hold position requiring fixed wing circling loiter */
|
/* Checks if Nav hold position is active */
|
||||||
bool isApproachingHoldPosition(void)
|
bool isNavHoldPositionActive(void)
|
||||||
{
|
{
|
||||||
if (FLIGHT_MODE(NAV_WP_MODE)) { // WP mode last WP hold and Timed hold positions
|
if (FLIGHT_MODE(NAV_WP_MODE)) { // WP mode last WP hold and Timed hold positions
|
||||||
return isLastMissionWaypoint() || NAV_Status.state == MW_NAV_STATE_HOLD_TIMED;
|
return isLastMissionWaypoint() || NAV_Status.state == MW_NAV_STATE_HOLD_TIMED;
|
||||||
|
|
|
@ -277,7 +277,7 @@ static void calculateVirtualPositionTarget_FW(float trackingPeriod)
|
||||||
|
|
||||||
// If angular visibility of a waypoint is less than 30deg, don't calculate circular loiter, go straight to the target
|
// If angular visibility of a waypoint is less than 30deg, don't calculate circular loiter, go straight to the target
|
||||||
#define TAN_15DEG 0.26795f
|
#define TAN_15DEG 0.26795f
|
||||||
bool needToCalculateCircularLoiter = isApproachingHoldPosition() &&
|
bool needToCalculateCircularLoiter = isNavHoldPositionActive() &&
|
||||||
(distanceToActualTarget <= (navLoiterRadius / TAN_15DEG)) &&
|
(distanceToActualTarget <= (navLoiterRadius / TAN_15DEG)) &&
|
||||||
(distanceToActualTarget > 50.0f);
|
(distanceToActualTarget > 50.0f);
|
||||||
|
|
||||||
|
|
|
@ -446,7 +446,7 @@ static void updatePositionVelocityController_MC(const float maxSpeed)
|
||||||
*/
|
*/
|
||||||
if (
|
if (
|
||||||
(navGetCurrentStateFlags() & NAV_AUTO_WP &&
|
(navGetCurrentStateFlags() & NAV_AUTO_WP &&
|
||||||
!isApproachingHoldPosition() &&
|
!isNavHoldPositionActive() &&
|
||||||
newVelTotal < maxSpeed &&
|
newVelTotal < maxSpeed &&
|
||||||
!navConfig()->mc.slowDownForTurning
|
!navConfig()->mc.slowDownForTurning
|
||||||
) || newVelTotal > maxSpeed
|
) || newVelTotal > maxSpeed
|
||||||
|
|
|
@ -418,7 +418,7 @@ void updateClimbRateToAltitudeController(float desiredClimbRate, climbRateToAlti
|
||||||
|
|
||||||
bool isWaypointReached(const navWaypointPosition_t * waypoint, const bool isWaypointHome);
|
bool isWaypointReached(const navWaypointPosition_t * waypoint, const bool isWaypointHome);
|
||||||
bool isWaypointMissed(const navWaypointPosition_t * waypoint);
|
bool isWaypointMissed(const navWaypointPosition_t * waypoint);
|
||||||
bool isApproachingHoldPosition(void);
|
bool isNavHoldPositionActive(void);
|
||||||
bool isLastMissionWaypoint(void);
|
bool isLastMissionWaypoint(void);
|
||||||
float getActiveWaypointSpeed(void);
|
float getActiveWaypointSpeed(void);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue