examples folder
parent
0873ad628e
commit
236c02eb52
|
@ -105,7 +105,7 @@ int main(int argc, char* argv[]) {
|
||||||
Values currentEstimate = isam.calculateEstimate();
|
Values currentEstimate = isam.calculateEstimate();
|
||||||
currentEstimate.print("Current estimate: ");
|
currentEstimate.print("Current estimate: ");
|
||||||
|
|
||||||
boost::optional<Point3> pointEstimate = smartFactor->point(currentEstimate);
|
auto pointEstimate = smartFactor->point(currentEstimate);
|
||||||
if (pointEstimate) {
|
if (pointEstimate) {
|
||||||
cout << *pointEstimate << endl;
|
cout << *pointEstimate << endl;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -116,7 +116,7 @@ int main(int argc, char* argv[]) {
|
||||||
if (smart) {
|
if (smart) {
|
||||||
// The output of point() is in boost::optional<Point3>, as sometimes
|
// The output of point() is in boost::optional<Point3>, as sometimes
|
||||||
// the triangulation operation inside smart factor will encounter degeneracy.
|
// the triangulation operation inside smart factor will encounter degeneracy.
|
||||||
boost::optional<Point3> point = smart->point(result);
|
auto point = smart->point(result);
|
||||||
if (point) // ignore if boost::optional return nullptr
|
if (point) // ignore if boost::optional return nullptr
|
||||||
landmark_result.insert(j, *point);
|
landmark_result.insert(j, *point);
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,17 +131,17 @@ int main(int argc, char* argv[]) {
|
||||||
AddNoiseToMeasurements(measurements, measurementSigma);
|
AddNoiseToMeasurements(measurements, measurementSigma);
|
||||||
|
|
||||||
auto lostStart = std::chrono::high_resolution_clock::now();
|
auto lostStart = std::chrono::high_resolution_clock::now();
|
||||||
boost::optional<Point3> estimateLOST = triangulatePoint3<Cal3_S2>(
|
auto estimateLOST = triangulatePoint3<Cal3_S2>(
|
||||||
cameras, noisyMeasurements, rank_tol, false, measurementNoise, true);
|
cameras, noisyMeasurements, rank_tol, false, measurementNoise, true);
|
||||||
durationLOST += std::chrono::high_resolution_clock::now() - lostStart;
|
durationLOST += std::chrono::high_resolution_clock::now() - lostStart;
|
||||||
|
|
||||||
auto dltStart = std::chrono::high_resolution_clock::now();
|
auto dltStart = std::chrono::high_resolution_clock::now();
|
||||||
boost::optional<Point3> estimateDLT = triangulatePoint3<Cal3_S2>(
|
auto estimateDLT = triangulatePoint3<Cal3_S2>(
|
||||||
cameras, noisyMeasurements, rank_tol, false, measurementNoise, false);
|
cameras, noisyMeasurements, rank_tol, false, measurementNoise, false);
|
||||||
durationDLT += std::chrono::high_resolution_clock::now() - dltStart;
|
durationDLT += std::chrono::high_resolution_clock::now() - dltStart;
|
||||||
|
|
||||||
auto dltOptStart = std::chrono::high_resolution_clock::now();
|
auto dltOptStart = std::chrono::high_resolution_clock::now();
|
||||||
boost::optional<Point3> estimateDLTOpt = triangulatePoint3<Cal3_S2>(
|
auto estimateDLTOpt = triangulatePoint3<Cal3_S2>(
|
||||||
cameras, noisyMeasurements, rank_tol, true, measurementNoise, false);
|
cameras, noisyMeasurements, rank_tol, true, measurementNoise, false);
|
||||||
durationDLTOpt += std::chrono::high_resolution_clock::now() - dltOptStart;
|
durationDLTOpt += std::chrono::high_resolution_clock::now() - dltOptStart;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue