class SoftwarePLL implements synchronisation between ticks and timestamp. See https://github.com/michael1309/SoftwarePLL/blob/master/README.md for details.
More...
#include <softwarePLL.h>
|
| double | AllowedTimeDeviation () const |
| |
| void | AllowedTimeDeviation (double val) |
| |
| bool | convSystemtimeToLidarTimestamp (uint32_t systemtime_sec, uint32_t systemtime_nanosec, uint32_t &tick) |
| |
| bool | convSystemtimeToLidarTimestamp (uint32_t systemtime_sec, uint32_t systemtime_nanosec, uint64_t &tick) |
| |
| double | extraPolateRelativeTimeStamp (uint64_t tick) |
| |
| uint32_t | ExtrapolationDivergenceCounter () const |
| |
| void | ExtrapolationDivergenceCounter (uint32_t val) |
| |
| int | findDiffInFifo (double diff, double tol) |
| |
| uint64_t | FirstTick () const |
| |
| void | FirstTick (uint64_t val) |
| |
| double | FirstTimeStamp () const |
| |
| void | FirstTimeStamp (double val) |
| |
| bool | getCorrectedTimeStamp (uint32_t &sec, uint32_t &nanoSec, uint32_t tick) |
| |
| bool | GetCorrectedTimeStamp (uint32_t &sec, uint32_t &nanoSec, uint32_t tick) |
| | Computes the timestamp of a measurement from sensor ticks. More...
|
| |
| bool | getCorrectedTimeStamp (uint32_t &sec, uint32_t &nanoSec, uint64_t tick) |
| |
| bool | getDemoFileData (std::string fileName, std::vector< uint32_t > &tickVec, std::vector< uint32_t > &secVec, std::vector< uint32_t > &nanoSecVec) |
| |
| double | InterpolationSlope () const |
| |
| void | InterpolationSlope (double val) |
| |
| bool | IsInitialized () const |
| |
| bool | IsInitialized () const |
| | Returns the initialization status, i.e. true, if SoftwarePLL is initialized, or false otherwise (inconsistent or not enough samples in the fifo buffer) More...
|
| |
| void | IsInitialized (bool val) |
| |
| bool | pushIntoFifo (double curTimeStamp, uint64_t curtick) |
| |
| void | setTicksToTimestampMode (int val) |
| |
| bool | UpdatePLL (uint32_t sec, uint32_t nanoSec, uint32_t curtick) |
| | Updates PLL internale State should be called only with network send timestamps. More...
|
| |
| bool | updatePLL (uint32_t sec, uint32_t nanoSec, uint32_t curtick) |
| |
| bool | updatePLL (uint32_t sec, uint32_t nanoSec, uint64_t curtick) |
| | Updates PLL internale State should be called only with network send timestamps. More...
|
| |
| | ~SoftwarePLL () |
| |
| | ~SoftwarePLL () |
| | Destructor of class SoftwarePLL. More...
|
| |
|
| double | AllowedTimeDeviation () const |
| | Returns the max. allowed time difference between estimated and measured timestamp time in seconds. More...
|
| |
| void | AllowedTimeDeviation (double val) |
| | Set the max. allowed time difference between estimated and measured receive timestamp in seconds. More...
|
| |
| double | ExtraPolateRelativeTimeStamp (uint32_t tick) |
| | Extrapolates and returns the measurement timestamp in seconds relative to FirstTimeStamp. The timestamp of a measurement in seconds can be estimated from sensor ticks by ExtraPolateRelativeTimeStamp(tick) + FirstTimeStamp(). More...
|
| |
| uint32_t | ExtrapolationDivergenceCounter () const |
| | Returns the counter of extrapolated divergences (number of times the estimated and measured receive timestamp differed more than AllowedTimeDeviation. More...
|
| |
| void | ExtrapolationDivergenceCounter (uint32_t val) |
| | Sets the counter of extrapolated divergences (number of times the estimated and measured receive timestamp differed more than AllowedTimeDeviation. More...
|
| |
| uint64_t | FirstTick () const |
| | Returns the first sensor tick in the fifo buffer. More...
|
| |
| void | FirstTick (uint64_t val) |
| | Sets the first sensor tick in the fifo buffer. More...
|
| |
| double | FirstTimeStamp () const |
| | Returns the first timestamp in the fifo buffer in seconds. More...
|
| |
| void | FirstTimeStamp (double val) |
| | Sets the first timestamp in the fifo buffer in seconds. More...
|
| |
| double | InterpolationSlope () const |
| | Returns the interpolated slope (gradient of the regression line) More...
|
| |
| void | InterpolationSlope (double val) |
| | Sets the interpolated slope (gradient of the regression line) More...
|
| |
| void | IsInitialized (bool val) |
| | Sets the initialization status, i.e. true, if SoftwarePLL is initialized, or false otherwise (inconsistent or not enough samples in the fifo buffer) More...
|
| |
| bool | PushIntoFifo (double curTimeStamp, uint32_t curtick) |
| | Pushes measurement timestamp and sensor ticks to the fifo, updates tick fifo and clock (timestamp) fifo. More...
|
| |
class SoftwarePLL implements synchronisation between ticks and timestamp. See https://github.com/michael1309/SoftwarePLL/blob/master/README.md for details.
Definition at line 21 of file softwarePLL.h.
◆ TICKS_TO_TIMESTAMP_MODE
| Enumerator |
|---|
| TICKS_TO_SYSTEM_TIMESTAMP | |
| TICKS_TO_MICROSEC_OFFSET_TIMESTAMP | |
| TICKS_TO_LIDAR_TIMESTAMP | |
Definition at line 131 of file softwarePLL.h.
◆ ~SoftwarePLL() [1/2]
| SoftwarePLL::~SoftwarePLL |
( |
| ) |
|
|
inline |
◆ SoftwarePLL() [1/4]
| SoftwarePLL::SoftwarePLL |
( |
| ) |
|
|
inlineprivate |
◆ SoftwarePLL() [2/4]
◆ ~SoftwarePLL() [2/2]
| SoftwarePLL::~SoftwarePLL |
( |
| ) |
|
◆ SoftwarePLL() [3/4]
| SoftwarePLL::SoftwarePLL |
( |
int |
fifo_length = 7 | ) |
|
|
inlineprivate |
◆ SoftwarePLL() [4/4]
◆ AllowedTimeDeviation() [1/4]
| double SoftwarePLL::AllowedTimeDeviation |
( |
| ) |
const |
|
inline |
◆ AllowedTimeDeviation() [2/4]
| double SoftwarePLL::AllowedTimeDeviation |
( |
| ) |
const |
|
inlineprotected |
Returns the max. allowed time difference between estimated and measured timestamp time in seconds.
- Returns
- allowed time difference between estimated and measured timestamp
Definition at line 126 of file SoftwarePLL.h.
◆ AllowedTimeDeviation() [3/4]
| void SoftwarePLL::AllowedTimeDeviation |
( |
double |
val | ) |
|
|
inline |
◆ AllowedTimeDeviation() [4/4]
| void SoftwarePLL::AllowedTimeDeviation |
( |
double |
val | ) |
|
|
inlineprotected |
Set the max. allowed time difference between estimated and measured receive timestamp in seconds.
- Parameters
-
| [in] | val | allowed time difference between estimated and measured timestamp |
Definition at line 133 of file SoftwarePLL.h.
◆ convSystemtimeToLidarTimestamp() [1/2]
| bool SoftwarePLL::convSystemtimeToLidarTimestamp |
( |
uint32_t |
systemtime_sec, |
|
|
uint32_t |
systemtime_nanosec, |
|
|
uint32_t & |
tick |
|
) |
| |
◆ convSystemtimeToLidarTimestamp() [2/2]
| bool SoftwarePLL::convSystemtimeToLidarTimestamp |
( |
uint32_t |
systemtime_sec, |
|
|
uint32_t |
systemtime_nanosec, |
|
|
uint64_t & |
tick |
|
) |
| |
◆ ExtraPolateRelativeTimeStamp()
| double SoftwarePLL::ExtraPolateRelativeTimeStamp |
( |
uint32_t |
tick | ) |
|
|
protected |
Extrapolates and returns the measurement timestamp in seconds relative to FirstTimeStamp. The timestamp of a measurement in seconds can be estimated from sensor ticks by ExtraPolateRelativeTimeStamp(tick) + FirstTimeStamp().
- Parameters
-
- Returns
- measurement timestamp in seconds relative to FirstTimeStamp
Definition at line 76 of file SoftwarePLL.cpp.
◆ extraPolateRelativeTimeStamp()
| double SoftwarePLL::extraPolateRelativeTimeStamp |
( |
uint64_t |
tick | ) |
|
◆ ExtrapolationDivergenceCounter() [1/4]
| uint32_t SoftwarePLL::ExtrapolationDivergenceCounter |
( |
| ) |
const |
|
inline |
◆ ExtrapolationDivergenceCounter() [2/4]
| uint32_t SoftwarePLL::ExtrapolationDivergenceCounter |
( |
| ) |
const |
|
inlineprotected |
Returns the counter of extrapolated divergences (number of times the estimated and measured receive timestamp differed more than AllowedTimeDeviation.
- Returns
- counter of extrapolated divergences
Definition at line 140 of file SoftwarePLL.h.
◆ ExtrapolationDivergenceCounter() [3/4]
| void SoftwarePLL::ExtrapolationDivergenceCounter |
( |
uint32_t |
val | ) |
|
|
inline |
◆ ExtrapolationDivergenceCounter() [4/4]
| void SoftwarePLL::ExtrapolationDivergenceCounter |
( |
uint32_t |
val | ) |
|
|
inlineprotected |
Sets the counter of extrapolated divergences (number of times the estimated and measured receive timestamp differed more than AllowedTimeDeviation.
- Parameters
-
| [in] | val | counter of extrapolated divergences |
Definition at line 147 of file SoftwarePLL.h.
◆ findDiffInFifo()
| int SoftwarePLL::findDiffInFifo |
( |
double |
diff, |
|
|
double |
tol |
|
) |
| |
◆ FirstTick() [1/4]
| uint64_t SoftwarePLL::FirstTick |
( |
| ) |
const |
|
inline |
◆ FirstTick() [2/4]
| uint64_t SoftwarePLL::FirstTick |
( |
| ) |
const |
|
inlineprotected |
Returns the first sensor tick in the fifo buffer.
- Returns
- first sensor tick
Definition at line 84 of file SoftwarePLL.h.
◆ FirstTick() [3/4]
| void SoftwarePLL::FirstTick |
( |
uint64_t |
val | ) |
|
|
inline |
◆ FirstTick() [4/4]
| void SoftwarePLL::FirstTick |
( |
uint64_t |
val | ) |
|
|
inlineprotected |
Sets the first sensor tick in the fifo buffer.
- Parameters
-
Definition at line 91 of file SoftwarePLL.h.
◆ FirstTimeStamp() [1/4]
| double SoftwarePLL::FirstTimeStamp |
( |
| ) |
const |
|
inline |
◆ FirstTimeStamp() [2/4]
| double SoftwarePLL::FirstTimeStamp |
( |
| ) |
const |
|
inlineprotected |
Returns the first timestamp in the fifo buffer in seconds.
- Returns
- first timestamp
Definition at line 98 of file SoftwarePLL.h.
◆ FirstTimeStamp() [3/4]
| void SoftwarePLL::FirstTimeStamp |
( |
double |
val | ) |
|
|
inline |
◆ FirstTimeStamp() [4/4]
| void SoftwarePLL::FirstTimeStamp |
( |
double |
val | ) |
|
|
inlineprotected |
Sets the first timestamp in the fifo buffer in seconds.
- Parameters
-
Definition at line 105 of file SoftwarePLL.h.
◆ getCorrectedTimeStamp() [1/2]
| bool SoftwarePLL::getCorrectedTimeStamp |
( |
uint32_t & |
sec, |
|
|
uint32_t & |
nanoSec, |
|
|
uint32_t |
tick |
|
) |
| |
◆ GetCorrectedTimeStamp()
| bool SoftwarePLL::GetCorrectedTimeStamp |
( |
uint32_t & |
sec, |
|
|
uint32_t & |
nanoSec, |
|
|
uint32_t |
tick |
|
) |
| |
Computes the timestamp of a measurement from sensor ticks.
- Parameters
-
| [out] | sec | Estimated system Timetamp (seconds) |
| [out] | nanoSec | Estimated system Timetamp (nanoseconds) |
| [in] | tick | sensor ticks |
- Returns
- true if timestamp is computed, false otherwise (SoftwarePLL not initialized)
Definition at line 142 of file SoftwarePLL.cpp.
◆ getCorrectedTimeStamp() [2/2]
| bool SoftwarePLL::getCorrectedTimeStamp |
( |
uint32_t & |
sec, |
|
|
uint32_t & |
nanoSec, |
|
|
uint64_t |
tick |
|
) |
| |
◆ getDemoFileData()
| bool SoftwarePLL::getDemoFileData |
( |
std::string |
fileName, |
|
|
std::vector< uint32_t > & |
tickVec, |
|
|
std::vector< uint32_t > & |
secVec, |
|
|
std::vector< uint32_t > & |
nanoSecVec |
|
) |
| |
◆ instance()
◆ Instance()
| SoftwarePLL & SoftwarePLL::Instance |
( |
const std::string & |
id = "", |
|
|
int |
fifo_length = 7 |
|
) |
| |
|
static |
Creates an instance of SoftwarePLL or returns an existing one, given its id.
- Parameters
-
| id | identifier of the instance, f.e. "Sensor1", "TIM571". |
| fifo_length | length of fifo (buffer size, i.e. number of ticks in fifo). Applied only for new instances of SoftwarePLL, existing instance will keep their buffer size. |
- Returns
- instance of a SoftwarePLL
Definition at line 32 of file SoftwarePLL.cpp.
◆ InterpolationSlope() [1/4]
| double SoftwarePLL::InterpolationSlope |
( |
| ) |
const |
|
inline |
◆ InterpolationSlope() [2/4]
| double SoftwarePLL::InterpolationSlope |
( |
| ) |
const |
|
inlineprotected |
Returns the interpolated slope (gradient of the regression line)
- Returns
- interpolated slope
Definition at line 112 of file SoftwarePLL.h.
◆ InterpolationSlope() [3/4]
| void SoftwarePLL::InterpolationSlope |
( |
double |
val | ) |
|
|
inline |
◆ InterpolationSlope() [4/4]
| void SoftwarePLL::InterpolationSlope |
( |
double |
val | ) |
|
|
inlineprotected |
Sets the interpolated slope (gradient of the regression line)
- Parameters
-
| [in] | val | interpolated slope |
Definition at line 119 of file SoftwarePLL.h.
◆ IsInitialized() [1/4]
| bool SoftwarePLL::IsInitialized |
( |
| ) |
const |
|
inline |
◆ IsInitialized() [2/4]
| bool SoftwarePLL::IsInitialized |
( |
| ) |
const |
|
inline |
Returns the initialization status, i.e. true, if SoftwarePLL is initialized, or false otherwise (inconsistent or not enough samples in the fifo buffer)
- Returns
- initialization status
Definition at line 68 of file SoftwarePLL.h.
◆ IsInitialized() [3/4]
| void SoftwarePLL::IsInitialized |
( |
bool |
val | ) |
|
|
inline |
◆ IsInitialized() [4/4]
| void SoftwarePLL::IsInitialized |
( |
bool |
val | ) |
|
|
inlineprotected |
Sets the initialization status, i.e. true, if SoftwarePLL is initialized, or false otherwise (inconsistent or not enough samples in the fifo buffer)
- Parameters
-
| [in] | val | initialization status |
Definition at line 77 of file SoftwarePLL.h.
◆ NearSameTimeStamp()
| bool SoftwarePLL::NearSameTimeStamp |
( |
double |
relTimeStamp1, |
|
|
double |
relTimeStamp2 |
|
) |
| |
|
private |
◆ nearSameTimeStamp()
| bool SoftwarePLL::nearSameTimeStamp |
( |
double |
relTimeStamp1, |
|
|
double |
relTimeStamp2, |
|
|
double & |
delta_time_abs |
|
) |
| |
|
private |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ PushIntoFifo()
| bool SoftwarePLL::PushIntoFifo |
( |
double |
curTimeStamp, |
|
|
uint32_t |
curtick |
|
) |
| |
|
protected |
Pushes measurement timestamp and sensor ticks to the fifo, updates tick fifo and clock (timestamp) fifo.
- Parameters
-
| curTimeStamp | measurement timestamp in seconds (receive time) |
| curtick | sensor ticks |
- Returns
- always true
Definition at line 55 of file SoftwarePLL.cpp.
◆ pushIntoFifo()
| bool SoftwarePLL::pushIntoFifo |
( |
double |
curTimeStamp, |
|
|
uint64_t |
curtick |
|
) |
| |
◆ setTicksToTimestampMode()
| void SoftwarePLL::setTicksToTimestampMode |
( |
int |
val | ) |
|
|
inline |
◆ testbed()
| void SoftwarePLL::testbed |
( |
| ) |
|
|
static |
◆ updateInterpolationSlope()
| bool SoftwarePLL::updateInterpolationSlope |
( |
| ) |
|
|
private |
◆ UpdateInterpolationSlope()
| bool SoftwarePLL::UpdateInterpolationSlope |
( |
| ) |
|
|
private |
◆ UpdatePLL()
| bool SoftwarePLL::UpdatePLL |
( |
uint32_t |
sec, |
|
|
uint32_t |
nanoSec, |
|
|
uint32_t |
curtick |
|
) |
| |
Updates PLL internale State should be called only with network send timestamps.
- Parameters
-
| [in] | sec | System Timetamp from received network packed |
| [in] | nanoSec | System Timestamp from received network packed |
| [in] | curtick | sensor ticks |
- Returns
- PLL is in valid state (true)
Definition at line 85 of file SoftwarePLL.cpp.
◆ updatePLL() [1/2]
| bool SoftwarePLL::updatePLL |
( |
uint32_t |
sec, |
|
|
uint32_t |
nanoSec, |
|
|
uint32_t |
curtick |
|
) |
| |
◆ updatePLL() [2/2]
| bool SoftwarePLL::updatePLL |
( |
uint32_t |
sec, |
|
|
uint32_t |
nanoSec, |
|
|
uint64_t |
curtick |
|
) |
| |
Updates PLL internale State should be called only with network send timestamps.
- Parameters
-
| sec | System Timetamp from received network packed |
| nsec | System Timestamp from received network packed |
| curtick | micro Seconds since scanner start from SOPAS Datagram |
- Returns
- PLL is in valid state (true)
Definition at line 125 of file softwarePLL.cpp.
◆ _instances
| std::map< std::string, SoftwarePLL * > SoftwarePLL::_instances |
|
staticprivate |
◆ allowedTimeDeviation
| double SoftwarePLL::allowedTimeDeviation |
|
private |
◆ AllowedTimeDeviation_
| double SoftwarePLL::AllowedTimeDeviation_ |
|
private |
◆ clockFifo
◆ ClockFifo_
| std::vector<double> SoftwarePLL::ClockFifo_ |
|
private |
◆ dClockDiffFeedBack
| double SoftwarePLL::dClockDiffFeedBack |
|
private |
◆ dTAvgFeedback
| double SoftwarePLL::dTAvgFeedback |
|
private |
◆ extrapolationDivergenceCounter
| uint32_t SoftwarePLL::extrapolationDivergenceCounter |
|
private |
◆ ExtrapolationDivergenceCounter_
| uint32_t SoftwarePLL::ExtrapolationDivergenceCounter_ |
|
private |
◆ fifoSize
| const int SoftwarePLL::fifoSize = 7 |
|
static |
◆ FifoSize_
| const int SoftwarePLL::FifoSize_ |
|
private |
◆ firstTick
| uint64_t SoftwarePLL::firstTick |
|
private |
◆ FirstTick_
| uint64_t SoftwarePLL::FirstTick_ |
|
private |
◆ firstTimeStamp
| double SoftwarePLL::firstTimeStamp |
|
private |
◆ FirstTimeStamp_
| double SoftwarePLL::FirstTimeStamp_ |
|
private |
◆ interpolationSlope
| double SoftwarePLL::interpolationSlope |
|
private |
◆ InterpolationSlope_
| double SoftwarePLL::InterpolationSlope_ |
|
private |
◆ isInitialized
| bool SoftwarePLL::isInitialized |
|
private |
◆ IsInitialized_
| bool SoftwarePLL::IsInitialized_ |
|
private |
◆ lastcurtick
| uint64_t SoftwarePLL::lastcurtick = 0 |
|
private |
◆ Lastcurtick_
| uint32_t SoftwarePLL::Lastcurtick_ = 0 |
|
private |
◆ lastValidTimeStamp
| double SoftwarePLL::lastValidTimeStamp |
|
private |
◆ max_abs_delta_time
| double SoftwarePLL::max_abs_delta_time = 0 |
◆ MaxAllowedTimeDeviation
| const double SoftwarePLL::MaxAllowedTimeDeviation = 0.1 |
|
staticprivate |
◆ MaxAllowedTimeDeviation_
| const double SoftwarePLL::MaxAllowedTimeDeviation_ = 0.1 |
|
staticprivate |
◆ MaxExtrapolationCounter
| const uint32_t SoftwarePLL::MaxExtrapolationCounter = 20 |
|
staticprivate |
◆ MaxExtrapolationCounter_
| const uint32_t SoftwarePLL::MaxExtrapolationCounter_ = 20 |
|
staticprivate |
◆ mostRecentNanoSec
| uint32_t SoftwarePLL::mostRecentNanoSec |
|
private |
◆ mostRecentSec
| uint32_t SoftwarePLL::mostRecentSec |
|
private |
◆ mostRecentTimeStamp
| double SoftwarePLL::mostRecentTimeStamp |
|
private |
◆ numberValInFifo
| int SoftwarePLL::numberValInFifo |
|
private |
◆ NumberValInFifo_
| int SoftwarePLL::NumberValInFifo_ |
|
private |
◆ offsetTimestampFirstLidarTick
| uint64_t SoftwarePLL::offsetTimestampFirstLidarTick = 0 |
|
private |
◆ offsetTimestampFirstSystemMicroSec
| uint32_t SoftwarePLL::offsetTimestampFirstSystemMicroSec = 0 |
|
private |
◆ offsetTimestampFirstSystemSec
| uint32_t SoftwarePLL::offsetTimestampFirstSystemSec = 0 |
|
private |
◆ packets_dropped
| size_t SoftwarePLL::packets_dropped = 0 |
◆ packets_received
| size_t SoftwarePLL::packets_received = 0 |
◆ tickFifo
| uint64_t SoftwarePLL::tickFifo[fifoSize] |
|
private |
◆ TickFifo_
| std::vector<uint32_t> SoftwarePLL::TickFifo_ |
|
private |
◆ ticksToTimestampMode
The documentation for this class was generated from the following files: