Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
error_function_types.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
15
17
18#include <functional>
19#include <optional>
20#include <string>
21#include <string_view>
22#include <vector>
23
24namespace momentum {
25
26// ============================================================================
27// ConstraintData — base struct for joint-based constraint data
28// ============================================================================
29
38 float weight = 0.0f;
40 std::string name = {};
41
42 ConstraintData(size_t pIndex, float w, const std::string& n = "")
43 : parent(pIndex), weight(w), name(n) {}
44};
45
47using ConstraintDataList = std::vector<ConstraintData>;
48
51template <typename T>
52using optional_ref = std::optional<std::reference_wrapper<T>>;
53
54// ============================================================================
55// VertexConstraintType — mode selector for vertex constraint functions
56// ============================================================================
57
68
70[[nodiscard]] std::string_view toString(VertexConstraintType type);
71
72} // namespace momentum
Eigen::Hyperplane< Scalar, Dim > Plane
Definition types.h:49
std::optional< std::reference_wrapper< T > > optional_ref
An optional of a reference.
constexpr size_t kInvalidIndex
Sentinel value indicating an invalid or unset size_t index.
Definition types.h:182
std::string_view toString(const LimitType type)
VertexConstraintType
Type of vertex constraint mode.
std::vector< ConstraintData > ConstraintDataList
A list of ConstraintData.
ConstraintData(size_t pIndex, float w, const std::string &n="")
std::string name
Name of the constraint.
float weight
Weight of the constraint.
size_t parent
Parent joint index this constraint is under.