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

#include <projection_error_function.h>

Inheritance diagram for momentum::ProjectionErrorFunctionT< T >:

Public Member Functions

 ProjectionErrorFunctionT (const momentum::Skeleton &skel, const momentum::ParameterTransform &pt, T nearClip=T(1))
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 ProjectionConstraintDataT< T > &data)
void clearConstraints ()
bool empty () const
size_t getNumConstraints () const
void setConstraints (std::vector< ProjectionConstraintDataT< T > > constraints)
const std::vector< ProjectionConstraintDataT< T > > & getConstraints () const
ProjectionConstraintDataT< T > & getConstraint (size_t index)
 Returns a mutable reference to the constraint at the given index, for in-place target/weight updates.
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 kLegacyWeight = 1e-4
 Default constant weight in MarkerErrorFunction.

Protected Attributes

std::vector< ProjectionConstraintDataT< T > > constraints_
T _nearClip = 1.0f
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 kProjectionWeight = 1.0

Detailed Description

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

Definition at line 58 of file projection_error_function.h.

Constructor & Destructor Documentation

◆ ProjectionErrorFunctionT()

Member Function Documentation

◆ addConstraint()

template<typename T>
void momentum::ProjectionErrorFunctionT< T >::addConstraint ( const ProjectionConstraintDataT< T > & data)

Definition at line 54 of file projection_error_function.cpp.

References constraints_.

◆ clearConstraints()

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

Definition at line 85 of file projection_error_function.h.

◆ empty()

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

Definition at line 88 of file projection_error_function.h.

◆ getConstraint()

template<typename T>
ProjectionConstraintDataT< T > & momentum::ProjectionErrorFunctionT< T >::getConstraint ( size_t index)
inline

Returns a mutable reference to the constraint at the given index, for in-place target/weight updates.

Definition at line 104 of file projection_error_function.h.

◆ getConstraints()

template<typename T>
const std::vector< ProjectionConstraintDataT< T > > & momentum::ProjectionErrorFunctionT< T >::getConstraints ( ) const
inlinenodiscard

Definition at line 98 of file projection_error_function.h.

◆ getError()

template<typename T>
double momentum::ProjectionErrorFunctionT< 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::ProjectionErrorFunctionT< T >::getJacobianSize ( ) const
nodiscardfinalvirtual

Reimplemented from momentum::SkeletonErrorFunctionT< T >.

Definition at line 227 of file projection_error_function.cpp.

References constraints_.

◆ getNumConstraints()

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

Definition at line 91 of file projection_error_function.h.

◆ setConstraints()

template<typename T>
void momentum::ProjectionErrorFunctionT< T >::setConstraints ( std::vector< ProjectionConstraintDataT< T > > constraints)
inline

Definition at line 94 of file projection_error_function.h.

Member Data Documentation

◆ _nearClip

◆ constraints_

◆ kLegacyWeight

template<typename T>
T momentum::ProjectionErrorFunctionT< T >::kLegacyWeight = 1e-4
staticconstexpr

Default constant weight in MarkerErrorFunction.

This can be used for backwards compatibility in setWeight().

Definition at line 110 of file projection_error_function.h.

◆ kProjectionWeight

template<typename T>
T momentum::ProjectionErrorFunctionT< T >::kProjectionWeight = 1.0
staticconstexprprotected

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