FancySafeBot 0.0.1
A safe robotics library
Loading...
Searching...
No Matches
fsb_urdf_error.h
1
2#pragma once
3
4#include <string>
5#include <utility>
6
7namespace fsb::urdf
8{
9
71
76{
77public:
78 UrdfError() = default;
79
86 UrdfError(const UrdfErrorType type, std::string description) :
87 m_type(type),
88 m_description(std::move(description))
89 {}
90
96 [[nodiscard]] bool is_error() const
97 {
98 return (m_type != UrdfErrorType::SUCCESS);
99 }
100
106 [[nodiscard]] std::string get_description() const
107 {
108 return m_description;
109 }
110
115 [[nodiscard]] UrdfErrorType get_type() const
116 {
117 return m_type;
118 }
119
120private:
122 std::string m_description;
123};
124
129} // namespace fsb::urdf
Urdf parsing error.
Definition fsb_urdf_error.h:76
std::string get_description() const
Get error description.
Definition fsb_urdf_error.h:106
UrdfError(const UrdfErrorType type, std::string description)
Constructor with type and error description.
Definition fsb_urdf_error.h:86
UrdfErrorType get_type() const
Get error type.
Definition fsb_urdf_error.h:115
bool is_error() const
Get error status.
Definition fsb_urdf_error.h:96
UrdfErrorType
Errors from parsing URDF.
Definition fsb_urdf_error.h:19
@ BODY_INERTIA_NOT_POSITIVE_DEFINITE
Inertia is not positive definite.
@ MISSING_CHILD_LINK_ATTRIBUTE
Missing child attribute on joint element.
@ MAX_BODIES_EXCEEDED
Maximum number of bodies exceeded.
@ MISSING_JOINT_CHILD
Missing child attribute on joint element.
@ REPEATED_NAME
Repeated element name.
@ RANGE_ERROR
Value out of range.
@ MISSING_PARENT_LINK_ATTRIBUTE
Missing parent attribute on joint element.
@ JOINT_INVALID_AXIS
Invalid joint axis.
@ MISSING_BODY_INERTIAL
Missing inertial element for body.
@ JOINT_LIMITS_PARSE_ERROR
Failed to parse joint limits.
@ JOINT_PARENT_BODY_NOT_FOUND
Joint parent body not found.
@ PARSE_ERROR
Failed to parse URDF XML.
@ MISSING_BODY_INERTIA
Missing inertia element.
@ MISSING_MASS_VALUE_ATTRIBUTE
Missing mass value attribute.
@ MISSING_NAME
Missing name attribute.
@ MAX_DOFS_EXCEEDED
Maximum number of degrees of freedom exceeded.
@ MISSING_JOINT_TYPE
Missing joint type attribute.
@ JOINT_CHILD_BODY_NOT_FOUND
Joint child body not found.
@ MAX_JOINTS_EXCEEDED
Maximum number of joints exceeded.
@ MISSING_JOINT_PARENT
Joint parent not found.
@ BODY_PRINCIPAL_INERTIA
Failed to determine inertia principal axis.
@ MISSING_ROBOT
Missing robot element.
@ INVALID_JOINT_TYPE
Invalid joint type attribute.
@ LOAD_FILE_ERROR
File failed to load.
@ VALUE_CONVERSION_FAILED
Failed to convert to numerical value.
@ BODY_TREE_ERROR
Failed to add body to tree.
@ MISSING_BODY_MASS
Missing mass element.
@ MISSING_INERTIA_ATTRIBUTE
Missing inertia attribute ixx, iyy, or izz.
@ MAX_COORDINATES_EXCEEDED
Maximum number of position coordinates exceeded.