diff options
author | Holger Steinhaus <holger@steinhaus-home.de> | 2014-11-13 16:58:41 +0100 |
---|---|---|
committer | Holger Steinhaus <holger@steinhaus-home.de> | 2014-11-13 16:58:41 +0100 |
commit | e026324784409bd16a561544cb608e7089d500a0 (patch) | |
tree | 0f7124b106996502c3a254fa0ce18b9a5c539135 /src/modules/uavcan | |
parent | 16d74e3c31b9c2cf4f2de254956a58885b5c1fbf (diff) | |
download | px4-firmware-e026324784409bd16a561544cb608e7089d500a0.tar.gz px4-firmware-e026324784409bd16a561544cb608e7089d500a0.tar.bz2 px4-firmware-e026324784409bd16a561544cb608e7089d500a0.zip |
UAVCAN: fix mag report timestamp
Diffstat (limited to 'src/modules/uavcan')
-rw-r--r-- | src/modules/uavcan/sensors/mag.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/modules/uavcan/sensors/mag.cpp b/src/modules/uavcan/sensors/mag.cpp index a529e7e75..5cbb96433 100644 --- a/src/modules/uavcan/sensors/mag.cpp +++ b/src/modules/uavcan/sensors/mag.cpp @@ -37,6 +37,7 @@ #include "mag.hpp" +#include <drivers/drv_hrt.h> #include <systemlib/err.h> static const orb_id_t MAG_TOPICS[3] = { @@ -139,11 +140,7 @@ void UavcanMagnetometerBridge::mag_sub_cb(const uavcan::ReceivedDataStructure<ua { lock(); _report.range_ga = 1.3F; // Arbitrary number, doesn't really mean anything - - _report.timestamp = msg.getUtcTimestamp().toUSec(); - if (_report.timestamp == 0) { - _report.timestamp = msg.getMonotonicTimestamp().toUSec(); - } + _report.timestamp = hrt_absolute_time(); _report.x = (msg.magnetic_field[0] - _scale.x_offset) * _scale.x_scale; _report.y = (msg.magnetic_field[1] - _scale.y_offset) * _scale.y_scale; |