Fix for issue #38 (gcc specific issue, but fix works for all)
parent
87ab40d48d
commit
692959f0f3
|
@ -13,7 +13,6 @@
|
||||||
#include <gtsam/nonlinear/NonlinearFactor.h>
|
#include <gtsam/nonlinear/NonlinearFactor.h>
|
||||||
#include <gtsam/inference/Key.h>
|
#include <gtsam/inference/Key.h>
|
||||||
#include <gtsam/geometry/Pose2.h>
|
#include <gtsam/geometry/Pose2.h>
|
||||||
#include <gtsam/base/timing.h>
|
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
@ -89,7 +88,6 @@ class SmartRangeFactor: public NoiseModelFactor {
|
||||||
* Raise runtime_error if not well defined.
|
* Raise runtime_error if not well defined.
|
||||||
*/
|
*/
|
||||||
Point2 triangulate(const Values& x) const {
|
Point2 triangulate(const Values& x) const {
|
||||||
// gttic_(triangulate);
|
|
||||||
// create n circles corresponding to measured range around each pose
|
// create n circles corresponding to measured range around each pose
|
||||||
std::list<Circle2> circles;
|
std::list<Circle2> circles;
|
||||||
size_t n = size();
|
size_t n = size();
|
||||||
|
@ -100,7 +98,7 @@ class SmartRangeFactor: public NoiseModelFactor {
|
||||||
|
|
||||||
Circle2 circle1 = circles.front();
|
Circle2 circle1 = circles.front();
|
||||||
boost::optional<Point2> best_fh;
|
boost::optional<Point2> best_fh;
|
||||||
boost::optional<Circle2> bestCircle2;
|
auto bestCircle2 = boost::make_optional(false, circle1); // fixes issue #38
|
||||||
|
|
||||||
// loop over all circles
|
// loop over all circles
|
||||||
for (const Circle2& it : circles) {
|
for (const Circle2& it : circles) {
|
||||||
|
@ -136,7 +134,6 @@ class SmartRangeFactor: public NoiseModelFactor {
|
||||||
} else {
|
} else {
|
||||||
throw std::runtime_error("triangulate failed");
|
throw std::runtime_error("triangulate failed");
|
||||||
}
|
}
|
||||||
// gttoc_(triangulate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue