Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeCOAPoly is in units of meters from the ORP, not pixels from upper… #6

Merged
merged 1 commit into from
Aug 6, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions modules/c++/six.sidd/source/Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,22 @@

namespace
{
double getCenterTime(const six::sidd::DerivedData* derived)
double getCenterTime(const six::sidd::DerivedData& derived)
{
double centerTime;
if (derived->measurement->projection->isMeasurable())
if (derived.measurement->projection->isMeasurable())
{
const six::sidd::MeasurableProjection* const projection =
reinterpret_cast<const six::sidd::MeasurableProjection*>(
derived->measurement->projection.get());
derived.measurement->projection.get());

centerTime = projection->timeCOAPoly(
projection->referencePoint.rowCol.row,
projection->referencePoint.rowCol.col);
centerTime = projection->timeCOAPoly(0, 0);
}
else
{
// we estimate...
centerTime
= derived->exploitationFeatures->collections[0]->information->collectionDuration
centerTime =
derived.exploitationFeatures->collections[0]->information->collectionDuration
/ 2;
}

Expand Down Expand Up @@ -77,7 +75,7 @@ namespace sidd
scene::SideOfTrack
Utilities::getSideOfTrack(const DerivedData* derived)
{
const double centerTime = getCenterTime(derived);
const double centerTime = getCenterTime(*derived);

// compute arpPos and arpVel
const six::Vector3 arpPos = derived->measurement->arpPoly(centerTime);
Expand All @@ -92,7 +90,7 @@ Utilities::getSideOfTrack(const DerivedData* derived)
std::auto_ptr<scene::SceneGeometry>
Utilities::getSceneGeometry(const DerivedData* derived)
{
const double centerTime = getCenterTime(derived);
const double centerTime = getCenterTime(*derived);

// compute arpPos and arpVel
six::Vector3 arpPos = derived->measurement->arpPoly(centerTime);
Expand Down Expand Up @@ -298,7 +296,7 @@ void Utilities::setProductValues(Poly2D timeCOAPoly,
PolyXYZ arpPoly, ReferencePoint ref, const Vector3* row,
const Vector3* col, types::RgAz<double>res, Product* product)
{
double scpTime = timeCOAPoly(ref.rowCol.row, ref.rowCol.col);
const double scpTime = timeCOAPoly(0, 0);

Vector3 arpPos = arpPoly(scpTime);
PolyXYZ arpVelPoly = arpPoly.derivative();
Expand Down Expand Up @@ -330,7 +328,7 @@ void Utilities::setCollectionValues(Poly2D timeCOAPoly,
PolyXYZ arpPoly, ReferencePoint ref, const Vector3* row,
const Vector3* col, Collection* collection)
{
double scpTime = timeCOAPoly(ref.rowCol.row, ref.rowCol.col);
const double scpTime = timeCOAPoly(0, 0);

Vector3 arpPos = arpPoly(scpTime);
PolyXYZ arpVelPoly = arpPoly.derivative();
Expand Down