Public Member Functions | Private Attributes | List of all members
fuse_core::AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize > Class Template Reference

Create a local parameterization with the Jacobians computed via automatic differentiation. More...

#include <autodiff_local_parameterization.h>

Inheritance diagram for fuse_core::AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >:
Inheritance graph
[legend]

Public Member Functions

 AutoDiffLocalParameterization ()
 Constructs new PlusFunctor and MinusFunctor instances. More...
 
 AutoDiffLocalParameterization (PlusFunctor *plus_functor, MinusFunctor *minus_functor)
 Takes ownership of the provided PlusFunctor and MinusFunctor instances. More...
 
bool ComputeJacobian (const double *x, double *jacobian) const override
 The Jacobian of Plus(x, delta) w.r.t delta at delta = 0, computed using automatic differentiation. More...
 
bool ComputeMinusJacobian (const double *x, double *jacobian) const override
 The Jacobian of Minus(x1, x2) w.r.t x2 evaluated at x1 = x2 = x, computed using automatic differentiation. More...
 
 FUSE_SMART_PTR_DEFINITIONS (AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >)
 
int GlobalSize () const override
 The size of the variable parameterization in the nonlinear manifold. More...
 
int LocalSize () const override
 The size of a delta vector in the linear tangent space to the nonlinear manifold. More...
 
bool Minus (const double *x1, const double *x2, double *delta) const override
 Generalization of the subtraction operation, implemented by the provided MinusFunctor. More...
 
bool Plus (const double *x, const double *delta, double *x_plus_delta) const override
 Generalization of the addition operation, implemented by the provided PlusFunctor. More...
 
- Public Member Functions inherited from fuse_core::LocalParameterization
 FUSE_SMART_PTR_ALIASES_ONLY (LocalParameterization)
 
virtual ~LocalParameterization ()=default
 Destroy the Local Parameterization object. More...
 

Private Attributes

std::unique_ptr< MinusFunctor > minus_functor_
 
std::unique_ptr< PlusFunctor > plus_functor_
 

Detailed Description

template<typename PlusFunctor, typename MinusFunctor, int kGlobalSize, int kLocalSize>
class fuse_core::AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >

Create a local parameterization with the Jacobians computed via automatic differentiation.

To get an auto differentiated local parameterization, you must define two classes with a templated operator() (a.k.a. a functor).

The first functor should compute:

Plus(x, delta) -> x_plus_delta

And the second functor should compute the inverse operation:

Minus(x1, x2) -> delta

Minus() should be defined such that if Plus(x1, delta) -> x2, then Minus(x1, x2) -> delta

The autodiff framework substitutes appropriate "Jet" objects for the template parameter T in order to compute the derivative when necessary, but this is hidden, and you should write the function as if T were a scalar type (e.g. a double-precision floating point number).

Additionally the GlobalSize and LocalSize must be specified as template parameters.

For more information on local parameterizations, see fuse_core::LocalParameterization

Definition at line 77 of file autodiff_local_parameterization.h.

Constructor & Destructor Documentation

◆ AutoDiffLocalParameterization() [1/2]

template<typename PlusFunctor , typename MinusFunctor , int kGlobalSize, int kLocalSize>
fuse_core::AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >::AutoDiffLocalParameterization

Constructs new PlusFunctor and MinusFunctor instances.

Definition at line 155 of file autodiff_local_parameterization.h.

◆ AutoDiffLocalParameterization() [2/2]

template<typename PlusFunctor , typename MinusFunctor , int kGlobalSize, int kLocalSize>
fuse_core::AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >::AutoDiffLocalParameterization ( PlusFunctor *  plus_functor,
MinusFunctor *  minus_functor 
)

Takes ownership of the provided PlusFunctor and MinusFunctor instances.

Definition at line 162 of file autodiff_local_parameterization.h.

Member Function Documentation

◆ ComputeJacobian()

template<typename PlusFunctor , typename MinusFunctor , int kGlobalSize, int kLocalSize>
bool fuse_core::AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >::ComputeJacobian ( const double *  x,
double *  jacobian 
) const
overridevirtual

The Jacobian of Plus(x, delta) w.r.t delta at delta = 0, computed using automatic differentiation.

Parameters
[in]xThe value used to evaluate the Jacobian, of size GloblaSize()
[out]jacobianThe Jacobian in row-major order, of size GlobalSize() x LocalSize()
Returns
True is successful, false otherwise

Implements fuse_core::LocalParameterization.

Definition at line 180 of file autodiff_local_parameterization.h.

◆ ComputeMinusJacobian()

template<typename PlusFunctor , typename MinusFunctor , int kGlobalSize, int kLocalSize>
bool fuse_core::AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >::ComputeMinusJacobian ( const double *  x,
double *  jacobian 
) const
overridevirtual

The Jacobian of Minus(x1, x2) w.r.t x2 evaluated at x1 = x2 = x, computed using automatic differentiation.

Parameters
[in]xThe value used to evaluate the Jacobian, of size GlobalSize()
[out]jacobianThe Jacobian in row-major order, of size LocalSize() x GlobalSize()
Returns
True is successful, false otherwise

Implements fuse_core::LocalParameterization.

Definition at line 208 of file autodiff_local_parameterization.h.

◆ FUSE_SMART_PTR_DEFINITIONS()

template<typename PlusFunctor , typename MinusFunctor , int kGlobalSize, int kLocalSize>
fuse_core::AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >::FUSE_SMART_PTR_DEFINITIONS ( AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >  )

◆ GlobalSize()

template<typename PlusFunctor , typename MinusFunctor , int kGlobalSize, int kLocalSize>
int fuse_core::AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >::GlobalSize ( ) const
inlineoverridevirtual

The size of the variable parameterization in the nonlinear manifold.

Implements fuse_core::LocalParameterization.

Definition at line 142 of file autodiff_local_parameterization.h.

◆ LocalSize()

template<typename PlusFunctor , typename MinusFunctor , int kGlobalSize, int kLocalSize>
int fuse_core::AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >::LocalSize ( ) const
inlineoverridevirtual

The size of a delta vector in the linear tangent space to the nonlinear manifold.

Implements fuse_core::LocalParameterization.

Definition at line 147 of file autodiff_local_parameterization.h.

◆ Minus()

template<typename PlusFunctor , typename MinusFunctor , int kGlobalSize, int kLocalSize>
bool fuse_core::AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >::Minus ( const double *  x1,
const double *  x2,
double *  delta 
) const
overridevirtual

Generalization of the subtraction operation, implemented by the provided MinusFunctor.

Parameters
[in]x1The value of the first variable, of size GlobalSize()
[in]x2The value of the second variable, of size GlobalSize()
[out]deltaThe difference between the second variable and the first, of size LocalSize()
Returns
True if successful, false otherwise

Implements fuse_core::LocalParameterization.

Definition at line 199 of file autodiff_local_parameterization.h.

◆ Plus()

template<typename PlusFunctor , typename MinusFunctor , int kGlobalSize, int kLocalSize>
bool fuse_core::AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >::Plus ( const double *  x,
const double *  delta,
double *  x_plus_delta 
) const
overridevirtual

Generalization of the addition operation, implemented by the provided PlusFunctor.

Parameters
[in]xThe starting variable value, of size GlobalSize()
[in]deltaThe variable increment to apply, of size LocalSize()
[out]x_plus_deltaThe final variable value, of size GlobalSize()
Returns
True if successful, false otherwise

Implements fuse_core::LocalParameterization.

Definition at line 171 of file autodiff_local_parameterization.h.

Member Data Documentation

◆ minus_functor_

template<typename PlusFunctor , typename MinusFunctor , int kGlobalSize, int kLocalSize>
std::unique_ptr<MinusFunctor> fuse_core::AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >::minus_functor_
private

Definition at line 151 of file autodiff_local_parameterization.h.

◆ plus_functor_

template<typename PlusFunctor , typename MinusFunctor , int kGlobalSize, int kLocalSize>
std::unique_ptr<PlusFunctor> fuse_core::AutoDiffLocalParameterization< PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize >::plus_functor_
private

Definition at line 150 of file autodiff_local_parameterization.h.


The documentation for this class was generated from the following file:


fuse_core
Author(s): Stephen Williams
autogenerated on Thu Apr 24 2025 02:18:55