|
Momentum
A library for solving nonlinear optimization problems related to human body kinematics
|
#include <projection_error_function.h>
Public Member Functions | |
| ProjectionErrorFunctionT (const momentum::Skeleton &skel, const momentum::ParameterTransform &pt, T nearClip=T(1)) | |
| double | getError (const momentum::ModelParametersT< T > ¶ms, const momentum::SkeletonStateT< T > &state, const momentum::MeshStateT< T > &meshState) final |
| double | getGradient (const momentum::ModelParametersT< T > ¶ms, const momentum::SkeletonStateT< T > &state, const momentum::MeshStateT< T > &meshState, Eigen::Ref< Eigen::VectorX< T > > gradient) final |
| double | getJacobian (const momentum::ModelParametersT< T > ¶ms, 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 > ¶meters, 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 |
Definition at line 58 of file projection_error_function.h.
| momentum::ProjectionErrorFunctionT< T >::ProjectionErrorFunctionT | ( | const momentum::Skeleton & | skel, |
| const momentum::ParameterTransform & | pt, | ||
| T | nearClip = T(1) ) |
Definition at line 18 of file projection_error_function.cpp.
References _nearClip, and momentum::SkeletonErrorFunctionT< T >::SkeletonErrorFunctionT().
Referenced by momentum::FullyDifferentiableProjectionErrorFunctionT< T >::FullyDifferentiableProjectionErrorFunctionT().
| void momentum::ProjectionErrorFunctionT< T >::addConstraint | ( | const ProjectionConstraintDataT< T > & | data | ) |
Definition at line 54 of file projection_error_function.cpp.
References constraints_.
|
inline |
Definition at line 85 of file projection_error_function.h.
|
inlinenodiscard |
Definition at line 88 of file projection_error_function.h.
|
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.
|
inlinenodiscard |
Definition at line 98 of file projection_error_function.h.
|
nodiscardfinalvirtual |
Reimplemented from momentum::SkeletonErrorFunctionT< T >.
Definition at line 25 of file projection_error_function.cpp.
References _nearClip, constraints_, momentum::SkeletonStateT< T >::jointState, kProjectionWeight, and momentum::SkeletonErrorFunctionT< T >::weight_.
|
finalvirtual |
Reimplemented from momentum::SkeletonErrorFunctionT< T >.
Definition at line 59 of file projection_error_function.cpp.
References _nearClip, momentum::SkeletonErrorFunctionT< T >::activeJointParams_, constraints_, momentum::SkeletonStateT< T >::jointState, momentum::kInvalidIndex, kProjectionWeight, momentum::SkeletonErrorFunctionT< T >::parameterTransform_, momentum::SkeletonErrorFunctionT< T >::skeleton_, momentum::sqr(), and momentum::SkeletonErrorFunctionT< T >::weight_.
|
finalvirtual |
Reimplemented from momentum::SkeletonErrorFunctionT< T >.
Definition at line 141 of file projection_error_function.cpp.
References _nearClip, momentum::SkeletonErrorFunctionT< T >::activeJointParams_, momentum::cast(), constraints_, momentum::SkeletonStateT< T >::jointState, momentum::kInvalidIndex, kProjectionWeight, momentum::SkeletonErrorFunctionT< T >::parameterTransform_, momentum::SkeletonErrorFunctionT< T >::skeleton_, momentum::sqr(), and momentum::SkeletonErrorFunctionT< T >::weight_.
|
nodiscardfinalvirtual |
Reimplemented from momentum::SkeletonErrorFunctionT< T >.
Definition at line 227 of file projection_error_function.cpp.
References constraints_.
|
inlinenodiscard |
Definition at line 91 of file projection_error_function.h.
|
inline |
Definition at line 94 of file projection_error_function.h.
|
protected |
Definition at line 121 of file projection_error_function.h.
Referenced by momentum::FullyDifferentiableProjectionErrorFunctionT< T >::constraintGradient_dot(), getError(), getGradient(), getJacobian(), and ProjectionErrorFunctionT().
|
protected |
Definition at line 113 of file projection_error_function.h.
Referenced by addConstraint(), momentum::FullyDifferentiableProjectionErrorFunctionT< T >::d_gradient_d_input_dot(), getError(), getGradient(), momentum::FullyDifferentiableProjectionErrorFunctionT< T >::getInputImp(), momentum::FullyDifferentiableProjectionErrorFunctionT< T >::getInputSize(), getJacobian(), getJacobianSize(), and momentum::FullyDifferentiableProjectionErrorFunctionT< T >::setInputImp().
|
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.
|
staticconstexprprotected |
Definition at line 116 of file projection_error_function.h.
Referenced by momentum::FullyDifferentiableProjectionErrorFunctionT< T >::constraintGradient_dot(), getError(), getGradient(), and getJacobian().