Function rko_lio::core::process_timestamps¶
Defined in File process_timestamps.cpp
Function Documentation¶
-
Timestamps rko_lio::core::process_timestamps(const std::vector<double> &raw_timestamps, const Secondsd &header_stamp, const TimestampProcessingConfig &config)¶
Process raw timestamps and calculates absolute timestamps in seconds.
The input timestamps can be either absolute or relative and may be in seconds or nanoseconds. The function automatically detects whether the timestamps are in nanoseconds by checking the duration spread and converts them to seconds accordingly. Then the case of absolute or relative time is disambiguated based on how close (or away) the min or max times are to the header time.
Alternatively you can specify
force_absoluteorforce_relativein the config to skip the checks for automatic conversion.- Parameters:
raw_timestamps – Vector of raw sensor timestamps as doubles, can be relative or absolute values.
header_stamp – Reference absolute timestamp corresponding to the scan’s header time.
config – timestamp specific config to use in processing.
- Throws:
std::runtime_error – If the timestamp format or values are unrecognized or unsupported.
- Returns:
A struct containing:
The computed scan start time (absolute, Secondsd),
The computed scan end time (absolute, Secondsd),
A vector of all processed point timestamps converted to absolute seconds (TimestampVector).