Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
fully_differentiable_motion_error_function.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#pragma once
9
14
15#include <Eigen/Core>
16
17namespace momentum {
18
19template <typename T>
22 public:
29 default;
31 FullyDifferentiableMotionErrorFunctionT&&) noexcept = default;
32
33 [[nodiscard]] std::vector<std::string> inputs() const final;
34 [[nodiscard]] Eigen::Index getInputSize(const std::string& name) const final;
35 [[nodiscard]] const char* name() const final {
36 return "ModelParametersErrorFunction";
37 }
38
39 static constexpr const char* kTargetParameters = "target_parameters";
40 static constexpr const char* kTargetWeights = "target_weights";
41
42 Eigen::VectorX<T> d_gradient_d_input_dot(
43 const std::string& inputName,
44 const ModelParametersT<T>& params,
45 const SkeletonStateT<T>& state,
46 Eigen::Ref<const Eigen::VectorX<T>> inputVec) final;
47
48 protected:
49 void getInputImp(const std::string& name, Eigen::Ref<Eigen::VectorX<T>> value) const final;
50 void setInputImp(const std::string& name, Eigen::Ref<const Eigen::VectorX<T>> value) final;
51};
52
53} // namespace momentum
std::vector< std::string > inputs() const final
FullyDifferentiableMotionErrorFunctionT(const FullyDifferentiableMotionErrorFunctionT &)=default
void getInputImp(const std::string &name, Eigen::Ref< Eigen::VectorX< T > > value) const final
FullyDifferentiableMotionErrorFunctionT & operator=(const FullyDifferentiableMotionErrorFunctionT &)=default
Eigen::VectorX< T > d_gradient_d_input_dot(const std::string &inputName, const ModelParametersT< T > &params, const SkeletonStateT< T > &state, Eigen::Ref< const Eigen::VectorX< T > > inputVec) final
Eigen::Index getInputSize(const std::string &name) const final
FullyDifferentiableMotionErrorFunctionT(FullyDifferentiableMotionErrorFunctionT &&) noexcept=default
FullyDifferentiableMotionErrorFunctionT(const Skeleton &skel, const ParameterTransform &pt)
void setInputImp(const std::string &name, Eigen::Ref< const Eigen::VectorX< T > > value) final
ModelParametersErrorFunctionT(const Skeleton &skel, const ParameterTransform &pt)
Definition types.h:28
SkeletonT< float > Skeleton
Definition fwd.h:263
ParameterTransformT< float > ParameterTransform
Definition fwd.h:244
A vector of size numModelParams holding the values of all model parameters for a character.
Definition types.h:99
Represents the complete state of a skeleton.