mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 11:53:34 +08:00
Add PPS capture message to logged topics, simplify timestamp logic and small cleanup
This commit is contained in:
committed by
Beat Küng
parent
5ad8b84dec
commit
064a602962
@@ -193,10 +193,8 @@ CameraCapture::publish_trigger()
|
||||
|
||||
|
||||
if (_pps_hrt_timestamp > 0) {
|
||||
// Current RTC time (RTC time captured by the PPS module + elapsed time since capture)
|
||||
uint64_t gps_utc_time = _pps_rtc_timestamp + hrt_elapsed_time(&_pps_hrt_timestamp);
|
||||
// Current RTC time - elapsed time since capture interrupt event
|
||||
trigger.timestamp_utc = gps_utc_time - hrt_elapsed_time(&trigger.timestamp);
|
||||
// Last PPS RTC time + elapsed time to the camera capture interrupt
|
||||
trigger.timestamp_utc = _pps_rtc_timestamp + (trigger.timestamp - _pps_hrt_timestamp);
|
||||
|
||||
} else {
|
||||
// No PPS capture received, use RTC clock as fallback
|
||||
|
||||
@@ -132,8 +132,8 @@ private:
|
||||
hrt_abstime _last_trig_time{0};
|
||||
uint32_t _capture_overflows{0};
|
||||
|
||||
uint64_t _pps_hrt_timestamp{0};
|
||||
uint64_t _pps_rtc_timestamp{0};
|
||||
hrt_abstime _pps_hrt_timestamp{0};
|
||||
uint64_t _pps_rtc_timestamp{0};
|
||||
|
||||
// Signal capture callback
|
||||
void capture_callback(uint32_t chan_index, hrt_abstime edge_time, uint32_t edge_state, uint32_t overflow);
|
||||
|
||||
Reference in New Issue
Block a user