Loading...
Searching...
No Matches
ExpressionFactorGraph.h
Go to the documentation of this file.
/* ----------------------------------------------------------------------------
* 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
* -------------------------------------------------------------------------- */
#pragma once
#include <gtsam/nonlinear/ExpressionFactor.h>
#include <gtsam/nonlinear/NonlinearFactorGraph.h>
namespace gtsam {
class ExpressionFactorGraph: public NonlinearFactorGraph {
public:
template<typename T>
void addExpressionFactor(const Expression<T>& h, const T& z,
const SharedNoiseModel& R) {
using F = ExpressionFactor<T>;
push_back(boost::allocate_shared<F>(Eigen::aligned_allocator<F>(), R, z, h));
}
};
}
NonlinearFactorGraph.h
Factor Graph consisting of non-linear factors.
gtsam
Global functions in a separate testing namespace.
Definition chartTesting.h:28
gtsam::SharedNoiseModel
noiseModel::Base::shared_ptr SharedNoiseModel
Aliases.
Definition NoiseModel.h:724
gtsam::FactorGraph< NonlinearFactor >::push_back
IsDerived< DERIVEDFACTOR > push_back(boost::shared_ptr< DERIVEDFACTOR > factor)
Definition FactorGraph.h:186
gtsam::ExpressionFactor
Factor that supports arbitrary expressions via AD.
Definition ExpressionFactor.h:44
gtsam::Expression
Expression class that supports automatic differentiation.
Definition Expression.h:48
gtsam::ExpressionFactorGraph
Factor graph that supports adding ExpressionFactors directly.
Definition ExpressionFactorGraph.h:29
gtsam::ExpressionFactorGraph::addExpressionFactor
void addExpressionFactor(const Expression< T > &h, const T &z, const SharedNoiseModel &R)
Directly add ExpressionFactor that implements |h(x)-z|^2_R.
Definition ExpressionFactorGraph.h:43
gtsam::NonlinearFactorGraph::NonlinearFactorGraph
NonlinearFactorGraph()
Default constructor.
Definition NonlinearFactorGraph.h:67