This class uses the GenICam command "TimestampLatch" and the parameter "TimestampLatchValue" to determine the offset between the system clock and the camera clock. More...
#include <timestamp_corrector.h>
Public Member Functions | |
int64_t | correct (ros::Time &time) |
Correct the given camera timestamp to system time. More... | |
bool | determineOffset (const std::shared_ptr< GenApi::CNodeMapRef > &nodemap) |
Determine the offset between the system and camera clock. More... | |
void | setInterval (int64_t interval_ns) |
Set minimum time between determination of offset. More... | |
void | setMaximumTolerance (int64_t tol_ns) |
Set the maximum tolerance for the offset between system and camera clock. More... | |
TimestampCorrector () | |
~TimestampCorrector () | |
Private Attributes | |
int64_t | accuracy_ |
int64_t | interval_ |
int64_t | last_ |
int64_t | offset_ |
int64_t | tolerance_ |
This class uses the GenICam command "TimestampLatch" and the parameter "TimestampLatchValue" to determine the offset between the system clock and the camera clock.
Definition at line 49 of file timestamp_corrector.h.
rcgccam::TimestampCorrector::TimestampCorrector | ( | ) |
Definition at line 40 of file timestamp_corrector.cc.
rcgccam::TimestampCorrector::~TimestampCorrector | ( | ) |
Definition at line 51 of file timestamp_corrector.cc.
Correct the given camera timestamp to system time.
time | Timestamp to correct. |
Definition at line 135 of file timestamp_corrector.cc.
bool rcgccam::TimestampCorrector::determineOffset | ( | const std::shared_ptr< GenApi::CNodeMapRef > & | nodemap | ) |
Determine the offset between the system and camera clock.
This method should be called regularly, e.g. every second or minute.
This method does nothing if the last call to determineOffset() was successful and was called less than the interval time ago.
nodemap | Nodemap of the camera. |
Definition at line 76 of file timestamp_corrector.cc.
void rcgccam::TimestampCorrector::setInterval | ( | int64_t | interval_ns | ) |
Set minimum time between determination of offset.
interval_ns | Interval time in nano seconds, e.g. 1000000000 (= 1 s) |
Definition at line 60 of file timestamp_corrector.cc.
void rcgccam::TimestampCorrector::setMaximumTolerance | ( | int64_t | tol_ns | ) |
Set the maximum tolerance for the offset between system and camera clock.
NOTE: Setting this number negative disables correction.
tol_ns | Maximum tolerance in nano seconds, e.g. 10000000 (= 0.01 s) |
Definition at line 55 of file timestamp_corrector.cc.
|
private |
Definition at line 101 of file timestamp_corrector.h.
|
private |
Definition at line 97 of file timestamp_corrector.h.
|
private |
Definition at line 99 of file timestamp_corrector.h.
|
private |
Definition at line 102 of file timestamp_corrector.h.
|
private |
Definition at line 96 of file timestamp_corrector.h.