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
70
75{
76public:
77 UrdfError() = default;
78
85 UrdfError(const UrdfErrorType type, std::string description) :
86 m_type(type),
87 m_description(std::move(description))
88 {}
89
95 [[nodiscard]] bool is_error() const
96 {
97 return (m_type != UrdfErrorType::SUCCESS);
98 }
99
105 [[nodiscard]] std::string get_description() const
106 {
107 return m_description;
108 }
109
114 [[nodiscard]] UrdfErrorType get_type() const
115 {
116 return m_type;
117 }
118
119private:
121 std::string m_description;
122};
123
128} // namespace fsb::urdf
Urdf parsing error.
Definition fsb_urdf_error.h:75
std::string get_description() const
Get error description.
Definition fsb_urdf_error.h:105
UrdfError(const UrdfErrorType type, std::string description)
Constructor with type and error description.
Definition fsb_urdf_error.h:85
UrdfErrorType get_type() const
Get error type.
Definition fsb_urdf_error.h:114
bool is_error() const
Get error status.
Definition fsb_urdf_error.h:95
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_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.