28 #include <boost/bind.hpp> 29 #include <boost/format.hpp> 32 using namespace gtsam;
39 static const double ms = 1
e-3;
40 static const double cm = 1
e-2;
59 const double height = 0.5;
60 vector<Point3> sensors;
61 sensors.push_back(
Point3(0, 0, height));
62 sensors.push_back(
Point3(403 *
cm, 0, height));
63 sensors.push_back(
Point3(403 *
cm, 403 *
cm, height));
64 sensors.push_back(
Point3(0, 403 *
cm, 2 * height));
69 const double timeOfEvent = 0;
70 Event groundTruthEvent(timeOfEvent, 245 *
cm, 201.5 *
cm, (212 - 45) *
cm);
73 size_t K = sensors.size();
74 vector<double> simulatedTOA(K);
76 for (
size_t i = 0;
i <
K;
i++) {
77 simulatedTOA[
i] = toa(groundTruthEvent, sensors[
i]);
83 for (
size_t i = 0;
i <
K;
i++) {
91 delta << 0.1, 0.1, -0.1, 0.1;
93 initialEstimate.insert(key, estimatedEvent);
virtual const Values & optimize()
static int runAllTests(TestResult &result)
Event retract(const Vector4 &v) const
Updates a with tangent space delta.
Factor Graph consisting of non-linear factors.
static const double timeOfEvent
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
Some functions to compute numerical derivatives.
NonlinearFactorGraph graph
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&...args)
Emplace a shared pointer to factor of given type.
Expression< Event > Event_
const ValueType at(Key j) const
A "Time of Arrival" factor - so little code seems hardly worth it :-)
#define EXPECT(condition)
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static SmartStereoProjectionParams params
void setAbsoluteErrorTol(double value)
Expression< Point3 > Point3_
Time of arrival to given sensor.
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
static const Point3 sensorAt0(0, 0, 0)
#define EXPECT_LONGS_EQUAL(expected, actual)
static const Event exampleEvent(timeOfEvent, 1, 0, 0)
static SharedNoiseModel model(noiseModel::Isotropic::Sigma(1, 0.5 *ms))
std::uint64_t Key
Integer nonlinear key type.
noiseModel::Base::shared_ptr SharedNoiseModel