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

#include <state_error_function.h>

Inheritance diagram for momentum::StateErrorFunctionT< T >:

Public Member Functions

 StateErrorFunctionT (const Skeleton &skel, const ParameterTransform &pt, RotationErrorType rotationErrorType=RotationErrorType::RotationMatrixDifference)
 StateErrorFunctionT (const Character &character, RotationErrorType rotationErrorType=RotationErrorType::RotationMatrixDifference)
double getError (const ModelParametersT< T > &params, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState) final
double getGradient (const ModelParametersT< T > &params, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, Eigen::Ref< Eigen::VectorX< T > > gradient) final
double getJacobian (const ModelParametersT< T > &params, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, Eigen::Ref< Eigen::MatrixX< T > > jacobian, Eigen::Ref< Eigen::VectorX< T > > residual, int &usedRows) final
size_t getJacobianSize () const final
void reset ()
void setTargetState (const SkeletonStateT< T > *target)
void setTargetState (const SkeletonStateT< T > &target)
void setTargetState (TransformListT< T > target)
void setTargetWeight (const Eigen::VectorX< T > &weights)
void setTargetWeights (const Eigen::VectorX< T > &posWeight, const Eigen::VectorX< T > &rotWeight)
void setPositionTargetWeights (const Eigen::VectorX< T > &posWeight)
 Set the target position weights for each joint.
void setRotationTargetWeights (const Eigen::VectorX< T > &rotWeight)
 Set the target rotation weights for each joint.
void setWeights (const float posWeight, const float rotationWeight)
const TransformListT< T > & getTargetState () const
const Eigen::VectorX< T > & getPositionWeights () const
const Eigen::VectorX< T > & getRotationWeights () const
const T & getPositionWeight () const
const T & getRotationWeight () 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

Static Public Attributes

static constexpr T kPositionWeight = 1e-3
static constexpr T kOrientationWeight = 1e+0

Additional Inherited Members

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::StateErrorFunctionT< T >

Definition at line 35 of file state_error_function.h.

Constructor & Destructor Documentation

◆ StateErrorFunctionT() [1/2]

◆ StateErrorFunctionT() [2/2]

template<typename T>
momentum::StateErrorFunctionT< T >::StateErrorFunctionT ( const Character & character,
RotationErrorType rotationErrorType = RotationErrorType::RotationMatrixDifference )
explicit

Definition at line 138 of file state_error_function.cpp.

References StateErrorFunctionT().

Member Function Documentation

◆ getError()

◆ getGradient()

◆ getJacobian()

◆ getJacobianSize()

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

Reimplemented from momentum::SkeletonErrorFunctionT< T >.

Definition at line 394 of file state_error_function.cpp.

References momentum::QuaternionLogMap.

◆ getPositionWeight()

template<typename T>
const T & momentum::StateErrorFunctionT< T >::getPositionWeight ( ) const
inlinenodiscard

Definition at line 96 of file state_error_function.h.

◆ getPositionWeights()

◆ getRotationWeight()

template<typename T>
const T & momentum::StateErrorFunctionT< T >::getRotationWeight ( ) const
inlinenodiscard

Definition at line 99 of file state_error_function.h.

◆ getRotationWeights()

◆ getTargetState()

◆ reset()

template<typename T>
void momentum::StateErrorFunctionT< T >::reset ( )

◆ setPositionTargetWeights()

template<typename T>
void momentum::StateErrorFunctionT< T >::setPositionTargetWeights ( const Eigen::VectorX< T > & posWeight)

Set the target position weights for each joint.

Parameters
posWeightPer-joint position weights.

Definition at line 187 of file state_error_function.cpp.

References MT_CHECK.

◆ setRotationTargetWeights()

template<typename T>
void momentum::StateErrorFunctionT< T >::setRotationTargetWeights ( const Eigen::VectorX< T > & rotWeight)

Set the target rotation weights for each joint.

Parameters
rotWeightPer-joint rotation weights.

Definition at line 193 of file state_error_function.cpp.

References MT_CHECK.

◆ setTargetState() [1/3]

template<typename T>
void momentum::StateErrorFunctionT< T >::setTargetState ( const SkeletonStateT< T > & target)

◆ setTargetState() [2/3]

template<typename T>
void momentum::StateErrorFunctionT< T >::setTargetState ( const SkeletonStateT< T > * target)

◆ setTargetState() [3/3]

template<typename T>
void momentum::StateErrorFunctionT< T >::setTargetState ( TransformListT< T > target)

Definition at line 162 of file state_error_function.cpp.

References MT_CHECK.

◆ setTargetWeight()

template<typename T>
void momentum::StateErrorFunctionT< T >::setTargetWeight ( const Eigen::VectorX< T > & weights)

Definition at line 168 of file state_error_function.cpp.

References MT_CHECK.

◆ setTargetWeights()

template<typename T>
void momentum::StateErrorFunctionT< T >::setTargetWeights ( const Eigen::VectorX< T > & posWeight,
const Eigen::VectorX< T > & rotWeight )

◆ setWeights()

template<typename T>
void momentum::StateErrorFunctionT< T >::setWeights ( const float posWeight,
const float rotationWeight )
inline

Definition at line 81 of file state_error_function.h.

Member Data Documentation

◆ kOrientationWeight

template<typename T>
T momentum::StateErrorFunctionT< T >::kOrientationWeight = 1e+0
staticconstexpr

Definition at line 116 of file state_error_function.h.

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

◆ kPositionWeight

template<typename T>
T momentum::StateErrorFunctionT< T >::kPositionWeight = 1e-3
staticconstexpr

Definition at line 115 of file state_error_function.h.

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


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