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
add raim_flag to gnss_solution, return raim flag in dgnss_baseline #201
Open
kovach
wants to merge
6
commits into
swift-nav:master
Choose a base branch
from
kovach:raim_fix
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
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
eff3d24
add raim_flag to gnss_solution, clarify dgnss_baseline
kovach ca46098
added flag accessors
kovach 8d2298e
add baseline solution struct, move flag logic out to piksi_firmware
kovach 7b855dc
fix baseline, doxygen
kovach 8567d62
PR comments
kovach d15cf63
not static
kovach 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
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 |
---|---|---|
|
@@ -395,6 +395,14 @@ void dgnss_update_ambiguity_state(ambiguity_state_t *s) | |
} | ||
} | ||
|
||
/* Interpret raim-related content of baseline function return code. */ | ||
void fill_property_flags(s8 ret, bool fixed, dgnss_baseline_t *solution) | ||
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. This looks like a helper function not useful outside of this file. Make it static and remove from the header. |
||
{ | ||
solution->raim_repair = ret == 1; | ||
solution->raim_available = ret != 2; | ||
solution->fixed_mode = fixed; | ||
} | ||
|
||
/** Finds the baseline using low latency sdiffs. | ||
* The low latency sdiffs are not guaranteed to match up with either the | ||
* amb_test's or the float sdiffs, and thus care must be taken to transform them | ||
|
@@ -405,42 +413,51 @@ void dgnss_update_ambiguity_state(ambiguity_state_t *s) | |
* \param ref_ecef The referece position for the baseline. | ||
* (TODO is this the local or remote receiver position?) | ||
* \param s Current ambiguity test state. | ||
* \param num_used Output number of sdiffs actually used in the baseline | ||
* estimate. | ||
* \param b Output baseline. | ||
* \param solution struct containing output baseline, num sdiffs used, | ||
* fixed mode, raim availability, whether raim was used. | ||
* \param disable_raim Flag to turn off raim checks/repair. | ||
* \param raim_threshold raim check threshold | ||
* \return 1 if we are using an IAR resolved baseline. | ||
* 2 if we are using a float baseline. | ||
* -1 if we can't give a baseline. | ||
* \return 0: solution ok | ||
* negative value: baseline error code | ||
*/ | ||
s8 dgnss_baseline(u8 num_sdiffs, const sdiff_t *sdiffs, | ||
const double ref_ecef[3], const ambiguity_state_t *s, | ||
u8 *num_used, double b[3], | ||
dgnss_baseline_t *solution, | ||
bool disable_raim, double raim_threshold) | ||
{ | ||
s8 ret = baseline(num_sdiffs, sdiffs, ref_ecef, &s->fixed_ambs, num_used, b, | ||
disable_raim, raim_threshold); | ||
s8 ret; | ||
|
||
/* Try IAR resolved baseline */ | ||
ret = baseline(num_sdiffs, sdiffs, ref_ecef, &s->fixed_ambs, | ||
&solution->num_used, solution->b, | ||
disable_raim, raim_threshold); | ||
if (ret >= 0) { | ||
if (ret == 1) /* TODO: Export this rather than just printing */ | ||
if (ret == 1) | ||
log_warn("dgnss_baseline: Fixed baseline RAIM repair"); | ||
log_debug("fixed solution"); | ||
DEBUG_EXIT(); | ||
return 1; | ||
fill_property_flags(ret, true, solution); | ||
return 0; | ||
} | ||
|
||
/* We weren't able to get an IAR resolved baseline, check if we can get a | ||
* float baseline. */ | ||
if ((ret = baseline(num_sdiffs, sdiffs, ref_ecef, &s->float_ambs, num_used, b, | ||
disable_raim, raim_threshold)) | ||
>= 0) { | ||
if (ret == 1) /* TODO: Export this rather than just printing */ | ||
ret = baseline(num_sdiffs, sdiffs, ref_ecef, &s->float_ambs, | ||
&solution->num_used, solution->b, | ||
disable_raim, raim_threshold); | ||
if (ret >= 0) { | ||
if (ret == 1) | ||
log_warn("dgnss_baseline: Float baseline RAIM repair"); | ||
log_debug("float solution"); | ||
DEBUG_EXIT(); | ||
return 2; | ||
fill_property_flags(ret, false, solution); | ||
return 0; | ||
} | ||
log_debug("no baseline solution"); | ||
DEBUG_EXIT(); | ||
|
||
/* Must be negative! */ | ||
assert(ret < 0); | ||
return ret; | ||
} | ||
|
||
|
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
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
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.
why not
bool
?