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:
Rowan Dempster
2025-09-15 16:18:26 -08:00
committed by GitHub
parent d3f912ad25
commit d205d11c3d
4 changed files with 38 additions and 9 deletions
+11
View File
@@ -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);
}