-
Notifications
You must be signed in to change notification settings - Fork 111
WIP: Add Iono correction #686
Conversation
|
Test FAILed. |
|
Not sure how far away the nav DB stuff is. But in the meantime a static variable in pvt.c with appropriate mutex would be good enough to allow testing the ionosphere correction. |
|
@ljbade yes, since NDB not merged yet I use store/read API in new file iono.c, by analogy to l2c capability. |
|
Test FAILed. |
|
@dt-exafore Yeah there is a non raw The non-raw field is for use with PVT calculations and includes other corrections such as the satellite clock error. The raw field is for RTK and should be left as is. I can see two possible places to apply the correction either I think the best choice will be wherever it is easiest to pass in the prior PVT position solution which will be needed as input into the tropo and iono model. |
|
@ljbade Could you please check the output of calc_ionosphere function I have using latest changes? My expectation was about 30-40 meters. |
|
Test FAILed. |
|
@dt-exafore that seems way too high, what are the alpha/beta parameter values? |
src/iono.c
Outdated
| { | ||
| assert(ch_id < NUM_TRACKER_CHANNELS); | ||
| assert(params != NULL); | ||
| memcpy(&iono_params[ch_id], params, sizeof(ionosphere_t)); |
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.
I think this will need a mutex to prevent store and read functions being called at same time.
|
Test FAILed. |
src/solution.c
Outdated
| double az, el, iono_correction; | ||
| /* read iono parameters for the tracking channel if available */ | ||
| if (gps_iono_params_read(&iono_params)) { | ||
| wgsecef2azel(nav_meas[i].sat_pos, position_solution.pos_ecef, |
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.
This should use nav_meas_tdcp
|
Latest tests results |
|
Test FAILed. |
|
@nsirola, please also review. |
src/solution.c
Outdated
| / GPS_C; | ||
| log_info("CP corr %u: %30.20f", i, cp_correction); | ||
| nav_meas_tdcp[i].carrier_phase += cp_correction; | ||
| nav_meas_tdcp[i].carrier_phase -= cp_correction; |
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.
I think it would also be wise to add a comment that the sign here is opposite to normal due to Piksi's unusual sign convention on carrier phase.
In case this confuses anyone.
|
Looks good to me. |
|
Test FAILed. |
|
Measurements during tests: |
|
Test FAILed. |
|
When L2C tracking is completed, the iono corrections will need to be adjusted for the different carrier frequencies. There is a formula to convert from the L1 Klobuchar correction, to any other frequency: Also the carrier phase adjustments will need to use the carrier frequency of each signal. |
src/solution.c
Outdated
| /* calculate tropo correction */ | ||
| tropo_correction = calc_troposphere(&nav_meas_tdcp[i].tot, | ||
| position_solution.pos_llh[0], | ||
| position_solution.pos_llh[2], |
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.
I think there should also be a note that we are currently using the ellipsoidal height as an approximation to the orthometric (or geoid) height due to lack of a geoid model.
|
Having some compile problems. The PR needs to be rebased on master. Also libswiftnav submodule needs to updated. |
src/solution.c
Outdated
| ionosphere_t iono_params; | ||
| double az, el, iono_correction, tropo_correction, cp_correction; | ||
| /* read iono parameters for the tracking channel if available */ | ||
| if (gps_iono_params_read(&iono_params)) { |
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.
This check should only wrap calc_ionosphere as calc_troposphere does not need the iono params.
…si_firmware into test
…firmware into test
|
Test FAILed. |
|
Test FAILed. |
|
Test FAILed. |
|
moved to private (swift-nav/piksi_firmware_private#16) and closed |

This adds iono correction.
Note, iono parameter decoder should be merged first https://github.com/swift-nav/libswiftnav-private/pull/8