|
Momentum
A library for solving nonlinear optimization problems related to human body kinematics
|
Error function that penalizes differences in vertex velocity between source and target motion. More...
#include <vertex_sequence_error_function.h>
Public Member Functions | |
| VertexSequenceErrorFunctionT (const Character &character) | |
| size_t | numFrames () const final |
| double | getError (std::span< const ModelParametersT< T > > modelParameters, std::span< const SkeletonStateT< T > > skelStates, std::span< const MeshStateT< T > > meshStates) const final |
| double | getGradient (std::span< const ModelParametersT< T > > modelParameters, std::span< const SkeletonStateT< T > > skelStates, std::span< const MeshStateT< T > > meshStates, Eigen::Ref< Eigen::VectorX< T > > gradient) const final |
| double | getJacobian (std::span< const ModelParametersT< T > > modelParameters, std::span< const SkeletonStateT< T > > skelStates, std::span< const MeshStateT< T > > meshStates, Eigen::Ref< Eigen::MatrixX< T > > jacobian, Eigen::Ref< Eigen::VectorX< T > > residual, int &usedRows) const final |
| bool | needsMesh () const final |
| size_t | getJacobianSize () const final |
| void | addConstraint (int vertexIndex, T weight, const Eigen::Vector3< T > &targetVelocity) |
| Add a vertex velocity constraint. | |
| void | clearConstraints () |
| Clear all vertex velocity constraints. | |
| const std::vector< VertexVelocityConstraintT< T > > & | getConstraints () const |
| Get all vertex velocity constraints. | |
| size_t | getNumConstraints () const |
| Get the number of constraints. | |
| const Character & | getCharacter () const |
| Get the character reference. | |
| Public Member Functions inherited from momentum::SequenceErrorFunctionT< T > | |
| SequenceErrorFunctionT (const Skeleton &skel, const ParameterTransform &pt) | |
| virtual | ~SequenceErrorFunctionT ()=default |
| void | setWeight (T w) |
| float | getWeight () const |
| void | setActiveJoints (const VectorX< bool > &aj) |
| void | setEnabledParameters (const ParameterSet &ps) |
| const Skeleton & | getSkeleton () const |
| const ParameterTransform & | getParameterTransform () const |
Static Public Attributes | |
| static constexpr T | kVelocityWeight = 1e-3 |
Additional Inherited Members | |
| Protected Attributes inherited from momentum::SequenceErrorFunctionT< T > | |
| const Skeleton & | skeleton_ |
| const ParameterTransform & | parameterTransform_ |
| T | weight_ = 1.0f |
| VectorX< bool > | activeJointParams_ |
| ParameterSet | enabledParameters_ |
Error function that penalizes differences in vertex velocity between source and target motion.
This function computes vertex velocities by taking the difference between consecutive frames and penalizes deviations from target vertex velocities. It combines the sequence aspect of StateSequenceErrorFunction with vertex constraints from VertexErrorFunction.
Definition at line 40 of file vertex_sequence_error_function.h.
|
explicit |
Definition at line 29 of file vertex_sequence_error_function.cpp.
References MT_CHECK, and momentum::SequenceErrorFunctionT< T >::SequenceErrorFunctionT().
| void momentum::VertexSequenceErrorFunctionT< T >::addConstraint | ( | int | vertexIndex, |
| T | weight, | ||
| const Eigen::Vector3< T > & | targetVelocity ) |
Add a vertex velocity constraint.
| vertexIndex | Index of the vertex to constrain. |
| weight | Weight for this constraint. |
| targetVelocity | Target velocity for the vertex. |
Definition at line 42 of file vertex_sequence_error_function.cpp.
References MT_CHECK.
| void momentum::VertexSequenceErrorFunctionT< T >::clearConstraints | ( | ) |
Clear all vertex velocity constraints.
Definition at line 37 of file vertex_sequence_error_function.cpp.
|
inlinenodiscard |
Get the character reference.
Definition at line 96 of file vertex_sequence_error_function.h.
|
inlinenodiscard |
Get all vertex velocity constraints.
Definition at line 86 of file vertex_sequence_error_function.h.
|
finalvirtual |
Reimplemented from momentum::SequenceErrorFunctionT< T >.
Definition at line 51 of file vertex_sequence_error_function.cpp.
References kVelocityWeight, MT_CHECK, MT_CHECK_NOTNULL, MT_PROFILE_FUNCTION, and momentum::SequenceErrorFunctionT< T >::weight_.
|
finalvirtual |
Reimplemented from momentum::SequenceErrorFunctionT< T >.
Definition at line 192 of file vertex_sequence_error_function.cpp.
References MT_CHECK, MT_CHECK_NOTNULL, and MT_PROFILE_FUNCTION.
|
finalvirtual |
Reimplemented from momentum::SequenceErrorFunctionT< T >.
Definition at line 324 of file vertex_sequence_error_function.cpp.
References MT_CHECK, MT_CHECK_NOTNULL, MT_PROFILE_FUNCTION, and momentum::SequenceErrorFunctionT< T >::parameterTransform_.
|
nodiscardfinalvirtual |
Reimplemented from momentum::SequenceErrorFunctionT< T >.
Definition at line 356 of file vertex_sequence_error_function.cpp.
|
inlinenodiscard |
Get the number of constraints.
Definition at line 91 of file vertex_sequence_error_function.h.
|
inlinenodiscardfinalvirtual |
Reimplemented from momentum::SequenceErrorFunctionT< T >.
Definition at line 70 of file vertex_sequence_error_function.h.
|
inlinenodiscardfinalvirtual |
Implements momentum::SequenceErrorFunctionT< T >.
Definition at line 44 of file vertex_sequence_error_function.h.
|
staticconstexpr |
Definition at line 100 of file vertex_sequence_error_function.h.
Referenced by getError().