11
2- #pragma once
2+ #ifndef FSB_BODY_TREE_H
3+ #define FSB_BODY_TREE_H
34
45#include < array>
56#include < cstddef>
@@ -21,57 +22,57 @@ namespace fsb
2122/* *
2223 * @brief Error list for body tree operations.
2324 */
24- enum class BodyTreeError
25+ enum class BodyTreeError : uint8_t
2526{
26- SUCCESS,
27+ SUCCESS = 0 ,
2728 /* *
2829 * @brief Index does not point to an existing body in tree.
2930 */
30- BODY_NOT_IN_TREE,
31+ BODY_NOT_IN_TREE = 1 ,
3132 /* *
3233 * @brief Index does not point to an existing joint in tree.
3334 */
34- JOINT_NOT_IN_TREE,
35+ JOINT_NOT_IN_TREE = 2 ,
3536 /* *
3637 * @brief No more bodies can be added to the body tree. Maximum is specified by @c
3738 * MaxSize::bodies
3839 */
39- MAX_BODIES_REACHED,
40+ MAX_BODIES_REACHED = 3 ,
4041 /* *
4142 * @brief Parent body index does not point to an existing body in tree.
4243 */
43- PARENT_BODY_NONEXISTENT,
44+ PARENT_BODY_NONEXISTENT = 4 ,
4445 /* *
4546 * @brief No more joints can be added to the body tree. Maximum is specified by @c
4647 * MaxSize::joints
4748 */
48- MAX_JOINTS_REACHED,
49+ MAX_JOINTS_REACHED = 5 ,
4950 /* *
5051 * @brief Joint requires more coordinates than is available. Maximum is specified by @c
5152 * MaxSize::coordinates
5253 */
53- MAX_JOINT_COORDINATES_REACHED,
54+ MAX_JOINT_COORDINATES_REACHED = 6 ,
5455 /* *
5556 * @brief Joint requires more DoFs than is available. Maximum is specified by @c MaxSize::dofs
5657 */
57- MAX_JOINT_DOFS_REACHED,
58+ MAX_JOINT_DOFS_REACHED = 7 ,
5859 /* *
5960 * @brief Body mass is zero with a non-fixed parent joint
6061 */
61- MASS_ZERO,
62+ MASS_ZERO = 8 ,
6263 /* *
6364 * @brief At least one of the inertia principal components are zero with a non-fixed parent
6465 * joint
6566 */
66- INERTIA_ZERO,
67+ INERTIA_ZERO = 9 ,
6768 /* *
6869 * @brief Body mass is set to zero but with non-zero inertia for a fixed parent joint.
6970 */
70- MASS_ZERO_WITH_INERTIA,
71+ MASS_ZERO_WITH_INERTIA = 10 ,
7172 /* *
7273 * @brief Inertia is not positive definite.
7374 */
74- INERTIA_NOT_POS_DEF
75+ INERTIA_NOT_POS_DEF = 11
7576};
7677
7778/* *
@@ -283,3 +284,5 @@ inline BodyTreeError BodyTree::set_parent_joint_transform(
283284 */
284285
285286} // namespace fsb
287+
288+ #endif
0 commit comments