diff --git a/extra/turn_slope_calculations.xlsx b/extra/turn_slope_calculations.xlsx index c8c2b16..86fd556 100644 Binary files a/extra/turn_slope_calculations.xlsx and b/extra/turn_slope_calculations.xlsx differ diff --git a/src/Lora_1W_APRS_Tracker.cpp b/src/Lora_1W_APRS_Tracker.cpp index 935114a..48b8ee0 100644 --- a/src/Lora_1W_APRS_Tracker.cpp +++ b/src/Lora_1W_APRS_Tracker.cpp @@ -152,7 +152,8 @@ void loop() { int MinimumDistanceTx = CurrentUser[6].toInt(); int MinimumTimeDeltaBeacon = CurrentUser[7].toInt(); int TurnMinDegrees = CurrentUser[8].toInt(); - int TurnSlope = CurrentUser[9].toInt(); + int TurnSlope = CurrentUser[9].toInt(); + int TurnMinAngle; currentHeading = gps.course.deg(); lastTxDistance = TinyGPSPlus::distanceBetween(gps.location.lat(), gps.location.lng(), lastTxLatitude, lastTxLongitude); @@ -165,7 +166,11 @@ void loop() { if (!send_update) { double headingDelta = abs(previousHeading - currentHeading); if (lastTx > MinimumTimeDeltaBeacon * 1000) { - int TurnMinAngle = TurnMinDegrees + (TurnSlope/CurrentSpeed); + if (CurrentSpeed == 0) { + TurnMinAngle = TurnMinDegrees + (TurnSlope/(CurrentSpeed + 1)); + } else { + TurnMinAngle = TurnMinDegrees + (TurnSlope/CurrentSpeed); + } if (headingDelta > TurnMinAngle && lastTxDistance > MinimumDistanceTx) { send_update = true; mensaje_test = "C:" + String(headingDelta) + " D:" + String(lastTxDistance) + " I:" + String(txInterval); diff --git a/src/beacon_config.h b/src/beacon_config.h index 50c557b..09149d4 100644 --- a/src/beacon_config.h +++ b/src/beacon_config.h @@ -1,7 +1,7 @@ #ifndef BEACON_CONFIG_H_ #define BEACON_CONFIG_H_ -#define FirstUser 3 // Select the First User at Tracker Start Up (Example: 1 means User1) +#define FirstUser 1 // Select the First User at Tracker Start Up (Example: 1 means User1) #define AprsPath "AP" // APRS Destination (could be also "WIDE1-1") #define AprsOverlay "/" #define SendAltitude true // "true" adds Altitude to the APRS packet/message, "false" add Course+Speed @@ -10,14 +10,14 @@ #define User1_Callsign "CD2RXU-7" #define User1_Symbol "[" // Runner -#define User1_SlowRate 120 -#define User1_SlowSpeed 3 -#define User1_FastRate 60 -#define User1_FastSpeed 15 -#define User1_MinDistTx 5 // debe ser 50 pero esta 5 por pruebas -#define User1_MinDeltaBcn 20 -#define User1_TurnMinDeg 3 -#define User1_TurnSlope 70 +#define User1_SlowRate 120 // seg +#define User1_SlowSpeed 3 // km/h +#define User1_FastRate 60 // seg +#define User1_FastSpeed 15 // km/h +#define User1_MinDistTx 5 // debe ser 100 pero esta 5 por pruebas +#define User1_MinDeltaBcn 20 // seg between beacon update +#define User1_TurnMinDeg 3 // degrees +#define User1_TurnSlope 40 // constant #define User2_Callsign "CD2RXU-8" #define User2_Symbol "b" // Bicycle @@ -25,10 +25,10 @@ #define User2_SlowSpeed 5 #define User2_FastRate 60 #define User2_FastSpeed 40 -#define User2_MinDistTx 70 +#define User2_MinDistTx 100 #define User2_MinDeltaBcn 12 -#define User2_TurnMinDeg 15 -#define User2_TurnSlope 70 +#define User2_TurnMinDeg 12 +#define User2_TurnSlope 60 #define User3_Callsign "CD2RXU-9" #define User3_Symbol ">" // Car @@ -38,7 +38,7 @@ #define User3_FastSpeed 70 #define User3_MinDistTx 100 #define User3_MinDeltaBcn 8 -#define User3_TurnMinDeg 12 +#define User3_TurnMinDeg 10 #define User3_TurnSlope 80 #endif \ No newline at end of file