Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
momentum::DistanceErrorFunctionT< T > Class Template Reference

#include <distance_error_function.h>

Inheritance diagram for momentum::DistanceErrorFunctionT< T >:

Public Member Functions

 DistanceErrorFunctionT (const momentum::Skeleton &skel, const momentum::ParameterTransform &pt)
double getError (const momentum::ModelParametersT< T > &params, const momentum::SkeletonStateT< T > &state, const momentum::MeshStateT< T > &meshState) final
double getGradient (const momentum::ModelParametersT< T > &params, const momentum::SkeletonStateT< T > &state, const momentum::MeshStateT< T > &meshState, Eigen::Ref< Eigen::VectorX< T > > gradient) final
double getJacobian (const momentum::ModelParametersT< T > &params, const momentum::SkeletonStateT< T > &state, const momentum::MeshStateT< T > &meshState, Eigen::Ref< Eigen::MatrixX< T > > jacobian, Eigen::Ref< Eigen::VectorX< T > > residual, int &usedRows) final
size_t getJacobianSize () const final
void addConstraint (const DistanceConstraintDataT< T > &constr)
void clearConstraints ()
void setConstraints (std::vector< DistanceConstraintDataT< T > > constr)
bool empty () const
size_t getNumConstraints () const
const std::vector< DistanceConstraintDataT< T > > & getConstraints () const
Public Member Functions inherited from momentum::SkeletonErrorFunctionT< T >
 SkeletonErrorFunctionT (const Skeleton &skel, const ParameterTransform &pt)
virtual ~SkeletonErrorFunctionT ()=default
const Skeleton & getSkeleton () const
const ParameterTransform & getParameterTransform () const
virtual const Character * getCharacter () const
 For mesh-based error functions, get access to the underlying character.
void setWeight (T w)
T getWeight () const
void setActiveJoints (const VectorX< bool > &aj)
void setEnabledParameters (const ParameterSet &ps)
virtual void getHessian (const ModelParametersT< T > &, const SkeletonStateT< T > &, const MeshStateT< T > &, Eigen::Ref< Eigen::MatrixX< T > >)
virtual double getSolverDerivatives (const ModelParametersT< T > &parameters, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, const size_t actualParameters, Eigen::MatrixX< T > &hess, Eigen::VectorX< T > &grad)
virtual bool needsMesh () const

Protected Attributes

const T kDistanceWeight = 1.0f
std::vector< DistanceConstraintDataT< T > > constraints_
Protected Attributes inherited from momentum::SkeletonErrorFunctionT< T >
const Skeleton & skeleton_
const ParameterTransform & parameterTransform_
T weight_
VectorX< bool > activeJointParams_
ParameterSet enabledParameters_
bool useHessian_ {false}

Detailed Description

template<typename T>
class momentum::DistanceErrorFunctionT< T >

Definition at line 28 of file distance_error_function.h.

Constructor & Destructor Documentation

◆ DistanceErrorFunctionT()

Member Function Documentation

◆ addConstraint()

template<typename T>
void momentum::DistanceErrorFunctionT< T >::addConstraint ( const DistanceConstraintDataT< T > & constr)
inline

Definition at line 50 of file distance_error_function.h.

◆ clearConstraints()

template<typename T>
void momentum::DistanceErrorFunctionT< T >::clearConstraints ( )
inline

Definition at line 53 of file distance_error_function.h.

◆ empty()

template<typename T>
bool momentum::DistanceErrorFunctionT< T >::empty ( ) const
inlinenodiscard

Definition at line 59 of file distance_error_function.h.

◆ getConstraints()

template<typename T>
const std::vector< DistanceConstraintDataT< T > > & momentum::DistanceErrorFunctionT< T >::getConstraints ( ) const
inlinenodiscard

Definition at line 66 of file distance_error_function.h.

◆ getError()

template<typename T>
double momentum::DistanceErrorFunctionT< T >::getError ( const momentum::ModelParametersT< T > & params,
const momentum::SkeletonStateT< T > & state,
const momentum::MeshStateT< T > & meshState )
nodiscardfinalvirtual

◆ getGradient()

◆ getJacobian()

◆ getJacobianSize()

template<typename T>
size_t momentum::DistanceErrorFunctionT< T >::getJacobianSize ( ) const
nodiscardfinalvirtual

Reimplemented from momentum::SkeletonErrorFunctionT< T >.

Definition at line 199 of file distance_error_function.cpp.

References constraints_.

◆ getNumConstraints()

template<typename T>
size_t momentum::DistanceErrorFunctionT< T >::getNumConstraints ( ) const
inlinenodiscard

Definition at line 62 of file distance_error_function.h.

◆ setConstraints()

template<typename T>
void momentum::DistanceErrorFunctionT< T >::setConstraints ( std::vector< DistanceConstraintDataT< T > > constr)
inline

Definition at line 56 of file distance_error_function.h.

Member Data Documentation

◆ constraints_

◆ kDistanceWeight

template<typename T>
const T momentum::DistanceErrorFunctionT< T >::kDistanceWeight = 1.0f
protected

Definition at line 72 of file distance_error_function.h.

Referenced by getError(), getGradient(), and getJacobian().


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