From 92bdd2b43c60cead7d60b2ee159beff135e2334e Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Wed, 7 Sep 2011 01:57:57 +0000 Subject: [PATCH] Documentation --- gtsam/slam/simulated2DOriented.h | 37 +++++++++++++++++--------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/gtsam/slam/simulated2DOriented.h b/gtsam/slam/simulated2DOriented.h index 420be1819..cbbc23bfe 100644 --- a/gtsam/slam/simulated2DOriented.h +++ b/gtsam/slam/simulated2DOriented.h @@ -16,7 +16,6 @@ */ // \callgraph - #pragma once #include @@ -31,42 +30,43 @@ namespace gtsam { // The types that take an oriented pose2 rather than point2 typedef TypedSymbol PointKey; - typedef TypedSymbol PoseKey; + typedef TypedSymbol PoseKey; typedef LieValues PoseValues; typedef LieValues PointValues; typedef TupleValues2 Values; //TODO:: point prior is not implemented right now - /** - * Prior on a single pose, and optional derivative version - */ + /// Prior on a single pose inline Pose2 prior(const Pose2& x) { return x; } + + /// Prior on a single pose, optional derivative version Pose2 prior(const Pose2& x, boost::optional H = boost::none); - /** - * odometry between two poses, and optional derivative version - */ + /// odometry between two poses inline Pose2 odo(const Pose2& x1, const Pose2& x2) { return x1.between(x2); } + + /// odometry between two poses, optional derivative version Pose2 odo(const Pose2& x1, const Pose2& x2, boost::optional H1 = boost::none, boost::optional H2 = boost::none); - /** - * Unary factor encoding a soft prior on a vector - */ + /// Unary factor encoding a soft prior on a vector template struct GenericPosePrior: public NonlinearFactor1 { - Pose2 z_; + Pose2 z_; ///< measurement - GenericPosePrior(const Pose2& z, const SharedNoiseModel& model, const Key& key) : - NonlinearFactor1 (model, key), z_(z) { + /// Create generic pose prior + GenericPosePrior(const Pose2& z, const SharedNoiseModel& model, + const Key& key) : + NonlinearFactor1(model, key), z_(z) { } + /// Evaluate error and optionally derivative Vector evaluateError(const Pose2& x, boost::optional H = boost::none) const { return z_.logmap(prior(x, H)); @@ -81,13 +81,16 @@ namespace gtsam { struct GenericOdometry: public NonlinearFactor2 { Pose2 z_; + /// Create generic odometry factor GenericOdometry(const Pose2& z, const SharedNoiseModel& model, const KEY& i1, const KEY& i2) : - NonlinearFactor2 (model, i1, i2), z_(z) { + NonlinearFactor2(model, i1, i2), z_(z) { } - Vector evaluateError(const Pose2& x1, const Pose2& x2, boost::optional< - Matrix&> H1 = boost::none, boost::optional H2 = boost::none) const { + /// Evaluate error and optionally derivative + Vector evaluateError(const Pose2& x1, const Pose2& x2, + boost::optional H1 = boost::none, + boost::optional H2 = boost::none) const { return z_.logmap(odo(x1, x2, H1, H2)); }