aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/gps
diff options
context:
space:
mode:
authorKynos <mail01@delago.net>2014-05-30 14:30:25 +0200
committerKynos <mail01@delago.net>2014-05-30 14:30:25 +0200
commit9bad828bc0033c7017978de2321d3a8698c0afc6 (patch)
treedc82fbdcdf09e4ee5060cdae032ed659fcc2b41d /src/drivers/gps
parent7349fa90376714b00fe920538950b31a46169d60 (diff)
downloadpx4-firmware-9bad828bc0033c7017978de2321d3a8698c0afc6.tar.gz
px4-firmware-9bad828bc0033c7017978de2321d3a8698c0afc6.tar.bz2
px4-firmware-9bad828bc0033c7017978de2321d3a8698c0afc6.zip
U-blox driver rework, step 2
Moved satellite info from vehicle_gps_position_s into a new uORB topic satellite_info. Renamed satellites_visible to satellites_used to reflect true content. sdlog2 will log info for GPS satellites only for now.
Diffstat (limited to 'src/drivers/gps')
-rw-r--r--src/drivers/gps/gps.cpp2
-rw-r--r--src/drivers/gps/mtk.cpp2
-rw-r--r--src/drivers/gps/ubx.cpp3
3 files changed, 4 insertions, 3 deletions
diff --git a/src/drivers/gps/gps.cpp b/src/drivers/gps/gps.cpp
index 5342ccf78..d2ffc30ba 100644
--- a/src/drivers/gps/gps.cpp
+++ b/src/drivers/gps/gps.cpp
@@ -449,7 +449,7 @@ GPS::print_info()
if (_report.timestamp_position != 0) {
warnx("position lock: %dD, satellites: %d, last update: %8.4fms ago", (int)_report.fix_type,
- _report.satellites_visible, (double)(hrt_absolute_time() - _report.timestamp_position) / 1000.0f);
+ _report.satellites_used, (double)(hrt_absolute_time() - _report.timestamp_position) / 1000.0f);
warnx("lat: %d, lon: %d, alt: %d", _report.lat, _report.lon, _report.alt);
warnx("eph: %.2fm, epv: %.2fm", (double)_report.eph_m, (double)_report.epv_m);
warnx("rate position: \t%6.2f Hz", (double)_Helper->get_position_update_rate());
diff --git a/src/drivers/gps/mtk.cpp b/src/drivers/gps/mtk.cpp
index 680f00d97..7b957e55d 100644
--- a/src/drivers/gps/mtk.cpp
+++ b/src/drivers/gps/mtk.cpp
@@ -263,7 +263,7 @@ MTK::handle_message(gps_mtk_packet_t &packet)
_gps_position->epv_m = _gps_position->eph_m; // unknown in mtk custom mode, so we cheat with eph
_gps_position->vel_m_s = ((float)packet.ground_speed) * 1e-2f; // from cm/s to m/s
_gps_position->cog_rad = ((float)packet.heading) * M_DEG_TO_RAD_F * 1e-2f; //from deg *100 to rad
- _gps_position->satellites_visible = packet.satellites;
+ _gps_position->satellites_used = packet.satellites;
/* convert time and date information to unix timestamp */
struct tm timeinfo; //TODO: test this conversion
diff --git a/src/drivers/gps/ubx.cpp b/src/drivers/gps/ubx.cpp
index d7e9454ae..462875b6c 100644
--- a/src/drivers/gps/ubx.cpp
+++ b/src/drivers/gps/ubx.cpp
@@ -55,6 +55,7 @@
#include <systemlib/err.h>
#include <uORB/uORB.h>
#include <uORB/topics/vehicle_gps_position.h>
+#include <uORB/topics/satellite_info.h>
#include <drivers/drv_hrt.h>
#include "ubx.h"
@@ -451,7 +452,7 @@ UBX::handle_message()
_gps_position->s_variance_m_s = packet->sAcc;
_gps_position->p_variance_m = packet->pAcc;
_gps_position->timestamp_variance = hrt_absolute_time();
- _gps_position->satellites_visible = packet->numSV;
+ _gps_position->satellites_used = packet->numSV;
ret = 1;
break;