Skip to content

Commit

Permalink
MacOs (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
Scavanger committed Nov 10, 2024
1 parent ba6d201 commit ec60448
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion cmake/sitl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ if(NOT MACOSX)
endif()
else()
set(SITL_COMPILE_OPTIONS ${SITL_COMPILE_OPTIONS}
-Wno-error=double-promotion
)
endif()

Expand Down
10 changes: 5 additions & 5 deletions src/main/navigation/navigation_geozone.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ uint32_t geozoneGetDetectionDistance(void)
{
uint32_t detctionDistance = 0;
if (STATE(AIRPLANE)) {
detctionDistance = navConfig()->fw.loiter_radius * 1.5;
detctionDistance = navConfig()->fw.loiter_radius * 1.5f;
} else {
detctionDistance = geoZoneConfig()->copterFenceStopDistance;
}
Expand Down Expand Up @@ -1450,9 +1450,9 @@ void geozoneUpdate(timeUs_t curentTimeUs)
if (targetZone != NULL && !lockRTZ && (flyOutNfz || (!geozone.insideFz && targetZone->config.fenceAction != GEOFENCE_ACTION_NONE))) {
int32_t targetAltitude = 0;
if (getEstimatedActualPosition(Z) >= targetZone->config.maxAltitude - geoZoneConfig()->safeAltitudeDistance) {
targetAltitude = targetZone->config.maxAltitude - geoZoneConfig()->safeAltitudeDistance * 1.5;
targetAltitude = targetZone->config.maxAltitude - geoZoneConfig()->safeAltitudeDistance * 1.5f;
} else if (getEstimatedActualPosition(Z) <= targetZone->config.minAltitude + geoZoneConfig()->safeAltitudeDistance) {
targetAltitude = targetZone->config.minAltitude + geoZoneConfig()->safeAltitudeDistance * 1.5;
targetAltitude = targetZone->config.minAltitude + geoZoneConfig()->safeAltitudeDistance * 1.5f;
} else {
targetAltitude = getEstimatedActualPosition(Z);
}
Expand All @@ -1462,9 +1462,9 @@ void geozoneUpdate(timeUs_t curentTimeUs)
if (ABS(geozone.distanceVertToNearestZone) < 2000) {
calculateFarAwayTarget(&targetPos, posControl.actualState.cog, 100000);
if(geozone.distanceVertToNearestZone > 0) {
targetAltitude = getEstimatedActualPosition(Z) + ABS(geozone.distanceVertToNearestZone) + geoZoneConfig()->safeAltitudeDistance * 1.5;
targetAltitude = getEstimatedActualPosition(Z) + ABS(geozone.distanceVertToNearestZone) + geoZoneConfig()->safeAltitudeDistance * 1.5f;
} else {
targetAltitude = getEstimatedActualPosition(Z) - ABS(geozone.distanceVertToNearestZone) - geoZoneConfig()->safeAltitudeDistance * 1.5;
targetAltitude = getEstimatedActualPosition(Z) - ABS(geozone.distanceVertToNearestZone) - geoZoneConfig()->safeAltitudeDistance * 1.5f;
}

} else {
Expand Down
2 changes: 1 addition & 1 deletion src/main/navigation/navigation_geozone_calculations.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "common/vector.h"
#include "navigation/navigation_private.h"

#define K_EPSILON 1e-8
#define K_EPSILON 1e-8f

static bool isPointInCircle(const fpVector2_t *point, const fpVector2_t *center, const float radius)
{
Expand Down

0 comments on commit ec60448

Please sign in to comment.