Repository navigation
Conversation
tmodeTarget held the fixed position accuracy and survey accuracy limit as float meters, a form suited to V5 CFG-TMODE, which sends them as float variances. V6 CFG-TMODE2 sends them as integer millimeters, so it converted the floats back with math.Round. Keep them as Length, convert to float meters only for V5, and convert to millimeters for V6 with integer arithmetic, so that V6 can round in a given direction without float error. V5 is unchanged; V6 differs only for some exact half-millimeter lengths from 500.5 mm up, which the float version rounded down by float error.
Receivers that store the survey accuracy limit and fixed position accuracy in coarser units than requested rounded to nearest. The survey limit is a threshold the survey must reach, so rounding it up made the survey accept a worse accuracy than requested; the fixed position accuracy is a claim about the position, so rounding it down made the receiver state a better accuracy than requested. The survey limit now rounds down, to at least one unit when positive, the strictest the receiver can express; the fixed position accuracy rounds up. Each conversion is a pair: ubx tmodeAcc and tmodeAccLimit (to 0.1 mm), tmodeAccMm and tmodeAccLimitMm (0.1 mm to mm, which gives the same result as rounding the original value once), and casic tmode2Acc and tmode2AccLimit (mm).
On receivers configured with CFG-VALSET, SurveyAgain forces a new survey by changing the survey accuracy limit by 0.1 mm when it would otherwise be unchanged. It increased the limit, so the new survey could be satisfied by a slightly worse accuracy than requested. Decrease it instead, unless it is already 0.1 mm, the strictest limit the receiver can express.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
# Conflicts: # gps/internal/ubx/ubxcfgtmode.go
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #509.
Receivers that store the survey accuracy limit and fixed position accuracy in coarser units than requested round to nearest. The survey limit is a threshold the survey must reach, so rounding it up lets the survey accept a worse accuracy than requested; the fixed position accuracy is a claim about the position, so rounding it down makes the receiver state a better accuracy than requested.
The survey limit now rounds down, to at least one unit when positive, the strictest the receiver can express; the fixed position accuracy rounds up. Each conversion is a pair: ubx
tmodeAccandtmodeAccLimit(to 0.1 mm) andtmodeAccMmandtmodeAccLimitMm(0.1 mm to mm), and casictmode2Accandtmode2AccLimit(mm). A preliminary commit keeps the casic accuracies asLengthuntil encoding, so that CFG-TMODE2 can round in a given direction without float error.A last commit applies the same rule to the ubx CFG-VALSET path's way of forcing a new survey: it changed an unchanged survey limit by increasing it 0.1 mm, and now decreases it unless it is already 0.1 mm.
make testpasses.