mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 06:53:34 +08:00
Recovering UTC timestamps from ULog without sensor_gps (#25534)
* Added overloaded get_log_time util for fractional seconds * Added write_info implementation for double info types * Save boot time to .ulg via info message key boot_time_utc * Changed time type from double to uint64_t, formatted * Fixing get_log_time function doc
This commit is contained in:
@@ -1990,6 +1990,11 @@ void Logger::write_info(LogType type, const char *name, uint32_t value)
|
||||
write_info_template<uint32_t>(type, name, value, "uint32_t");
|
||||
}
|
||||
|
||||
void Logger::write_info(LogType type, const char *name, uint64_t value)
|
||||
{
|
||||
write_info_template<uint64_t>(type, name, value, "uint64_t");
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
void Logger::write_info_template(LogType type, const char *name, T value, const char *type_str)
|
||||
@@ -2122,6 +2127,12 @@ void Logger::write_version(LogType type)
|
||||
|
||||
write_info(type, "time_ref_utc", _param_sdlog_utc_offset.get() * 60);
|
||||
|
||||
uint64_t boot_time_utc_us;
|
||||
|
||||
if (util::get_log_time(boot_time_utc_us, _param_sdlog_utc_offset.get() * 60, true)) {
|
||||
write_info(type, "boot_time_utc_us", boot_time_utc_us);
|
||||
}
|
||||
|
||||
if (_replay_file_name) {
|
||||
write_info(type, "replay", _replay_file_name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user