Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add L2CM tracking functionality #2

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ CSRC := $(PORTSRC) \
$(SWIFTNAV_ROOT)/src/sbp_utils.o \
$(SWIFTNAV_ROOT)/src/error.o \
$(SWIFTNAV_ROOT)/src/track.o \
$(SWIFTNAV_ROOT)/src/track_gps_l1ca.o \
$(SWIFTNAV_ROOT)/src/track_gps_l2cm.o \
$(SWIFTNAV_ROOT)/src/acq.o \
$(SWIFTNAV_ROOT)/src/manage.o \
$(SWIFTNAV_ROOT)/src/settings.o \
Expand Down
6 changes: 5 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include "init.h"
#include "manage.h"
#include "track.h"
#include "track_gps_l1ca.h"
#include "track_gps_l2cm.h"
#include "timing.h"
#include "ext_events.h"
#include "solution.h"
Expand Down Expand Up @@ -183,7 +185,9 @@ int main(void)
timing_setup();
ext_event_setup();
position_setup();
tracking_setup();
track_setup();
track_gps_l1ca_register();
track_gps_l2cm_register();
decode_setup();
decode_gps_l1_register();

Expand Down
12 changes: 5 additions & 7 deletions src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,8 @@ static void manage_acq()
track_count += 16*(1023.0-cp)*(1.0 + cf / GPS_L1_HZ);

/* Start the tracking channel */
tracking_channel_init(chan, acq->sid, cf, track_count, cn0,
TRACKING_ELEVATION_UNKNOWN);
tracker_channel_init(chan, acq->sid, cf, track_count, cn0,
TRACKING_ELEVATION_UNKNOWN);
/* TODO: Initialize elevation from ephemeris if we know it precisely */

/* Start the decoder channel */
Expand All @@ -415,7 +415,7 @@ static u8 manage_track_new_acq(gnss_signal_t sid)
* a newly acquired satellite into.
*/
for (u8 i=0; i<nap_track_n_channels; i++) {
if (tracking_channel_available(i, sid) &&
if (tracker_channel_available(i, sid) &&
decoder_channel_available(i, sid)) {
return i;
}
Expand Down Expand Up @@ -489,7 +489,7 @@ static void drop_channel(u8 channel_id) {

/* Finally disable the decoder and tracking channels */
decoder_channel_disable(channel_id);
tracking_channel_disable(channel_id);
tracker_channel_disable(channel_id);
}

/** Disable any tracking channel that has lost phase lock or is
Expand Down Expand Up @@ -587,9 +587,7 @@ s8 use_tracking_channel(u8 i)
/* Channel time of week has been decoded. */
&& (tracking_channel_tow_ms_get(i) != TOW_INVALID)
/* Nav bit polarity is known, i.e. half-cycles have been resolved. */
&& tracking_channel_bit_polarity_resolved(i)
/* Estimated C/N0 is above some threshold */
&& tracking_channel_cn0_useable(i))
&& tracking_channel_bit_polarity_resolved(i))
/* TODO: Alert flag is not set */
{
/* Ephemeris must be valid, not stale. Satellite must be healthy.
Expand Down
Loading