Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ins_gps_passthrough.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004-2012 The Paparazzi Team
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
28 #include "subsystems/ins.h"
29 
30 #include <inttypes.h>
31 #include <math.h>
32 
33 #include "state.h"
34 #include "subsystems/gps.h"
35 #include "subsystems/nav.h"
36 
37 void ins_init() {
38  struct UtmCoor_f utm0 = { nav_utm_north0, nav_utm_east0, 0., nav_utm_zone0 };
40  stateSetPositionUtm_f(&utm0);
41 }
42 
43 void ins_periodic( void ) {
44 }
45 
46 void ins_update_gps(void) {
47  struct UtmCoor_f utm;
48  utm.east = gps.utm_pos.east / 100.;
49  utm.north = gps.utm_pos.north / 100.;
50  utm.zone = nav_utm_zone0;
51  utm.alt = gps.hmsl / 1000.;
52 
53  // set position
55 
56  struct NedCoor_f ned_vel = {
57  gps.ned_vel.x / 100.,
58  gps.ned_vel.y / 100.,
59  gps.ned_vel.z / 100.
60  };
61  // set velocity
62  stateSetSpeedNed_f(&ned_vel);
63 }
64 
65 
66 void ins_propagate() {
67 }
68 
70 }
71 
73 }
74 
75 void ins_realign_h(struct FloatVect2 pos __attribute__ ((unused)), struct FloatVect2 speed __attribute__ ((unused))) {
76 }
77 
78 void ins_realign_v(float z __attribute__ ((unused))) {
79 }
80 
struct NedCoor_i ned_vel
speed NED in cm/s
Definition: gps.h:69
void ins_realign_h(struct FloatVect2 pos, struct FloatVect2 speed)
INS horizontal realign.
int32_t x
North.
uint8_t nav_utm_zone0
Definition: common_nav.c:44
Integrated Navigation System interface.
int32_t hmsl
height above mean sea level in mm
Definition: gps.h:67
void ins_init()
INS initialization.
void ins_update_gps(void)
Update INS state with GPS measurements.
void ins_update_baro()
Update INS state with barometer measurements.
static void stateSetPositionUtm_f(struct UtmCoor_f *utm_pos)
Set position from UTM coordinates (float).
Definition: state.h:555
int32_t z
Down.
static void stateSetSpeedNed_f(struct NedCoor_f *ned_speed)
Set ground speed in local NED coordinates (float).
Definition: state.h:754
uint8_t zone
UTM zone number.
int32_t nav_utm_north0
Definition: common_nav.c:43
vector in North East Down coordinates Units: meters
float north
in meters
Device independent GPS code (interface)
void ins_propagate()
Propagation.
float z
in meters
position in UTM coordinates Units: meters
void ins_realign_v(float z)
INS vertical realign.
int32_t y
East.
int32_t north
in centimeters
int32_t east
in centimeters
API to get/set the generic vehicle states.
void ins_update_sonar()
Update INS state with sonar measurements.
int32_t nav_utm_east0
Definition: common_nav.c:42
struct UtmCoor_i utm_pos
position in UTM (north,east: cm; alt: mm over ellipsoid)
Definition: gps.h:66
float east
in meters
float alt
in meters above WGS84 reference ellipsoid
static void stateSetLocalUtmOrigin_f(struct UtmCoor_f *utm_def)
Set the local (flat earth) coordinate frame origin from UTM (float).
Definition: state.h:459
struct GpsState gps
global GPS state
Definition: gps.c:33
void ins_periodic(void)
INS periodic call.