Tweaking values of Smart Position #934

Tweaking values of Smart Position #934
1.2-legacy
Jm Casler 2021-11-26 21:26:36 -08:00
rodzic 3ec508169a
commit 88fd671880
1 zmienionych plików z 8 dodań i 5 usunięć

Wyświetl plik

@ -140,6 +140,8 @@ int32_t PositionPlugin::runOnce()
{
NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
// radioConfig.preferences.position_broadcast_smart = true;
// We limit our GPS broadcasts to a max rate
uint32_t now = millis();
if (lastGpsSend == 0 || now - lastGpsSend >= getPref_position_broadcast_secs() * 1000) {
@ -157,7 +159,6 @@ int32_t PositionPlugin::runOnce()
node->position.pos_timestamp, requestReplies);
sendOurPosition(NODENUM_BROADCAST, requestReplies);
} else if (radioConfig.preferences.position_broadcast_smart == true) {
// radioConfig.preferences.position_broadcast_smart
//NodeInfo *node = service.refreshMyNodeInfo(); // should guarantee there is now a position
if (node->has_position && (node->position.latitude_i != 0 || node->position.longitude_i != 0) ) {
@ -166,9 +167,11 @@ int32_t PositionPlugin::runOnce()
// Please don't change this value. This accomodates for possible poor positioning
// in the event the GPS has a poor satelite lock.
const uint8_t distanceTravel = 100;
const uint8_t distanceTravel = 150;
// Minimum time between position updates.
/* Minimum time between position updates.
Note: At an average walking speed of 3.5mph, it takes 90 seconds to travel 150 meters.
*/
const uint8_t timeTravel = 60;
// If the distance traveled since the last update is greater than 100 meters
@ -177,7 +180,7 @@ int32_t PositionPlugin::runOnce()
bool requestReplies = currentGeneration != radioGeneration;
currentGeneration = radioGeneration;
DEBUG_MSG("Sending pos@%x:6 to mesh (wantReplies=%d)\n",
DEBUG_MSG("Sending smart pos@%x:6 to mesh (wantReplies=%d)\n",
node->position.pos_timestamp, requestReplies);
sendOurPosition(NODENUM_BROADCAST, requestReplies);