Public Member Functions | Private Attributes | List of all members
rcgccam::TimestampCorrector Class Reference

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_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TimestampCorrector()

rcgccam::TimestampCorrector::TimestampCorrector ( )

Definition at line 40 of file timestamp_corrector.cc.

◆ ~TimestampCorrector()

rcgccam::TimestampCorrector::~TimestampCorrector ( )

Definition at line 51 of file timestamp_corrector.cc.

Member Function Documentation

◆ correct()

int64_t rcgccam::TimestampCorrector::correct ( ros::Time time)

Correct the given camera timestamp to system time.

Parameters
timeTimestamp to correct.
Returns
Accuracy of correction in nano seconds, which must be at most the specified maximum tolerance. < 0 is returned in case determineOffset() has never been called or if it delivered an error on the last call.

Definition at line 135 of file timestamp_corrector.cc.

◆ determineOffset()

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.

Parameters
nodemapNodemap of the camera.
Returns
False if determination of offset cannot be determined with less than the maximum tolerance.

Definition at line 76 of file timestamp_corrector.cc.

◆ setInterval()

void rcgccam::TimestampCorrector::setInterval ( int64_t  interval_ns)

Set minimum time between determination of offset.

Parameters
interval_nsInterval time in nano seconds, e.g. 1000000000 (= 1 s)

Definition at line 60 of file timestamp_corrector.cc.

◆ setMaximumTolerance()

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.

Parameters
tol_nsMaximum tolerance in nano seconds, e.g. 10000000 (= 0.01 s)

Definition at line 55 of file timestamp_corrector.cc.

Member Data Documentation

◆ accuracy_

int64_t rcgccam::TimestampCorrector::accuracy_
private

Definition at line 101 of file timestamp_corrector.h.

◆ interval_

int64_t rcgccam::TimestampCorrector::interval_
private

Definition at line 97 of file timestamp_corrector.h.

◆ last_

int64_t rcgccam::TimestampCorrector::last_
private

Definition at line 99 of file timestamp_corrector.h.

◆ offset_

int64_t rcgccam::TimestampCorrector::offset_
private

Definition at line 102 of file timestamp_corrector.h.

◆ tolerance_

int64_t rcgccam::TimestampCorrector::tolerance_
private

Definition at line 96 of file timestamp_corrector.h.


The documentation for this class was generated from the following files:


rc_genicam_camera
Author(s): Heiko Hirschmueller
autogenerated on Wed Mar 2 2022 00:49:18