Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Commit

Permalink
Update almanac and ephemeris for QZSS
Browse files Browse the repository at this point in the history
  • Loading branch information
ljbade committed Dec 15, 2015
1 parent 432250e commit e1a4c50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/almanac.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ static void gps_calc_sat_state_almanac(const almanac_t* alm_, double t, s16 week
double ea = ma; /* Starting value for E. */
double ea_old;
double temp;
// TODO: inclination offset for QZSS different from GPS
double ecc = alm->ecc;
u32 count = 0;

Expand Down Expand Up @@ -144,6 +145,7 @@ static void gps_calc_sat_state_almanac(const almanac_t* alm_, double t, s16 week

/* Compute the satellite's position in Earth-Centered Earth-Fixed
* coordinates. */
// TODO: inclination offset for QZSS different from GPS
pos[0] = x * cos(om) - y * cos(alm->inc) * sin(om);
pos[1] = x * sin(om) + y * cos(alm->inc) * cos(om);
pos[2] = y * sin(alm->inc);
Expand Down
3 changes: 2 additions & 1 deletion src/ephemeris.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void decode_ephemeris(u32 frame_words[3][8], ephemeris_t *e)
{
assert(frame_words != NULL);
assert(e != NULL);
assert(e->sid.constellation == CONSTELLATION_GPS);
assert((e->sid.constellation == CONSTELLATION_GPS) || (e->sid.constellation == CONSTELLATION_QZSS));
ephemeris_kepler_t *k = &e->kepler;

/* These unions facilitate signed/unsigned conversion and sign extension. */
Expand Down Expand Up @@ -308,6 +308,7 @@ void decode_ephemeris(u32 frame_words[3][8], ephemeris_t *e)
e->healthy = !(frame_words[0][3-3] >> (30-17) & 1);

/* t_gd: Word 7, bits 17-24 */
// TODO
onebyte.u8 = frame_words[0][7-3] >> (30-24) & 0xFF;
k->tgd = onebyte.s8 * pow(2,-31);

Expand Down

0 comments on commit e1a4c50

Please sign in to comment.