2010-10-14 12:54:38 +08:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
|
|
|
|
* 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
|
|
|
|
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
2009-08-22 06:23:24 +08:00
|
|
|
/**
|
|
|
|
* @file simulated2D.cpp
|
|
|
|
* @brief measurement functions and derivatives for simulated 2D robot
|
|
|
|
* @author Frank Dellaert
|
|
|
|
*/
|
|
|
|
|
2010-08-20 01:23:19 +08:00
|
|
|
#include <gtsam/slam/simulated2D.h>
|
2010-10-09 11:09:55 +08:00
|
|
|
#include <gtsam/nonlinear/LieValues-inl.h>
|
|
|
|
#include <gtsam/nonlinear/TupleValues-inl.h>
|
2009-08-22 06:23:24 +08:00
|
|
|
|
2010-01-18 13:38:53 +08:00
|
|
|
namespace gtsam {
|
2010-01-19 13:33:44 +08:00
|
|
|
|
|
|
|
using namespace simulated2D;
|
2010-08-24 03:44:17 +08:00
|
|
|
// INSTANTIATE_LIE_CONFIG(PointKey)
|
|
|
|
INSTANTIATE_LIE_CONFIG(PoseKey)
|
2010-10-09 11:09:58 +08:00
|
|
|
INSTANTIATE_TUPLE_CONFIG2(PoseValues, PointValues)
|
|
|
|
// INSTANTIATE_NONLINEAR_FACTOR_GRAPH(Values)
|
|
|
|
// INSTANTIATE_NONLINEAR_OPTIMIZER(Graph, Values)
|
2010-01-19 13:33:44 +08:00
|
|
|
|
2010-01-18 13:38:53 +08:00
|
|
|
namespace simulated2D {
|
|
|
|
|
|
|
|
static Matrix I = gtsam::eye(2);
|
|
|
|
|
|
|
|
/* ************************************************************************* */
|
2010-01-19 13:33:44 +08:00
|
|
|
Point2 prior(const Point2& x, boost::optional<Matrix&> H) {
|
2010-01-18 13:38:53 +08:00
|
|
|
if (H) *H = I;
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************************************************************* */
|
2010-01-19 13:33:44 +08:00
|
|
|
Point2 odo(const Point2& x1, const Point2& x2, boost::optional<Matrix&> H1,
|
2010-01-18 13:38:53 +08:00
|
|
|
boost::optional<Matrix&> H2) {
|
|
|
|
if (H1) *H1 = -I;
|
|
|
|
if (H2) *H2 = I;
|
|
|
|
return x2 - x1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************************************************************* */
|
2010-01-19 13:33:44 +08:00
|
|
|
Point2 mea(const Point2& x, const Point2& l, boost::optional<Matrix&> H1,
|
2010-01-18 13:38:53 +08:00
|
|
|
boost::optional<Matrix&> H2) {
|
|
|
|
if (H1) *H1 = -I;
|
|
|
|
if (H2) *H2 = I;
|
|
|
|
return l - x;
|
|
|
|
}
|
2009-08-22 06:23:24 +08:00
|
|
|
|
2010-01-14 10:50:06 +08:00
|
|
|
/* ************************************************************************* */
|
2009-08-22 06:23:24 +08:00
|
|
|
|
2010-01-18 13:38:53 +08:00
|
|
|
} // namespace simulated2D
|
|
|
|
} // namespace gtsam
|