[furuno] added new gps support

This commit is contained in:
masierra
2016-02-03 09:45:23 -08:00
parent 07efb49367
commit c56fea0899
2 changed files with 8 additions and 8 deletions
@@ -6,7 +6,7 @@ GPS_LED ?= none
FURUNO_GPS_PORT_LOWER=$(shell echo $(GPS_PORT) | tr A-Z a-z) FURUNO_GPS_PORT_LOWER=$(shell echo $(GPS_PORT) | tr A-Z a-z)
ap.CFLAGS += -DUSE_GPS ap.CFLAGS += -DUSE_GPS
ap.CFLAGS += -DGPS_LINK=$(FURUNO_GPS_PORT_LOWER) ap.CFLAGS += -DNMEA_GPS_LINK=$(FURUNO_GPS_PORT_LOWER)
ap.CFLAGS += -DUSE_$(GPS_PORT) ap.CFLAGS += -DUSE_$(GPS_PORT)
ap.CFLAGS += -D$(GPS_PORT)_BAUD=$(GPS_BAUD) ap.CFLAGS += -D$(GPS_PORT)_BAUD=$(GPS_BAUD)
ap.CFLAGS += -DNMEA_PARSE_PROP ap.CFLAGS += -DNMEA_PARSE_PROP
@@ -15,7 +15,7 @@ ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED) ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif endif
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_nmea.h\" ap.CFLAGS += -DPRIMARY_GPS_TYPE_H=\"subsystems/gps/gps_nmea.h\"
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_nmea.c $(SRC_SUBSYSTEMS)/gps/gps_furuno.c ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_nmea.c $(SRC_SUBSYSTEMS)/gps/gps_furuno.c
$(TARGET).srcs += $(SRC_SUBSYSTEMS)/gps.c $(TARGET).srcs += $(SRC_SUBSYSTEMS)/gps.c
+6 -6
View File
@@ -26,8 +26,8 @@
* GPS furuno based NMEA parser * GPS furuno based NMEA parser
*/ */
#include "gps_nmea.h"
#include "subsystems/gps.h" #include "subsystems/gps.h"
#include "gps_nmea.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -57,7 +57,7 @@ static uint8_t furuno_cfg_cnt = 0;
static void nmea_parse_perdcrv(void); static void nmea_parse_perdcrv(void);
#define GpsLinkDevice (&(GPS_LINK).device) #define GpsLinkDevice (&(NMEA_GPS_LINK).device)
/** /**
* Configure furuno GPS. * Configure furuno GPS.
@@ -111,17 +111,17 @@ void nmea_parse_perdcrv(void)
//EAST VEL //EAST VEL
double east_vel = strtod(&gps_nmea.msg_buf[i], NULL); double east_vel = strtod(&gps_nmea.msg_buf[i], NULL);
gps.ned_vel.y = east_vel * 100; // in cm/s gps_nmea.state.ned_vel.y = east_vel * 100; // in cm/s
// Ignore reserved // Ignore reserved
nmea_read_until(&i); nmea_read_until(&i);
// NORTH VEL // NORTH VEL
double north_vel = strtod(&gps_nmea.msg_buf[i], NULL); double north_vel = strtod(&gps_nmea.msg_buf[i], NULL);
gps.ned_vel.x = north_vel * 100; // in cm/s gps_nmea.state.ned_vel.x = north_vel * 100; // in cm/s
//Convert velocity to ecef //Convert velocity to ecef
struct LtpDef_i ltp; struct LtpDef_i ltp;
ltp_def_from_ecef_i(&ltp, &gps.ecef_pos); ltp_def_from_ecef_i(&ltp, &gps_nmea.state.ecef_pos);
ecef_of_ned_vect_i(&gps.ecef_vel, &ltp, &gps.ned_vel); ecef_of_ned_vect_i(&gps_nmea.state.ecef_vel, &ltp, &gps_nmea.state.ned_vel);
} }