mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-04 22:17:01 +08:00
[nps] set gps week and tow
currently still hardcoded to May 2014, needs to be implemented properly
This commit is contained in:
@@ -22,6 +22,9 @@
|
|||||||
#include "subsystems/gps/gps_sim_nps.h"
|
#include "subsystems/gps/gps_sim_nps.h"
|
||||||
#include "subsystems/gps.h"
|
#include "subsystems/gps.h"
|
||||||
|
|
||||||
|
#include "nps_sensors.h"
|
||||||
|
#include "nps_fdm.h"
|
||||||
|
|
||||||
#if GPS_USE_LATLONG
|
#if GPS_USE_LATLONG
|
||||||
/* currently needed to get nav_utm_zone0 */
|
/* currently needed to get nav_utm_zone0 */
|
||||||
#include "subsystems/navigation/common_nav.h"
|
#include "subsystems/navigation/common_nav.h"
|
||||||
@@ -32,6 +35,10 @@ bool_t gps_available;
|
|||||||
bool_t gps_has_fix;
|
bool_t gps_has_fix;
|
||||||
|
|
||||||
void gps_feed_value() {
|
void gps_feed_value() {
|
||||||
|
// FIXME, set proper time instead of hardcoded to May 2014
|
||||||
|
gps.week = 1794;
|
||||||
|
gps.tow = fdm.time * 1000;
|
||||||
|
|
||||||
gps.ecef_pos.x = sensors.gps.ecef_pos.x * 100.;
|
gps.ecef_pos.x = sensors.gps.ecef_pos.x * 100.;
|
||||||
gps.ecef_pos.y = sensors.gps.ecef_pos.y * 100.;
|
gps.ecef_pos.y = sensors.gps.ecef_pos.y * 100.;
|
||||||
gps.ecef_pos.z = sensors.gps.ecef_pos.z * 100.;
|
gps.ecef_pos.z = sensors.gps.ecef_pos.z * 100.;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef GPS_SIM_NPS_H
|
#ifndef GPS_SIM_NPS_H
|
||||||
#define GPS_SIM_NPS_H
|
#define GPS_SIM_NPS_H
|
||||||
|
|
||||||
#include "nps_sensors.h"
|
#include "std.h"
|
||||||
|
|
||||||
#define GPS_NB_CHANNELS 16
|
#define GPS_NB_CHANNELS 16
|
||||||
|
|
||||||
|
|||||||
@@ -490,7 +490,8 @@ static void init_ltp(void) {
|
|||||||
double gha[MAXCOEFF];
|
double gha[MAXCOEFF];
|
||||||
|
|
||||||
/* Current date in decimal year, for example 2012.68 */
|
/* Current date in decimal year, for example 2012.68 */
|
||||||
double sdate = 2012.68;
|
/** @FIXME properly get current time */
|
||||||
|
double sdate = 2014.5;
|
||||||
|
|
||||||
llh_from_jsbsim(&fdm.lla_pos, propagate);
|
llh_from_jsbsim(&fdm.lla_pos, propagate);
|
||||||
/* LLA Position in decimal degrees and altitude in km */
|
/* LLA Position in decimal degrees and altitude in km */
|
||||||
@@ -505,6 +506,7 @@ static void init_ltp(void) {
|
|||||||
&fdm.ltp_h.x, &fdm.ltp_h.y, &fdm.ltp_h.z,
|
&fdm.ltp_h.x, &fdm.ltp_h.y, &fdm.ltp_h.z,
|
||||||
IEXT, EXT_COEFF1, EXT_COEFF2, EXT_COEFF3);
|
IEXT, EXT_COEFF1, EXT_COEFF2, EXT_COEFF3);
|
||||||
FLOAT_VECT3_NORMALIZE(fdm.ltp_h);
|
FLOAT_VECT3_NORMALIZE(fdm.ltp_h);
|
||||||
|
printf("normalized magnetic field: %.4f %.4f %.4f\n", fdm.ltp_h.x, fdm.ltp_h.y, fdm.ltp_h.z);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user