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
gps_sim_nps.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2011 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 
23 #include "subsystems/gps.h"
24 
26 
28  gps.ecef_pos.x = sensors.gps.ecef_pos.x * 100.;
29  gps.ecef_pos.y = sensors.gps.ecef_pos.y * 100.;
30  gps.ecef_pos.z = sensors.gps.ecef_pos.z * 100.;
31  gps.ecef_vel.x = sensors.gps.ecef_vel.x * 100.;
32  gps.ecef_vel.y = sensors.gps.ecef_vel.y * 100.;
33  gps.ecef_vel.z = sensors.gps.ecef_vel.z * 100.;
34  //ecef pos seems to be based on geocentric model, hence we get a very high alt when converted to lla
35  gps.lla_pos.lat = sensors.gps.lla_pos.lat * 1e7;
36  gps.lla_pos.lon = sensors.gps.lla_pos.lon * 1e7;
37  gps.lla_pos.alt = sensors.gps.lla_pos.alt * 1000.;
38  gps.hmsl = sensors.gps.hmsl * 1000.;
39  gps.fix = GPS_FIX_3D;
41 }
42 
43 void gps_impl_init() {
45 }
int32_t y
in centimeters
struct LlaCoor_i lla_pos
position in LLA (lat,lon: rad*1e7; alt: mm over ellipsoid)
Definition: gps.h:65
int32_t lat
in radians*1e7
struct EcefCoor_i ecef_vel
speed ECEF in cm/s
Definition: gps.h:68
int32_t hmsl
height above mean sea level in mm
Definition: gps.h:67
uint8_t fix
status of fix
Definition: gps.h:78
#define GPS_FIX_3D
Definition: gps.h:43
int32_t z
in centimeters
struct EcefCoor_i ecef_pos
position in ECEF in cm
Definition: gps.h:64
void gps_impl_init()
Definition: gps_sim_nps.c:43
#define FALSE
Definition: imu_chimu.h:141
void gps_feed_value()
Definition: gps_sim_nps.c:27
Device independent GPS code (interface)
int32_t alt
in millimeters above WGS84 reference ellipsoid
int32_t x
in centimeters
#define TRUE
Definition: imu_chimu.h:144
bool_t gps_available
Definition: gps_sim_nps.c:25
int32_t lon
in radians*1e7
struct GpsState gps
global GPS state
Definition: gps.c:33