[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paparazzi-commits] [5249] abstracted booz_gps to support different prot
From: |
antoine drouin |
Subject: |
[paparazzi-commits] [5249] abstracted booz_gps to support different protocols - added support for skytraq binary protocol |
Date: |
Fri, 06 Aug 2010 08:43:59 +0000 |
Revision: 5249
http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5249
Author: poine
Date: 2010-08-06 08:43:58 +0000 (Fri, 06 Aug 2010)
Log Message:
-----------
abstracted booz_gps to support different protocols - added support for skytraq
binary protocol
Modified Paths:
--------------
paparazzi3/trunk/sw/airborne/booz/booz2_ins.c
paparazzi3/trunk/sw/airborne/booz/booz2_main.c
paparazzi3/trunk/sw/airborne/booz/booz2_navigation.c
paparazzi3/trunk/sw/airborne/booz/booz2_telemetry.h
paparazzi3/trunk/sw/airborne/booz/booz_fms.c
Removed Paths:
-------------
paparazzi3/trunk/sw/airborne/booz/booz2_gps.h
Deleted: paparazzi3/trunk/sw/airborne/booz/booz2_gps.h
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/booz2_gps.h 2010-08-06 08:41:44 UTC
(rev 5248)
+++ paparazzi3/trunk/sw/airborne/booz/booz2_gps.h 2010-08-06 08:43:58 UTC
(rev 5249)
@@ -1,134 +0,0 @@
-/*
- * $Id$
- *
- * Copyright (C) 2008-2009 Antoine Drouin <address@hidden>
- *
- * This file is part of paparazzi.
- *
- * paparazzi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * paparazzi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with paparazzi; see the file COPYING. If not, write to
- * the Free Software Foundation, 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef BOOZ2_GPS_H
-#define BOOZ2_GPS_H
-
-#include "std.h"
-#include "math/pprz_geodetic_int.h"
-
-struct Booz_gps_state {
- struct EcefCoor_i ecef_pos; /* pos ECEF in cm */
- struct EcefCoor_i ecef_vel; /* speed ECEF in cm/s */
- struct LlaCoor_i lla_pos; /* pos LLA */
- int32_t hmsl; /* above mean sea level */
- uint32_t pacc; /* position accuracy */
- uint32_t sacc; /* speed accuracy */
- uint16_t pdop; /* dilution of precision */
- uint8_t num_sv; /* number of sat in fix */
- uint8_t fix; /* status of fix */
-};
-
-extern struct Booz_gps_state booz_gps_state;
-
-extern uint8_t booz_gps_lost_counter; /* updated at 4Hz */
-
-
-/* UBX NAV SOL */
-#define BOOZ2_GPS_FIX_NONE 0x00
-#define BOOZ2_GPS_FIX_3D 0x03
-
-
-#include "ubx_protocol.h"
-
-#define GpsFixValid() (booz_gps_state.fix == BOOZ2_GPS_FIX_3D)
-
-#ifdef SITL
-extern bool_t booz_gps_available;
-#define GPS_LINKChAvailable() (FALSE)
-#define GPS_LINKGetch() (TRUE)
-#include "nps_sensors.h"
-#include "flight_plan.h"
-
-static inline void booz_gps_feed_value() {
- booz_gps_state.ecef_pos.x = sensors.gps.ecef_pos.x * 100.;
- booz_gps_state.ecef_pos.y = sensors.gps.ecef_pos.y * 100.;
- booz_gps_state.ecef_pos.z = sensors.gps.ecef_pos.z * 100.;
- booz_gps_state.ecef_vel.x = sensors.gps.ecef_vel.x * 100.;
- booz_gps_state.ecef_vel.y = sensors.gps.ecef_vel.y * 100.;
- booz_gps_state.ecef_vel.z = sensors.gps.ecef_vel.z * 100.;
- booz_gps_state.lla_pos.lat = DegOfRad(sensors.gps.lla_pos.lat) * 1e7;
- booz_gps_state.lla_pos.lon = DegOfRad(sensors.gps.lla_pos.lon) * 1e7;
- booz_gps_state.lla_pos.alt = sensors.gps.lla_pos.alt * 100.;
- booz_gps_state.hmsl = sensors.gps.hmsl * 100.;
- booz_gps_state.fix = BOOZ2_GPS_FIX_3D;
- booz_gps_available = TRUE;
-}
-
-#define Booz2GpsEvent(_sol_available_callback) { \
- if (booz_gps_available) { \
- if (booz_gps_state.fix == BOOZ2_GPS_FIX_3D) \
- booz_gps_lost_counter = 0; \
- _sol_available_callback(); \
- booz_gps_available = FALSE; \
- } \
- }
-#else /* ! SITL */
-#define Booz2GpsEvent(_sol_available_callback) { \
- if (GpsBuffer()) { \
- ReadGpsBuffer(); \
- } \
- if (ubx_msg_available) { \
- booz2_gps_read_ubx_message(); \
- if (ubx_class == UBX_NAV_ID && ubx_id == UBX_NAV_SOL_ID) { \
- if (booz_gps_state.fix == BOOZ2_GPS_FIX_3D) \
- booz_gps_lost_counter = 0; \
- _sol_available_callback(); \
- }
\
- ubx_msg_available = FALSE; \
- } \
- }
-#endif
-
-extern void booz2_gps_init(void);
-extern void booz2_gps_read_ubx_message(void);
-
-
-#define __GpsLink(dev, _x) dev##_x
-#define _GpsLink(dev, _x) __GpsLink(dev, _x)
-#define GpsLink(_x) _GpsLink(GPS_LINK, _x)
-
-#define GpsBuffer() GpsLink(ChAvailable())
-#define ReadGpsBuffer() { \
- while (GpsLink(ChAvailable())&&!ubx_msg_available) \
- ubx_parse(GpsLink(Getch())); \
- }
-
-/* UBX parsing - copied from gps_ubx.c */
-
-extern bool_t ubx_msg_available;
-extern uint8_t ubx_msg_buf[];
-extern uint8_t ubx_id;
-extern uint8_t ubx_class;
-
-extern void ubx_parse( uint8_t c );
-extern void ubx_init(void);
-
-static inline void booz_gps_periodic( void ) {
- RunOnceEvery(128, booz_gps_lost_counter++; );
-}
-
-#define GpsIsLost() (booz_gps_lost_counter > 20) /* 4Hz -> 5s */
-
-
-#endif /* BOOZ2_GPS_H */
Modified: paparazzi3/trunk/sw/airborne/booz/booz2_ins.c
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/booz2_ins.c 2010-08-06 08:41:44 UTC
(rev 5248)
+++ paparazzi3/trunk/sw/airborne/booz/booz2_ins.c 2010-08-06 08:43:58 UTC
(rev 5249)
@@ -26,7 +26,7 @@
#include "booz_imu.h"
#include "booz2_analog_baro.h"
-#include "booz2_gps.h"
+#include "booz_gps.h"
#include "airframe.h"
#include "math/pprz_algebra_int.h"
Modified: paparazzi3/trunk/sw/airborne/booz/booz2_main.c
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/booz2_main.c 2010-08-06 08:41:44 UTC
(rev 5248)
+++ paparazzi3/trunk/sw/airborne/booz/booz2_main.c 2010-08-06 08:43:58 UTC
(rev 5249)
@@ -39,7 +39,7 @@
#include "booz_radio_control.h"
#include "booz_imu.h"
-#include "booz2_gps.h"
+#include "booz_gps.h"
#include "booz2_analog_baro.h"
#include "booz2_battery.h"
@@ -159,7 +159,7 @@
booz_ins_init();
#ifdef USE_GPS
- booz2_gps_init();
+ booz_gps_init();
#endif
#ifdef USE_MODULES
@@ -245,7 +245,7 @@
Booz2AnalogBaroEvent(on_baro_event);
#ifdef USE_GPS
- Booz2GpsEvent(on_gps_event);
+ BoozGpsEvent(on_gps_event);
#endif
#ifdef BOOZ_FAILSAFE_GROUND_DETECT
Modified: paparazzi3/trunk/sw/airborne/booz/booz2_navigation.c
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/booz2_navigation.c 2010-08-06
08:41:44 UTC (rev 5248)
+++ paparazzi3/trunk/sw/airborne/booz/booz2_navigation.c 2010-08-06
08:43:58 UTC (rev 5249)
@@ -25,7 +25,7 @@
#include "booz2_navigation.h"
-#include "booz2_gps.h"
+#include "booz_gps.h"
#include "booz2_ins.h"
#include "booz2_autopilot.h"
Modified: paparazzi3/trunk/sw/airborne/booz/booz2_telemetry.h
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/booz2_telemetry.h 2010-08-06 08:41:44 UTC
(rev 5248)
+++ paparazzi3/trunk/sw/airborne/booz/booz2_telemetry.h 2010-08-06 08:43:58 UTC
(rev 5249)
@@ -47,7 +47,7 @@
#include "booz2_battery.h"
#include "booz_imu.h"
-#include "booz2_gps.h"
+#include "booz_gps.h"
#include "booz2_ins.h"
#include "booz_ahrs.h"
@@ -652,7 +652,7 @@
&booz2_guidance_h_accel_ref.y); \
}
-#include "booz2_gps.h"
+#include "booz_gps.h"
#include "booz2_navigation.h"
#define PERIODIC_SEND_BOOZ2_FP(_chan) {
\
int32_t carrot_up = -booz2_guidance_v_z_sp;
\
@@ -688,6 +688,7 @@
&booz_gps_state.ecef_vel.z, \
&booz_gps_state.pacc, \
&booz_gps_state.sacc, \
+ &booz_gps_state.tow, \
&booz_gps_state.pdop, \
&booz_gps_state.num_sv, \
&booz_gps_state.fix); \
Modified: paparazzi3/trunk/sw/airborne/booz/booz_fms.c
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/booz_fms.c 2010-08-06 08:41:44 UTC
(rev 5248)
+++ paparazzi3/trunk/sw/airborne/booz/booz_fms.c 2010-08-06 08:43:58 UTC
(rev 5249)
@@ -24,7 +24,7 @@
#include "booz_fms.h"
#include "booz_imu.h"
-#include "booz2_gps.h"
+#include "booz_gps.h"
#include "booz_ahrs.h"
#include "airframe.h"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paparazzi-commits] [5249] abstracted booz_gps to support different protocols - added support for skytraq binary protocol,
antoine drouin <=