This repository was archived by the owner on Apr 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
New track field #356
Open
denniszollo
wants to merge
3
commits into
swift-nav:master
Choose a base branch
from
denniszollo:new_track_field
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
New track field #356
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -804,7 +804,7 @@ s8 calc_navigation_measurement(u8 n_channels, const channel_measurement_t *meas[ | |
/* Copy over remaining values. */ | ||
nav_meas[i]->snr = meas[i]->snr; | ||
nav_meas[i]->lock_counter = meas[i]->lock_counter; | ||
|
||
nav_meas[i]->lock_time = meas[i]->lock_time; | ||
/* calc sat clock error */ | ||
if (calc_sat_state(e[i], &nav_meas[i]->tot, | ||
nav_meas[i]->sat_pos, nav_meas[i]->sat_vel, | ||
|
@@ -860,6 +860,18 @@ int nav_meas_cmp(const void *a, const void *b) | |
((navigation_measurement_t*)b)->sid); | ||
} | ||
|
||
bool calculate_loss_of_lock(double dt, u32 prev_lock_time, u32 curr_lock_time) { | ||
if (prev_lock_time > curr_lock_time) return true; | ||
else if ((prev_lock_time == curr_lock_time) && (dt >= prev_lock_time)) return true; | ||
else if ((prev_lock_time == curr_lock_time) && (dt < prev_lock_time)) return false; | ||
else if ((prev_lock_time < curr_lock_time) && \ | ||
(dt >= (2 * curr_lock_time - prev_lock_time))) return true; | ||
else if ((prev_lock_time < curr_lock_time) && \ | ||
(curr_lock_time < dt && dt < (2 * curr_lock_time - prev_lock_time))) return true; | ||
else if ((prev_lock_time < curr_lock_time) && (dt <= curr_lock_time)) return false; | ||
else return true; | ||
} | ||
|
||
/** Set measurement precise Doppler using time difference of carrier phase. | ||
* \note The return array `m_tdcp` should have space to contain the number | ||
* of measurements with common PRNs between `m_new` and `m_old`. Making the | ||
|
@@ -899,6 +911,14 @@ u8 tdcp_doppler(u8 n_new, navigation_measurement_t *m_new, | |
/* Re-apply the same correction to the raw Doppler to get the corrected Doppler. */ | ||
m_corrected[n].doppler = (m_new[i].carrier_phase - m_old[j].carrier_phase) | ||
/ dt + dopp_corr; | ||
m_corrected[n].lock_time = m_new[i].lock_time; | ||
m_corrected[n].lock_counter = m_old[j].lock_counter; | ||
/* set the lock_counter according to whether a slip could have occured */ | ||
if (calculate_loss_of_lock(dt*1000.0, m_old[j].lock_time, m_new[i].lock_time)) { | ||
log_info("tdcp %u:%u, dt %f", m_new[i].lock_time, m_old[j].lock_time, dt*1000.0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be space around * |
||
m_corrected[n].lock_counter = m_new[i].lock_counter + 1; | ||
m_new[i].lock_counter += 1; | ||
} | ||
n++; | ||
} | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be space around *