aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2012-10-31 12:59:14 +0100
committerLorenz Meier <lm@inf.ethz.ch>2012-10-31 12:59:14 +0100
commit472010b10b50436d8c40d94a7d9a888c1fe06858 (patch)
tree6d05361b997d48e502afad28e6fbda00b9524b99 /apps
parent7034acd07ead3e80bb0f767ae73ffa6fafcd375e (diff)
downloadpx4-firmware-472010b10b50436d8c40d94a7d9a888c1fe06858.tar.gz
px4-firmware-472010b10b50436d8c40d94a7d9a888c1fe06858.tar.bz2
px4-firmware-472010b10b50436d8c40d94a7d9a888c1fe06858.zip
Extended GPS struct with velocity vector
Diffstat (limited to 'apps')
-rw-r--r--apps/gps/ubx.c4
-rw-r--r--apps/uORB/topics/vehicle_gps_position.h6
2 files changed, 10 insertions, 0 deletions
diff --git a/apps/gps/ubx.c b/apps/gps/ubx.c
index f676ffdfb..03ae622a1 100644
--- a/apps/gps/ubx.c
+++ b/apps/gps/ubx.c
@@ -479,6 +479,10 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer)
if (ubx_state->ck_a == packet->ck_a && ubx_state->ck_b == packet->ck_b) {
ubx_gps->vel = (uint16_t)packet->speed;
+ ubx_gps->vel_n = packet->velN / 100.0f;
+ ubx_gps->vel_e = packet->velE / 100.0f;
+ ubx_gps->vel_d = packet->velD / 100.0f;
+ ubx_gps->vel_ned_valid = true;
ubx_gps->cog = (uint16_t)((float)(packet->heading) * 1e-3f);
ubx_gps->timestamp = hrt_absolute_time();
diff --git a/apps/uORB/topics/vehicle_gps_position.h b/apps/uORB/topics/vehicle_gps_position.h
index 60d01a831..8e55ef148 100644
--- a/apps/uORB/topics/vehicle_gps_position.h
+++ b/apps/uORB/topics/vehicle_gps_position.h
@@ -66,6 +66,9 @@ struct vehicle_gps_position_s
uint16_t eph; /**< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 //LOGME */
uint16_t epv; /**< GPS VDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 */
uint16_t vel; /**< GPS ground speed (m/s * 100). If unknown, set to: 65535 */
+ float vel_n; /**< GPS ground speed in m/s */
+ float vel_e; /**< GPS ground speed in m/s */
+ float vel_d; /**< GPS ground speed in m/s */
uint16_t cog; /**< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 */
uint8_t fix_type; /**< 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. */
uint8_t satellites_visible; /**< Number of satellites visible. If unknown, set to 255 */
@@ -77,6 +80,9 @@ struct vehicle_gps_position_s
uint8_t satellite_snr[20]; /**< Signal to noise ratio of satellite */
uint8_t satellite_info_available; /**< 0 for no info, 1 for info available */
+ /* flags */
+ float vel_ned_valid; /**< Flag to indicate if NED speed is valid */
+
};
/**