Dummy version of a generic linear factor to be injected into a nonlinear factor graph.
This factor does have the ability to perform relinearization under small-angle and linearity assumptions if a linearization point is added.
|
| LinearContainerFactor () |
| Default constructor - necessary for serialization.
|
|
GTSAM_EXPORT | LinearContainerFactor (const JacobianFactor &factor, const Values &linearizationPoint=Values()) |
| Primary constructor: store a linear factor with optional linearization point.
|
|
GTSAM_EXPORT | LinearContainerFactor (const HessianFactor &factor, const Values &linearizationPoint=Values()) |
| Primary constructor: store a linear factor with optional linearization point.
|
|
GTSAM_EXPORT | LinearContainerFactor (const GaussianFactor::shared_ptr &factor, const Values &linearizationPoint=Values()) |
| Constructor from shared_ptr.
|
|
const GaussianFactor::shared_ptr & | factor () const |
|
GTSAM_EXPORT void | print (const std::string &s="", const KeyFormatter &keyFormatter=gtsam::DefaultKeyFormatter) const override |
| print More...
|
|
GTSAM_EXPORT bool | equals (const NonlinearFactor &f, double tol=1e-9) const override |
| Check if two factors are equal. More...
|
|
GTSAM_EXPORT double | error (const Values &c) const override |
| Calculate the nonlinear error for the factor, where the error is computed by passing the delta between linearization point and c, where delta = linearizationPoint_.localCoordinates(c), into the error function of the stored linear factor. More...
|
|
GTSAM_EXPORT size_t | dim () const override |
| get the dimension of the factor: rows of linear factor More...
|
|
const boost::optional< Values > & | linearizationPoint () const |
| Extract the linearization point used in recalculating error.
|
|
GTSAM_EXPORT GaussianFactor::shared_ptr | linearize (const Values &c) const override |
| Linearize to a GaussianFactor, with method depending on the presence of a linearizationPoint. More...
|
|
GTSAM_EXPORT GaussianFactor::shared_ptr | negateToGaussian () const |
| Creates an anti-factor directly.
|
|
GTSAM_EXPORT NonlinearFactor::shared_ptr | negateToNonlinear () const |
| Creates the equivalent anti-factor as another LinearContainerFactor.
|
|
NonlinearFactor::shared_ptr | clone () const override |
| Creates a shared_ptr clone of the factor - needs to be specialized to allow for subclasses. More...
|
|
NonlinearFactor::shared_ptr | rekey (const std::map< Key, Key > &rekey_mapping) const override |
| Creates a shared_ptr clone of the factor with different keys using a map from old->new keys. More...
|
|
NonlinearFactor::shared_ptr | rekey (const KeyVector &new_keys) const override |
| Clones a factor and fully replaces its keys. More...
|
|
bool | hasLinearizationPoint () const |
| Casting syntactic sugar.
|
|
GTSAM_EXPORT bool | isJacobian () const |
| Simple checks whether this is a Jacobian or Hessian factor.
|
|
GTSAM_EXPORT bool | isHessian () const |
|
GTSAM_EXPORT boost::shared_ptr< JacobianFactor > | toJacobian () const |
| Casts to JacobianFactor.
|
|
GTSAM_EXPORT boost::shared_ptr< HessianFactor > | toHessian () const |
| Casts to HessianFactor.
|
|
| NonlinearFactor () |
| Default constructor for I/O only.
|
|
template<typename CONTAINER > |
| NonlinearFactor (const CONTAINER &keys) |
| Constructor from a collection of the keys involved in this factor.
|
|
void | print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override |
| print More...
|
|
virtual | ~NonlinearFactor () |
| Destructor.
|
|
virtual bool | active (const Values &) const |
| Checks whether a factor should be used based on a set of values. More...
|
|
virtual bool | sendable () const |
| Should the factor be evaluated in the same thread as the caller This is to enable factors that has shared states (like the Python GIL lock) More...
|
|
virtual | ~Factor ()=default |
| Default destructor.
|
|
KeyVector & | keys () |
|
iterator | begin () |
| Iterator at beginning of involved variable keys.
|
|
iterator | end () |
| Iterator at end of involved variable keys.
|
|
virtual void | printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const |
| print only keys More...
|
|
Key | front () const |
| First key.
|
|
Key | back () const |
| Last key.
|
|
const_iterator | find (Key key) const |
| find
|
|
const KeyVector & | keys () const |
| Access the factor's involved variable keys.
|
|
const_iterator | begin () const |
| Iterator at beginning of involved variable keys.
|
|
const_iterator | end () const |
| Iterator at end of involved variable keys.
|
|
size_t | size () const |
|
Linearize to a GaussianFactor, with method depending on the presence of a linearizationPoint.
- With no linearization point, returns a cloned version of the stored linear factor.
- With a linearization point provided, returns a relinearized version of the linearized factor.
The relinearization approach used computes a linear delta between the original linearization point and the new values c, where delta = linearizationPoint_.localCoordinates(c), and substitutes this change into the system. This substitution is only really valid for linear variable manifolds, and for any variables based on a non-commutative manifold (such as Pose2, Pose3), the relinearized version will be effective for only small angles.
TODO: better approximation of relinearization TODO: switchable modes for approximation technique
Implements gtsam::NonlinearFactor.