aboutsummaryrefslogtreecommitdiff
path: root/src/modules/uavcan/sensors/mag.cpp
diff options
context:
space:
mode:
authorHolger Steinhaus <holger@steinhaus-home.de>2014-11-18 14:58:04 +0100
committerHolger Steinhaus <holger@steinhaus-home.de>2014-11-18 14:58:04 +0100
commit2ce2d26d52884f868ecbcb102f38cbc853c2dbf6 (patch)
tree7f37f9fc1825504019e8ad7c1a7f954cbf4e5e2a /src/modules/uavcan/sensors/mag.cpp
parente026324784409bd16a561544cb608e7089d500a0 (diff)
downloadpx4-firmware-2ce2d26d52884f868ecbcb102f38cbc853c2dbf6.tar.gz
px4-firmware-2ce2d26d52884f868ecbcb102f38cbc853c2dbf6.tar.bz2
px4-firmware-2ce2d26d52884f868ecbcb102f38cbc853c2dbf6.zip
UAVCAN: preserve original UAVCAN message timestamps
Diffstat (limited to 'src/modules/uavcan/sensors/mag.cpp')
-rw-r--r--src/modules/uavcan/sensors/mag.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/modules/uavcan/sensors/mag.cpp b/src/modules/uavcan/sensors/mag.cpp
index 5cbb96433..35ebee542 100644
--- a/src/modules/uavcan/sensors/mag.cpp
+++ b/src/modules/uavcan/sensors/mag.cpp
@@ -37,7 +37,6 @@
#include "mag.hpp"
-#include <drivers/drv_hrt.h>
#include <systemlib/err.h>
static const orb_id_t MAG_TOPICS[3] = {
@@ -140,7 +139,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 = hrt_absolute_time();
+ _report.timestamp = msg.getMonotonicTimestamp().toUSec();
_report.x = (msg.magnetic_field[0] - _scale.x_offset) * _scale.x_scale;
_report.y = (msg.magnetic_field[1] - _scale.y_offset) * _scale.y_scale;