Skip to content

Commit

Permalink
Removed URDF parser tesseract version; added variables for element na…
Browse files Browse the repository at this point in the history
…mes; updated names of tesseract-specific elements
  • Loading branch information
marip8 committed Dec 13, 2024
1 parent 5ad42b6 commit 3af9919
Show file tree
Hide file tree
Showing 49 changed files with 375 additions and 295 deletions.
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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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";

/**
* @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

0 comments on commit 3af9919

Please sign in to comment.