Skip to content
Snippets Groups Projects
Commit 5b7b8bb0 authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

improving tdcp

parent 58c0e8e4
No related branches found
No related tags found
3 merge requests!20new tag,!19new tag,!17Resolve "TDCP batch implementation"
...@@ -34,8 +34,9 @@ TdcpOutput Tdcp(SnapshotPtr snapshot_r, ...@@ -34,8 +34,9 @@ TdcpOutput Tdcp(SnapshotPtr snapshot_r,
auto nav_k = snapshot_k->getNavigation(); auto nav_k = snapshot_k->getNavigation();
if (tdcp_params.tdcp.use_old_nav) if (tdcp_params.tdcp.use_old_nav)
{ {
snapshot_k->getSatellites().clear(); auto new_snapshot_k = std::make_shared<Snapshot>(std::make_shared<Observations>(*snapshot_k->getObservations()),
snapshot_k->setNavigation(snapshot_r->getNavigation()); std::make_shared<Navigation>(*snapshot_k->getNavigation()));
snapshot_k = new_snapshot_k;
} }
// COMPUTE SATELLITES POSITION // COMPUTE SATELLITES POSITION
...@@ -44,36 +45,35 @@ TdcpOutput Tdcp(SnapshotPtr snapshot_r, ...@@ -44,36 +45,35 @@ TdcpOutput Tdcp(SnapshotPtr snapshot_r,
if (not snapshot_k->satellitesComputed()) if (not snapshot_k->satellitesComputed())
snapshot_k->computeSatellites(opt.sateph); snapshot_k->computeSatellites(opt.sateph);
// FILTER SATELLITES (ALREADY DISCARDED, CORRUPTED DATA, WRONG POSITION, CONSTELLATION, ELEVATION and SNR)
snapshot_r->filterObservations(discarded_sats, x_r, false, true, opt);
snapshot_k->filterObservations(discarded_sats, x_r, false, true, opt);
// COMPUTE RANGES // COMPUTE RANGES
if (not snapshot_r->rangesComputed()) if (not snapshot_r->rangesComputed())
snapshot_r->computeRanges(x_r, opt); snapshot_r->computeRanges(x_r, opt);
if (not snapshot_k->rangesComputed()) if (not snapshot_k->rangesComputed())
snapshot_k->computeRanges(x_r, opt); // the x_r is only used to compute Azels -> corrections snapshot_k->computeRanges(x_r, opt); // the x_r is only used to compute Azels -> corrections
// FILTER SATELLITES (ALREADY DISCARDED, CORRUPTED DATA, WRONG POSITION, CONSTELLATION, ELEVATION and SNR)
snapshot_r->filterObservations(discarded_sats, x_r, false, true, opt);
snapshot_k->filterObservations(discarded_sats, x_r, false, true, opt);
// FIND COMMON SATELLITES // FIND COMMON SATELLITES
std::set<int> common_sats = Range::findCommonSatellites(snapshot_r->getRanges(), std::set<int> common_sats = Range::findCommonSatellites(snapshot_r->getRanges(),
snapshot_k->getRanges()); snapshot_k->getRanges());
// COMPUTE TDCP if (common_sats.empty())
TdcpOutput output = Tdcp(snapshot_r,
snapshot_k,
x_r,
common_sats,
d_0,
tdcp_params);
// UNDO temporary change navigation
if (tdcp_params.tdcp.use_old_nav)
{ {
snapshot_k->setNavigation(nav_k); TdcpOutput output;
snapshot_k->computeSatellites(opt.sateph); output.success = false;
output.msg = "No common satellites after filtering observations.";
return output;
} }
return output; // COMPUTE TDCP
return Tdcp(snapshot_r,
snapshot_k,
x_r,
common_sats,
d_0,
tdcp_params);
} }
TdcpOutput Tdcp(SnapshotPtr snapshot_r, TdcpOutput Tdcp(SnapshotPtr snapshot_r,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment