gtsam/gtsam_unstable/slam/TOAFactor.h

64 lines
2.1 KiB
C
Raw Normal View History

2014-12-11 05:50:41 +08:00
/* ----------------------------------------------------------------------------
2019-02-11 22:39:48 +08:00
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
2014-12-11 05:50:41 +08:00
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
/**
* @file TOAFactor.h
* @brief "Time of Arrival" factor
* @author Frank Dellaert
* @author Jay Chakravarty
* @date December 2014
*/
2020-03-18 02:34:11 +08:00
#pragma once
2016-04-11 10:01:14 +08:00
#include <gtsam/nonlinear/ExpressionFactor.h>
2014-12-11 05:50:41 +08:00
#include <gtsam_unstable/geometry/Event.h>
namespace gtsam {
/// A "Time of Arrival" factor - so little code seems hardly worth it :-)
2020-03-18 02:34:11 +08:00
class TOAFactor : public ExpressionFactor<double> {
2016-04-11 10:01:14 +08:00
typedef Expression<double> Double_;
2014-12-11 05:50:41 +08:00
2020-03-18 02:34:11 +08:00
public:
2014-12-11 05:50:41 +08:00
/**
2020-03-18 02:34:11 +08:00
* Most genral constructor with two expressions
* @param eventExpression expression yielding an event
* @param sensorExpression expression yielding a sensor location
* @param toaMeasurement time of arrival at sensor
2014-12-11 05:50:41 +08:00
* @param model noise model
2020-03-18 02:34:11 +08:00
* @param toa optional time of arrival functor
2014-12-11 05:50:41 +08:00
*/
TOAFactor(const Expression<Event>& eventExpression,
2020-03-18 02:34:11 +08:00
const Expression<Point3>& sensorExpression, double toaMeasurement,
const SharedNoiseModel& model,
const TimeOfArrival& toa = TimeOfArrival())
: ExpressionFactor<double>(
model, toaMeasurement,
Double_(toa, eventExpression, sensorExpression)) {}
2014-12-11 05:50:41 +08:00
2020-03-18 02:34:11 +08:00
/**
* Constructor with fixed sensor
* @param eventExpression expression yielding an event
* @param sensor a known sensor location
* @param toaMeasurement time of arrival at sensor
* @param model noise model
* @param toa optional time of arrival functor
*/
TOAFactor(const Expression<Event>& eventExpression, const Point3& sensor,
double toaMeasurement, const SharedNoiseModel& model,
const TimeOfArrival& toa = TimeOfArrival())
: TOAFactor(eventExpression, Expression<Point3>(sensor), toaMeasurement,
model, toa) {}
2014-12-11 05:50:41 +08:00
};
2020-03-18 02:34:11 +08:00
} // namespace gtsam