![]() |
FancySafeBot 0.0.1
A safe robotics library
|
Parsing URDF files to get rigid body tree object. More...
Classes | |
class | fsb::urdf::UrdfError |
Urdf parsing error. More... | |
class | fsb::urdf::NameMap |
Name map relating names to object indices. More... | |
class | fsb::urdf::UrdfNameMap |
Name-index map of joints and bodies in rigid body tree. More... | |
struct | fsb::urdf::UrdfJoint |
Structure representing a URDF joint. More... | |
Functions | |
size_t | fsb::urdf::string_to_index (const std::string &str, UrdfError &err) |
Parse a string to extract an unsigned integer as index value. | |
real_t | fsb::urdf::string_to_real (const std::string &str, UrdfError &err) |
Parse a string to extract a real value. | |
std::vector< std::string > | fsb::urdf::split_string_spaces (const std::string &str) |
Split a string with space character as delimiter. | |
Vec3 | fsb::urdf::string_to_vector (const std::string &str, UrdfError &err) |
Converts a string to a vector with 3 elements separated by the space character. | |
Quaternion | fsb::urdf::string_to_quaternion (const std::string &str, UrdfError &err) |
Converts a string to a quaternion. | |
UrdfJoint | fsb::urdf::urdf_parse_joint (const std::string &fname, const tinyxml2::XMLElement *joint_xml, UrdfError &err) |
Parse a URDF joint element. | |
Transform | fsb::urdf::urdf_parse_origin (const std::string &fname, const std::string &el_name, const tinyxml2::XMLElement *el_xml, UrdfError &err) |
Parse first child origin element to get coordinate transform. | |
MotionVector | fsb::urdf::urdf_parse_origin_offset (const std::string &fname, const std::string &body_name, const tinyxml2::XMLElement *body_xml, UrdfError &err) |
Parse first child origin offset element. | |
Inertia | fsb::urdf::urdf_parse_inertia_mass (const std::string &fname, const std::string &body_name, const tinyxml2::XMLElement *inertial_xml, real_t &body_mass, UrdfError &err) |
Parse inertial element from URDF file. | |
BodyTree | fsb::urdf::parse_urdf_string (const std::string &urdf_string, UrdfNameMap &name_map, UrdfError &err) |
Parse URDF file string to get body tree object. | |
BodyTree | fsb::urdf::parse_urdf_file (const std::string &urdf_filename, UrdfNameMap &name_map, UrdfError &err) |
Parse URDF file to get body tree object. | |
Parsing URDF files to get rigid body tree object.
|
strong |
|
strong |
Errors from parsing URDF.
Enumerator | |
---|---|
SUCCESS | No error. |
VALUE_CONVERSION_FAILED | Failed to convert to numerical value. |
RANGE_ERROR | Value out of range. |
LOAD_FILE_ERROR | File failed to load. |
PARSE_ERROR | Failed to parse URDF XML. |
MISSING_ROBOT | Missing robot element. |
MISSING_NAME | Missing name attribute. |
REPEATED_NAME | Repeated element name. |
MISSING_JOINT_TYPE | Missing joint type attribute. |
INVALID_JOINT_TYPE | Invalid joint type attribute. |
JOINT_INVALID_AXIS | Invalid joint axis. |
MISSING_JOINT_PARENT | Joint parent not found. |
MISSING_PARENT_LINK_ATTRIBUTE | Missing parent attribute on joint element. |
MISSING_JOINT_CHILD | Missing child attribute on joint element. |
MISSING_CHILD_LINK_ATTRIBUTE | Missing child attribute on joint element. |
MISSING_BODY_INERTIAL | Missing inertial element for body. |
MISSING_BODY_MASS | Missing mass element. |
MISSING_BODY_INERTIA | Missing inertia element. |
MISSING_INERTIA_ATTRIBUTE | Missing inertia attribute ixx, iyy, or izz. |
MISSING_MASS_VALUE_ATTRIBUTE | Missing mass value attribute. |
BODY_PRINCIPAL_INERTIA | Failed to determine inertia principal axis. |
BODY_INERTIA_NOT_POSITIVE_DEFINITE | Inertia is not positive definite. |
MAX_JOINTS_EXCEEDED | Maximum number of joints exceeded. |
MAX_BODIES_EXCEEDED | Maximum number of bodies exceeded. |
MAX_COORDINATES_EXCEEDED | Maximum number of position coordinates exceeded. |
MAX_DOFS_EXCEEDED | Maximum number of degrees of freedom exceeded. |
BODY_TREE_ERROR | Failed to add body to tree. |
JOINT_PARENT_BODY_NOT_FOUND | Joint parent body not found. |
JOINT_CHILD_BODY_NOT_FOUND | Joint child body not found. |
BodyTree fsb::urdf::parse_urdf_file | ( | const std::string & | urdf_filename, |
UrdfNameMap & | name_map, | ||
UrdfError & | err | ||
) |
Parse URDF file to get body tree object.
urdf_filename | Input URDF filename |
name_map | Output name map for rigid body tree |
err | Error object |
BodyTree fsb::urdf::parse_urdf_string | ( | const std::string & | urdf_string, |
UrdfNameMap & | name_map, | ||
UrdfError & | err | ||
) |
Parse URDF file string to get body tree object.
urdf_string | String of URDF contents |
name_map | Output name map for rigid body tree |
err | Error object |
std::vector< std::string > fsb::urdf::split_string_spaces | ( | const std::string & | str | ) |
Split a string with space character as delimiter.
str | String to split |
size_t fsb::urdf::string_to_index | ( | const std::string & | str, |
UrdfError & | err | ||
) |
Parse a string to extract an unsigned integer as index value.
The standard function std::strtol
is used to parse the string and ignores trailing string characters after parsing the value.
str | String to convert to an index value (unsigned integer) |
err | Error from parsing |
Quaternion fsb::urdf::string_to_quaternion | ( | const std::string & | str, |
UrdfError & | err | ||
) |
Converts a string to a quaternion.
str | String to convert to a quaternion |
err | Error from parsing string. |
real_t fsb::urdf::string_to_real | ( | const std::string & | str, |
UrdfError & | err | ||
) |
Parse a string to extract a real value.
The standard function std::strtod
is used to parse the string and ignores trailing string characters after parsing the value.
str | String to convert to a real value |
err | Error from parsing |
Converts a string to a vector with 3 elements separated by the space character.
str | Convert string to 3-element vector |
err | Error from parsing string. |
Inertia fsb::urdf::urdf_parse_inertia_mass | ( | const std::string & | fname, |
const std::string & | body_name, | ||
const tinyxml2::XMLElement * | inertial_xml, | ||
real_t & | body_mass, | ||
UrdfError & | err | ||
) |
Parse inertial element from URDF file.
This function parses the inertial element of a body in a URDF file. An example xml element is:
[in] | fname | File name of the URDF file |
[in] | body_name | Body name to which the inertial element belongs |
[in] | inertial_xml | Pointer to the inertial XML element |
[out] | body_mass | Mass of the body |
[out] | err | Error object to store any parsing errors |
UrdfJoint fsb::urdf::urdf_parse_joint | ( | const std::string & | fname, |
const tinyxml2::XMLElement * | joint_xml, | ||
UrdfError & | err | ||
) |
Parse a URDF joint element.
An example xml snippet with a joint element is shown below.
[in] | fname | Name of the file being parsed |
[in] | joint_xml | XML element representing the joint |
[out] | err | Error status returned after parsing |
Transform fsb::urdf::urdf_parse_origin | ( | const std::string & | fname, |
const std::string & | el_name, | ||
const tinyxml2::XMLElement * | el_xml, | ||
UrdfError & | err | ||
) |
Parse first child origin element to get coordinate transform.
Here is an example xml snippet with the child origin of an element
fname | Name of file being parsed |
el_name | Parent element name containing origin |
el_xml | Parent element containing origin |
err | Error status returned after parsing |
MotionVector fsb::urdf::urdf_parse_origin_offset | ( | const std::string & | fname, |
const std::string & | body_name, | ||
const tinyxml2::XMLElement * | body_xml, | ||
UrdfError & | err | ||
) |
Parse first child origin offset element.
The origin offset is a custom element for the Fancy Safe Bot library and is prefixed fsb:
. An XML snippet shows an example offset below. The angular offset is an axis-angle representation of a rotation in radians.
fname | Name of file being parsed |
body_name | Parent body element name containing origin offset |
body_xml | Parent element containing origin offset |
err | Error status returned after parsing |