Go to the documentation of this file.
30 using namespace gtsam;
37 static const double ms = 1
e-3;
38 static const double cm = 1
e-2;
57 const double height = 0.5;
58 vector<Point3> sensors;
59 sensors.push_back(
Point3(0, 0, height));
60 sensors.push_back(
Point3(403 *
cm, 0, height));
61 sensors.push_back(
Point3(403 *
cm, 403 *
cm, height));
62 sensors.push_back(
Point3(0, 403 *
cm, 2 * height));
71 size_t K = sensors.size();
72 vector<double> simulatedTOA(
K);
74 for (
size_t i = 0;
i <
K;
i++) {
75 simulatedTOA[
i] = toa(groundTruthEvent, sensors[
i]);
81 for (
size_t i = 0;
i <
K;
i++) {
89 delta << 0.1, 0.1, -0.1, 0.1;
91 initialEstimate.
insert(
key, estimatedEvent);
95 params.setAbsoluteErrorTol(1
e-10);
static int runAllTests(TestResult &result)
static const Point3 sensorAt0(0, 0, 0)
virtual const Values & optimize()
Array< double, 1, 3 > e(1./3., 0.5, 2.)
#define EXPECT_LONGS_EQUAL(expected, actual)
#define EXPECT(condition)
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
static const SmartProjectionParams params
Time of arrival to given sensor.
Expression< Point3 > Point3_
const ValueType at(Key j) const
static SharedNoiseModel model(noiseModel::Isotropic::Sigma(1, 0.5 *ms))
Some functions to compute numerical derivatives.
Common expressions, both linear and non-linear.
Event retract(const Vector4 &v) const
Updates a with tangent space delta.
static const Event exampleEvent(timeOfEvent, 1, 0, 0)
A "Time of Arrival" factor - so little code seems hardly worth it :-)
noiseModel::Base::shared_ptr SharedNoiseModel
const gtsam::Symbol key('X', 0)
static const double timeOfEvent
Factor Graph consisting of non-linear factors.
void insert(Key j, const Value &val)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
NonlinearFactorGraph graph
std::uint64_t Key
Integer nonlinear key type.
Expression< Event > Event_
static Point2 measurement(323.0, 240.0)
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:08:47