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

#include <pose_prior_error_function.h>

Inheritance diagram for momentum::PosePriorErrorFunctionT< T >:

Public Member Functions

 PosePriorErrorFunctionT (const Skeleton &skel, const ParameterTransform &pt, std::shared_ptr< const MppcaT< T > > pp)
 PosePriorErrorFunctionT (const Character &character, std::shared_ptr< const MppcaT< T > > pp)
void setPosePrior (std::shared_ptr< const MppcaT< T > > pp)
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 logProbability (const ModelParametersT< T > &params) const
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
Eigen::VectorX< T > getMeanShape (const ModelParametersT< T > &params) 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 Member Functions

void loadInternal ()
void getBestFitMode (const ModelParametersT< T > &params, size_t &bestIdx, Eigen::VectorX< T > &bestDiff, T &bestR, T &minDist) const

Protected Attributes

std::vector< size_t > ppMap_
std::vector< size_t > invMap_
std::shared_ptr< const MppcaT< T > > posePrior_
Protected Attributes inherited from momentum::SkeletonErrorFunctionT< T >
const Skeleton & skeleton_
const ParameterTransform & parameterTransform_
T weight_
VectorX< bool > activeJointParams_
ParameterSet enabledParameters_
bool useHessian_ {false}

Static Protected Attributes

static constexpr T kPosePriorWeight = 1e-3

Detailed Description

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

Definition at line 19 of file pose_prior_error_function.h.

Constructor & Destructor Documentation

◆ PosePriorErrorFunctionT() [1/2]

◆ PosePriorErrorFunctionT() [2/2]

template<typename T>
momentum::PosePriorErrorFunctionT< T >::PosePriorErrorFunctionT ( const Character & character,
std::shared_ptr< const MppcaT< T > > pp )

Definition at line 28 of file pose_prior_error_function.cpp.

References PosePriorErrorFunctionT().

Member Function Documentation

◆ getBestFitMode()

template<typename T>
void momentum::PosePriorErrorFunctionT< T >::getBestFitMode ( const ModelParametersT< T > & params,
size_t & bestIdx,
Eigen::VectorX< T > & bestDiff,
T & bestR,
T & minDist ) const
protected

◆ getError()

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

◆ getGradient()

template<typename T>
double momentum::PosePriorErrorFunctionT< T >::getGradient ( const ModelParametersT< T > & params,
const SkeletonStateT< T > & state,
const MeshStateT< T > & meshState,
Eigen::Ref< Eigen::VectorX< T > > gradient )
finalvirtual

◆ getJacobian()

template<typename T>
double momentum::PosePriorErrorFunctionT< T >::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 )
finalvirtual

◆ getJacobianSize()

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

Reimplemented from momentum::SkeletonErrorFunctionT< T >.

Definition at line 138 of file pose_prior_error_function.cpp.

References posePrior_.

◆ getMeanShape()

template<typename T>
Eigen::VectorX< T > momentum::PosePriorErrorFunctionT< T >::getMeanShape ( const ModelParametersT< T > & params) const
nodiscard

◆ loadInternal()

template<typename T>
void momentum::PosePriorErrorFunctionT< T >::loadInternal ( )
protected

◆ logProbability()

template<typename T>
double momentum::PosePriorErrorFunctionT< T >::logProbability ( const ModelParametersT< T > & params) const
nodiscard

◆ setPosePrior()

Member Data Documentation

◆ invMap_

template<typename T>
std::vector<size_t> momentum::PosePriorErrorFunctionT< T >::invMap_
protected

◆ kPosePriorWeight

template<typename T>
T momentum::PosePriorErrorFunctionT< T >::kPosePriorWeight = 1e-3
staticconstexprprotected

◆ posePrior_

◆ ppMap_


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