Isis 3 Programmer Reference
LidarControlPoint.cpp
1#include "LidarControlPoint.h"
2
3#include <QString>
4#include <QVector>
5
6#include "Camera.h"
7#include "CameraDistortionMap.h"
8#include "CameraFocalPlaneMap.h"
9#include "CameraGroundMap.h"
10#include "ControlMeasure.h"
11#include "ControlPoint.h"
12#include "Cube.h"
13#include "IException.h"
14#include "iTime.h"
15
16using namespace std;
17
18namespace Isis {
19
20
33
34
45
46
59
60
67 if (IsEditLocked()) {
69 }
70 m_range = range;
72 }
73
74
87
88
98
99
106 return m_range;
107 }
108
109
116 return m_time;
117 }
118
119
126 return m_sigmaRange;
127 }
128
129
138
139
147 bool LidarControlPoint::isSimultaneous(QString serialNumber) {
148
149 if (m_snSimultaneous->contains(serialNumber)) {
150 return true;
151 }
152
153 return false;
154 }
155
156
170 if (IsIgnored()) {
171 return Failure;
172 }
173
175
176 double newSampleDistorted = 0.0;
177 double newLineDistorted = 0.0;
178
179 // Loop for each measure to compute the error
180 QList<QString> keys = measures->keys();
181
182 for (int j = 0; j < keys.size(); j++) {
183 ControlMeasure *measure = (*measures)[keys[j]];
184 if (measure->IsIgnored()) {
185 continue;
186 }
187
188 // back project the adjusted surface point with SPICE updated from current bundle iteration
189 Camera* camera = measure->Camera();
190 if (camera->SetGround(GetAdjustedSurfacePoint())) {
191 newSampleDistorted = camera->Sample();
192 newLineDistorted = camera->Line();
193 measure->SetRejected(false);
194 }
195 // what happens if SetGround fails (e.g. if back-projection is off the image?
196 else {
197 measure->SetRejected(true);
198 measure->SetResidual(0.0, 0.0);
199 continue;
200 }
201
202 // set measures sample, line to the back-projected location
203 measure->SetCoordinate(newSampleDistorted, newLineDistorted);
204
205 double measuredUndistortedFPx = camera->DistortionMap()->UndistortedFocalPlaneX();
206 double measuredUndistortedFPy = camera->DistortionMap()->UndistortedFocalPlaneY();
207 measure->SetFocalPlaneMeasured(measuredUndistortedFPx,measuredUndistortedFPy);
208 measure->SetFocalPlaneComputed(measuredUndistortedFPx, measuredUndistortedFPy);
209
210 measure->SetResidual(0.0, 0.0);
211 }
212
213 return Success;
214 }
215}
double UndistortedFocalPlaneX() const
Gets the x-value in the undistorted focal plane coordinate system.
double UndistortedFocalPlaneY() const
Gets the y-value in the undistorted focal plane coordinate system.
virtual double Line() const
Returns the current line number.
Definition Camera.cpp:2740
Camera(Cube &cube)
Constructs the Camera object.
Definition Camera.cpp:56
virtual double Sample() const
Returns the current sample number.
Definition Camera.cpp:2720
CameraDistortionMap * DistortionMap()
Returns a pointer to the CameraDistortionMap object.
Definition Camera.cpp:2856
virtual bool SetGround(Latitude latitude, Longitude longitude)
Sets the lat/lon values to get the sample/line values.
Definition Camera.cpp:403
a control measurement
Status
This is a return status for many of the mutating (setter) method calls.
@ PointLocked
This is returned when the operation requires Edit Lock to be false but it is currently true.
@ Success
This is returned when the operation successfully took effect.
@ Failure
This is returned when an operation cannot be performed due to a problem such as the point is ignored ...
void PointModified()
List of Control Measures.
LidarControlPoint()
Constructs a LidarControlPoint with the given time, range, and sigma range.
ControlPoint::Status ComputeResiduals()
TODO: clean up code and document why this is different from the ComputeResiduals method for a normal ...
QStringList * m_snSimultaneous
serial number(s) of simultaneous image(s)
double range()
Returns the range of the point.
bool isSimultaneous(QString serialNumber)
Determines if input serial number is in list of simultaneous measure serial numbers.
double m_sigmaRange
range sigma
iTime time()
Returns the time of the point.
ControlPoint::Status setTime(iTime time)
Set the time of the LidarControlPoint.
ControlPoint::Status addSimultaneous(QString newSerial)
Add a measure to the list of simultaneous images of a LidarControlPoint.
double sigmaRange()
Returns the sigma range of the point.
ControlPoint::Status setRange(double range)
Set the range of the LidarControlPoint.
ControlPoint::Status setSigmaRange(double sigmaRange)
Sets the sigma range.
iTime m_time
time lidar point was acquired
QStringList snSimultaneous() const
Returns the list of serial numbers of simultaneous images of the Lidar point.
Parse and return pieces of a time string.
Definition iTime.h:65
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
Namespace for the standard library.