diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-09-06 15:03:32 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-09-06 15:03:32 +0200 |
commit | 2e610af77ad325e96b220f48d1fc41ac4cf85a2b (patch) | |
tree | 079b6d736d43f91961c1a6b1766d7d3227b43199 | |
parent | 1a89b80024876368507764dc9fa7fdf7584eabb3 (diff) | |
parent | 1d038eed047358eee30513673bbcb29bf93dd78e (diff) | |
download | px4-firmware-2e610af77ad325e96b220f48d1fc41ac4cf85a2b.tar.gz px4-firmware-2e610af77ad325e96b220f48d1fc41ac4cf85a2b.tar.bz2 px4-firmware-2e610af77ad325e96b220f48d1fc41ac4cf85a2b.zip |
Merge pull request #1348 from PX4/uavcan_gnss_update
UAVCAN: GNSS fix message update
-rw-r--r-- | src/modules/uavcan/sensors/gnss.cpp | 8 | ||||
m--------- | uavcan | 0 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/modules/uavcan/sensors/gnss.cpp b/src/modules/uavcan/sensors/gnss.cpp index 0d67aad47..24afe6aaf 100644 --- a/src/modules/uavcan/sensors/gnss.cpp +++ b/src/modules/uavcan/sensors/gnss.cpp @@ -43,8 +43,6 @@ #include <systemlib/err.h> #include <mathlib/mathlib.h> -#define MM_PER_CM 10 // Millimeters per centimeter - const char *const UavcanGnssBridge::NAME = "gnss"; UavcanGnssBridge::UavcanGnssBridge(uavcan::INode &node) : @@ -95,9 +93,9 @@ void UavcanGnssBridge::gnss_fix_sub_cb(const uavcan::ReceivedDataStructure<uavca auto report = ::vehicle_gps_position_s(); report.timestamp_position = hrt_absolute_time(); - report.lat = msg.lat_1e7; - report.lon = msg.lon_1e7; - report.alt = msg.alt_1e2 * MM_PER_CM; // Convert from centimeter (1e2) to millimeters (1e3) + report.lat = msg.latitude_deg_1e8 / 10; + report.lon = msg.longitude_deg_1e8 / 10; + report.alt = msg.height_msl_mm; report.timestamp_variance = report.timestamp_position; diff --git a/uavcan b/uavcan -Subproject c4c14c60fbbd9acd281ee97d5bb2a4027d0ae2d +Subproject 286adbcc56c4b093143b647ec7546abb149cd53 |