|
Momentum
A library for solving nonlinear optimization problems related to human body kinematics
|
Constraint data for a center of mass target. More...
#include <center_of_mass_error_function.h>
Public Member Functions | |
| T | totalMass () const |
| Returns the total mass (sum of all masses). | |
Public Attributes | |
| std::vector< size_t > | jointIndices |
| Indices of joints contributing to this CoM constraint. | |
| std::vector< T > | masses |
| Mass values for each joint (must match jointIndices size). | |
| std::vector< Eigen::Vector3< T > > | offsets |
| Optional local center-of-mass offsets for each joint. | |
| Eigen::Vector3< T > | target = Eigen::Vector3<T>::Zero() |
| Target position for the center of mass. | |
| bool | projectToPlane = false |
If true, project the computed center of mass to projectionNormal dot x - projectionD = 0 before comparing it to target. | |
| Eigen::Vector3< T > | projectionNormal = Eigen::Vector3<T>::UnitY() |
| Normal for the optional projection plane. | |
| T | projectionD = T(0) |
| Offset for the optional projection plane in the equation normal dot x - d = 0. | |
| T | weight = T(1) |
| Weight of this constraint. | |
| std::string | name |
| Optional name for debugging. | |
Constraint data for a center of mass target.
Represents a target position for the center of mass (CoM) computed from a weighted sum of joint positions. Each constraint can specify a different set of joints and masses to allow for partial body CoM computation.
Definition at line 41 of file center_of_mass_error_function.h.
|
nodiscard |
Returns the total mass (sum of all masses).
Definition at line 85 of file center_of_mass_error_function.cpp.
References masses.
Referenced by momentum::CenterOfMassErrorFunctionT< T >::addConstraint().
| std::vector<size_t> momentum::CenterOfMassConstraintT< T >::jointIndices |
Indices of joints contributing to this CoM constraint.
Definition at line 43 of file center_of_mass_error_function.h.
Referenced by momentum::CenterOfMassErrorFunctionT< T >::addConstraint().
| std::vector<T> momentum::CenterOfMassConstraintT< T >::masses |
Mass values for each joint (must match jointIndices size).
Definition at line 46 of file center_of_mass_error_function.h.
Referenced by momentum::CenterOfMassErrorFunctionT< T >::addConstraint(), and totalMass().
| std::string momentum::CenterOfMassConstraintT< T >::name |
Optional name for debugging.
Definition at line 74 of file center_of_mass_error_function.h.
| std::vector<Eigen::Vector3<T> > momentum::CenterOfMassConstraintT< T >::offsets |
Optional local center-of-mass offsets for each joint.
If empty, all masses are treated as located at their joint origins. If present, this must match jointIndices size and each joint-local offset is transformed by the corresponding joint state before computing the weighted center of mass.
Definition at line 53 of file center_of_mass_error_function.h.
Referenced by momentum::CenterOfMassErrorFunctionT< T >::addConstraint().
| T momentum::CenterOfMassConstraintT< T >::projectionD = T(0) |
Offset for the optional projection plane in the equation normal dot x - d = 0.
Definition at line 68 of file center_of_mass_error_function.h.
Referenced by momentum::CenterOfMassErrorFunctionT< T >::addConstraint().
| Eigen::Vector3<T> momentum::CenterOfMassConstraintT< T >::projectionNormal = Eigen::Vector3<T>::UnitY() |
Normal for the optional projection plane.
Definition at line 65 of file center_of_mass_error_function.h.
Referenced by momentum::CenterOfMassErrorFunctionT< T >::addConstraint().
| bool momentum::CenterOfMassConstraintT< T >::projectToPlane = false |
If true, project the computed center of mass to projectionNormal dot x - projectionD = 0 before comparing it to target.
The target is expected to already lie on the same projection plane.
Definition at line 62 of file center_of_mass_error_function.h.
Referenced by momentum::CenterOfMassErrorFunctionT< T >::addConstraint().
| Eigen::Vector3<T> momentum::CenterOfMassConstraintT< T >::target = Eigen::Vector3<T>::Zero() |
Target position for the center of mass.
Definition at line 56 of file center_of_mass_error_function.h.
| T momentum::CenterOfMassConstraintT< T >::weight = T(1) |
Weight of this constraint.
Definition at line 71 of file center_of_mass_error_function.h.