Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update URDF parser to use Tesseract XML namespace #1081

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tesseract_urdf/include/tesseract_urdf/box.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* BOX_ELEMENT_NAME = "box"; // NOLINT

/**
* @brief Parse a xml box element
* @param xml_element The xml element
* @return Tesseract Geometry Box
*/
std::shared_ptr<tesseract_geometry::Box> parseBox(const tinyxml2::XMLElement* xml_element, int version);
std::shared_ptr<tesseract_geometry::Box> parseBox(const tinyxml2::XMLElement* xml_element);

tinyxml2::XMLElement* writeBox(const std::shared_ptr<const tesseract_geometry::Box>& box, tinyxml2::XMLDocument& doc);

Expand Down
5 changes: 3 additions & 2 deletions tesseract_urdf/include/tesseract_urdf/calibration.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* CALIBRATION_ELEMENT_NAME = "calibration"; // NOLINT

/**
* @brief Parse a xml calibration element
* @param xml_element The xml element
* @return Tesseract JointCalibration
*/
std::shared_ptr<tesseract_scene_graph::JointCalibration> parseCalibration(const tinyxml2::XMLElement* xml_element,
int version);
std::shared_ptr<tesseract_scene_graph::JointCalibration> parseCalibration(const tinyxml2::XMLElement* xml_element);

tinyxml2::XMLElement*
writeCalibration(const std::shared_ptr<const tesseract_scene_graph::JointCalibration>& calibration,
Expand Down
4 changes: 3 additions & 1 deletion tesseract_urdf/include/tesseract_urdf/capsule.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* CAPSULE_ELEMENT_NAME = "tesseract:capsule"; // NOLINT

/**
* @brief Parse a xml capsule element
* @param xml_element The xml element
* @return Tesseract Geometry Capsule
*/
std::shared_ptr<tesseract_geometry::Capsule> parseCapsule(const tinyxml2::XMLElement* xml_element, int version);
std::shared_ptr<tesseract_geometry::Capsule> parseCapsule(const tinyxml2::XMLElement* xml_element);

tinyxml2::XMLElement* writeCapsule(const std::shared_ptr<const tesseract_geometry::Capsule>& capsule,
tinyxml2::XMLDocument& doc);
Expand Down
5 changes: 3 additions & 2 deletions tesseract_urdf/include/tesseract_urdf/collision.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* COLLISION_ELEMENT_NAME = "collision"; // NOLINT

/**
* @brief Parse xml element collision
* @param xml_element The xml element
Expand All @@ -51,8 +53,7 @@ namespace tesseract_urdf
* @return A Collision object
*/
std::shared_ptr<tesseract_scene_graph::Collision> parseCollision(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator,
int version);
const tesseract_common::ResourceLocator& locator);

/**
* @brief writeCollision Write collision object to URDF XML
Expand Down
4 changes: 3 additions & 1 deletion tesseract_urdf/include/tesseract_urdf/cone.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* CONE_ELEMENT_NAME = "tesseract:cone"; // NOLINT

/**
* @brief Parse a xml cone element
* @param xml_element The xml element
* @return Tesseract Geometry Cone
*/
std::shared_ptr<tesseract_geometry::Cone> parseCone(const tinyxml2::XMLElement* xml_element, int version);
std::shared_ptr<tesseract_geometry::Cone> parseCone(const tinyxml2::XMLElement* xml_element);

tinyxml2::XMLElement* writeCone(const std::shared_ptr<const tesseract_geometry::Cone>& cone,
tinyxml2::XMLDocument& doc);
Expand Down
7 changes: 3 additions & 4 deletions tesseract_urdf/include/tesseract_urdf/convex_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* CONVEX_MESH_ELEMENT_NAME = "tesseract:convex_mesh"; // NOLINT

/**
* @brief Parse xml element convex_mesh
* @param xml_element The xml element
Expand All @@ -52,10 +54,7 @@ namespace tesseract_urdf
* @return A Tesseract Geometry ConvexMesh
*/
std::vector<std::shared_ptr<tesseract_geometry::ConvexMesh>>
parseConvexMesh(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator,
bool visual,
int version);
parseConvexMesh(const tinyxml2::XMLElement* xml_element, const tesseract_common::ResourceLocator& locator, bool visual);

/**
* @brief writeConvexMesh Write convex mesh to URDF XML. This is non-standard URDF / tesseract-exclusive
Expand Down
4 changes: 3 additions & 1 deletion tesseract_urdf/include/tesseract_urdf/cylinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* CYLINDER_ELEMENT_NAME = "cylinder"; // NOLINT

/**
* @brief Parse a xml cylinder element
* @param xml_element The xml element
* @return Tesseract Geometry Cylinder
*/
std::shared_ptr<tesseract_geometry::Cylinder> parseCylinder(const tinyxml2::XMLElement* xml_element, int version);
std::shared_ptr<tesseract_geometry::Cylinder> parseCylinder(const tinyxml2::XMLElement* xml_element);

tinyxml2::XMLElement* writeCylinder(const std::shared_ptr<const tesseract_geometry::Cylinder>& cylinder,
tinyxml2::XMLDocument& doc);
Expand Down
5 changes: 3 additions & 2 deletions tesseract_urdf/include/tesseract_urdf/dynamics.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* DYNAMICS_ELEMENT_NAME = "dynamics"; // NOLINT

/**
* @brief Parse a xml dynamics element
* @param xml_element The xml element
* @return Tesseract JointDynamics
*/
std::shared_ptr<tesseract_scene_graph::JointDynamics> parseDynamics(const tinyxml2::XMLElement* xml_element,
int version);
std::shared_ptr<tesseract_scene_graph::JointDynamics> parseDynamics(const tinyxml2::XMLElement* xml_element);

tinyxml2::XMLElement* writeDynamics(const std::shared_ptr<const tesseract_scene_graph::JointDynamics>& dynamics,
tinyxml2::XMLDocument& doc);
Expand Down
5 changes: 3 additions & 2 deletions tesseract_urdf/include/tesseract_urdf/geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* GEOMETRY_ELEMENT_NAME = "geometry"; // NOLINT

/**
* @brief Parse xml element geometry
* @param xml_element The xml element
Expand All @@ -53,8 +55,7 @@ namespace tesseract_urdf
*/
std::shared_ptr<tesseract_geometry::Geometry> parseGeometry(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator,
bool visual,
int version);
bool visual);

/**
* @brief writeGeometry Write geometry to URDF XML
Expand Down
4 changes: 3 additions & 1 deletion tesseract_urdf/include/tesseract_urdf/inertial.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* INERTIAL_ELEMENT_NAME = "inertial"; // NOLINT

/**
* @brief Parse xml element inertial
* @param xml_element The xml element
* @param version The version number
* @return A Tesseract Inertial
*/
std::shared_ptr<tesseract_scene_graph::Inertial> parseInertial(const tinyxml2::XMLElement* xml_element, int version);
std::shared_ptr<tesseract_scene_graph::Inertial> parseInertial(const tinyxml2::XMLElement* xml_element);

tinyxml2::XMLElement* writeInertial(const std::shared_ptr<const tesseract_scene_graph::Inertial>& inertial,
tinyxml2::XMLDocument& doc);
Expand Down
4 changes: 3 additions & 1 deletion tesseract_urdf/include/tesseract_urdf/joint.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* JOINT_ELEMENT_NAME = "joint"; // NOLINT

/**
* @brief Parse xml element joint
* @param xml_element The xml element
* @param version The version number
* @return A Tesseract Joint
*/
std::shared_ptr<tesseract_scene_graph::Joint> parseJoint(const tinyxml2::XMLElement* xml_element, int version);
std::shared_ptr<tesseract_scene_graph::Joint> parseJoint(const tinyxml2::XMLElement* xml_element);

tinyxml2::XMLElement* writeJoint(const std::shared_ptr<const tesseract_scene_graph::Joint>& joint,
tinyxml2::XMLDocument& doc);
Expand Down
4 changes: 3 additions & 1 deletion tesseract_urdf/include/tesseract_urdf/limits.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* LIMITS_ELEMENT_NAME = "limit"; // NOLINT

/**
* @brief Parse xml element limits
* @param xml_element The xml element
* @param version The version number
* @return A Tesseract JointLimits
*/
std::shared_ptr<tesseract_scene_graph::JointLimits> parseLimits(const tinyxml2::XMLElement* xml_element, int version);
std::shared_ptr<tesseract_scene_graph::JointLimits> parseLimits(const tinyxml2::XMLElement* xml_element);

tinyxml2::XMLElement* writeLimits(const std::shared_ptr<const tesseract_scene_graph::JointLimits>& limits,
tinyxml2::XMLDocument& doc);
Expand Down
5 changes: 3 additions & 2 deletions tesseract_urdf/include/tesseract_urdf/link.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* LINK_ELEMENT_NAME = "link"; // NOLINT

/**
* @brief Parse xml element link
* @param xml_element The xml element
Expand All @@ -54,8 +56,7 @@ namespace tesseract_urdf
std::shared_ptr<tesseract_scene_graph::Link>
parseLink(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator,
std::unordered_map<std::string, std::shared_ptr<tesseract_scene_graph::Material>>& available_materials,
int version);
std::unordered_map<std::string, std::shared_ptr<tesseract_scene_graph::Material>>& available_materials);

/**
* @brief writeLink Write a link to URDF XML
Expand Down
5 changes: 3 additions & 2 deletions tesseract_urdf/include/tesseract_urdf/material.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* MATERIAL_ELEMENT_NAME = "material"; // NOLINT

/**
* @brief Parse xml element material
* @param xml_element The xml element
Expand All @@ -53,8 +55,7 @@ namespace tesseract_urdf
std::shared_ptr<tesseract_scene_graph::Material>
parseMaterial(const tinyxml2::XMLElement* xml_element,
std::unordered_map<std::string, std::shared_ptr<tesseract_scene_graph::Material>>& available_materials,
bool allow_anonymous,
int version);
bool allow_anonymous);

tinyxml2::XMLElement* writeMaterial(const std::shared_ptr<const tesseract_scene_graph::Material>& material,
tinyxml2::XMLDocument& doc);
Expand Down
5 changes: 3 additions & 2 deletions tesseract_urdf/include/tesseract_urdf/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* MESH_ELEMENT_NAME = "mesh"; // NOLINT

/**
* @brief Parse xml element mesh
* @param xml_element The xml element
Expand All @@ -53,8 +55,7 @@ namespace tesseract_urdf
*/
std::vector<std::shared_ptr<tesseract_geometry::Mesh>> parseMesh(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator,
bool visual,
int version);
bool visual);

/**
* @brief writeMesh Write a mesh to URDF XML and PLY file
Expand Down
4 changes: 3 additions & 1 deletion tesseract_urdf/include/tesseract_urdf/mimic.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* MIMIC_ELEMENT_NAME = "mimic"; // NOLINT

/**
* @brief Parse xml element mimic
* @param xml_element The xml element
* @param version The version number
* @return A Tesseract JointMimic
*/
std::shared_ptr<tesseract_scene_graph::JointMimic> parseMimic(const tinyxml2::XMLElement* xml_element, int version);
std::shared_ptr<tesseract_scene_graph::JointMimic> parseMimic(const tinyxml2::XMLElement* xml_element);

tinyxml2::XMLElement* writeMimic(const std::shared_ptr<const tesseract_scene_graph::JointMimic>& mimic,
tinyxml2::XMLDocument& doc);
Expand Down
5 changes: 3 additions & 2 deletions tesseract_urdf/include/tesseract_urdf/octomap.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* OCTOMAP_ELEMENT_NAME = "tesseract:octomap"; // NOLINT

/**
* @brief Parse xml element octomap
* @param xml_element The xml element
Expand All @@ -52,8 +54,7 @@ namespace tesseract_urdf
*/
std::shared_ptr<tesseract_geometry::Octree> parseOctomap(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator,
bool visual,
int version);
bool visual);

/**
* @brief writeOctomap Write octomap to URDF XML. This is non-standard URDF / tesseract-exclusive
Expand Down
5 changes: 3 additions & 2 deletions tesseract_urdf/include/tesseract_urdf/octree.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* OCTREE_ELEMENT_NAME = "tesseract:octree"; // NOLINT

/**
* @brief Parse xml element octree
* @param xml_element The xml element
Expand All @@ -53,8 +55,7 @@ namespace tesseract_urdf
std::shared_ptr<tesseract_geometry::Octree> parseOctree(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator,
tesseract_geometry::OctreeSubType shape_type,
bool prune,
int version);
bool prune);

/**
* @brief writeOctree Write octree out to file, and generate appropriate xml
Expand Down
4 changes: 3 additions & 1 deletion tesseract_urdf/include/tesseract_urdf/origin.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* ORIGIN_ELEMENT_NAME = "origin"; // NOLINT

/**
* @brief Parse xml element origin
* @param xml_element The xml element
* @param version The version number
* @return A Eigen::Isometry3d
*/
Eigen::Isometry3d parseOrigin(const tinyxml2::XMLElement* xml_element, int version);
Eigen::Isometry3d parseOrigin(const tinyxml2::XMLElement* xml_element);

tinyxml2::XMLElement* writeOrigin(const Eigen::Isometry3d& origin, tinyxml2::XMLDocument& doc);

Expand Down
5 changes: 3 additions & 2 deletions tesseract_urdf/include/tesseract_urdf/point_cloud.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* POINT_CLOUD_ELEMENT_NAME = "tesseract:point_cloud"; // NOLINT

/**
* @brief Parse xml element point_cloud
* @param xml_element The xml element
Expand All @@ -54,8 +56,7 @@ namespace tesseract_urdf
std::shared_ptr<tesseract_geometry::Octree> parsePointCloud(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator,
tesseract_geometry::OctreeSubType shape_type,
bool prune,
int version);
bool prune);
} // namespace tesseract_urdf

#endif // TESSERACT_URDF_POINT_CLOUD_H
5 changes: 3 additions & 2 deletions tesseract_urdf/include/tesseract_urdf/safety_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* SAFETY_CONTROLLER_ELEMENT_NAME = "safety_controller"; // NOLINT

/**
* @brief Parse xml element safety_controller
* @param xml_element The xml element
* @param version The version number
* @return A Tesseract JointSafety
*/
std::shared_ptr<tesseract_scene_graph::JointSafety> parseSafetyController(const tinyxml2::XMLElement* xml_element,
int version);
std::shared_ptr<tesseract_scene_graph::JointSafety> parseSafetyController(const tinyxml2::XMLElement* xml_element);
tinyxml2::XMLElement* writeSafetyController(const std::shared_ptr<const tesseract_scene_graph::JointSafety>& safety,
tinyxml2::XMLDocument& doc);

Expand Down
5 changes: 3 additions & 2 deletions tesseract_urdf/include/tesseract_urdf/sdf_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class XMLDocument;

namespace tesseract_urdf
{
static const char* SDF_MESH_ELEMENT_NAME = "tesseract:sdf_mesh"; // NOLINT

/**
* @brief Parse xml element sdf_mesh
* @param xml_element The xml element
Expand All @@ -52,8 +54,7 @@ namespace tesseract_urdf
*/
std::vector<std::shared_ptr<tesseract_geometry::SDFMesh>> parseSDFMesh(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator,
bool visual,
int version);
bool visual);

/**
* @brief writeSDFMesh Write SDF Mesh to URDF XML. This is non-standard URDF / tesseract-exclusive
Expand Down
Loading
Loading