Skip to content

Commit

Permalink
[nps] Fix jsbsim simulator initialisation and GPS accuracy
Browse files Browse the repository at this point in the history
  • Loading branch information
fvantienen committed Mar 17, 2019
1 parent 7beee86 commit 73de678
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions sw/airborne/subsystems/gps/gps_sim_nps.c
Expand Up @@ -75,6 +75,12 @@ void gps_feed_value(void)
#endif
SetBit(gps_nps.valid_fields, GPS_VALID_COURSE_BIT);

gps_nps.pacc = 650;
gps_nps.hacc = 450;
gps_nps.vacc = 200;
gps_nps.sacc = 100;
gps_nps.pdop = 650;

if (gps_has_fix) {
gps_nps.num_sv = 11;
gps_nps.fix = GPS_FIX_3D;
Expand Down
6 changes: 5 additions & 1 deletion sw/simulator/nps/nps_fdm_jsbsim.cpp
Expand Up @@ -180,6 +180,10 @@ void nps_fdm_init(double dt)

FDMExec->RunIC();

// Fix getting initial incorrect accel measurements
for(uint16_t i = 0; i < 1500; i++)
FDMExec->Run();

init_ltp();

#if DEBUG_NPS_JSBSIM
Expand Down Expand Up @@ -679,7 +683,7 @@ static void init_ltp(void)

/* Current date in decimal year, for example 2012.68 */
/** @FIXME properly get current time */
double sdate = 2014.5;
double sdate = 2019.0;

llh_from_jsbsim(&fdm.lla_pos, propagate);
/* LLA Position in decimal degrees and altitude in km */
Expand Down

0 comments on commit 73de678

Please sign in to comment.