mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
GCS/Telemetry Avoid bunching of periodic updates by spreading them.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@738 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
204f264a6e
commit
7ec7a5f207
@ -29,6 +29,8 @@
|
||||
#include "telemetry.h"
|
||||
#include "qxtlogger.h"
|
||||
#include <QTime>
|
||||
#include <QtGlobal>
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -112,7 +114,7 @@ void Telemetry::setUpdatePeriod(UAVObject* obj, qint32 periodMs)
|
||||
if ( objList[n].obj->getObjID() == obj->getObjID() )
|
||||
{
|
||||
objList[n].updatePeriodMs = periodMs;
|
||||
objList[n].timeToNextUpdateMs = 0;
|
||||
objList[n].timeToNextUpdateMs = quint32((float)periodMs * (float)qrand() / (float)RAND_MAX); // avoid bunching of updates
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user