Skip to content

Commit

Permalink
Removed convex mesh; added global tesseract:make_convex attribute; …
Browse files Browse the repository at this point in the history
…added mesh `tesseract:make_convex` attribute
  • Loading branch information
marip8 committed Jan 11, 2025
1 parent 5d636a2 commit 9fdabd5
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 286 deletions.
1 change: 0 additions & 1 deletion tesseract_urdf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ add_library(
src/capsule.cpp
src/collision.cpp
src/cone.cpp
src/convex_mesh.cpp
src/cylinder.cpp
src/dynamics.cpp
src/geometry.cpp
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 @@ -49,11 +49,12 @@ static const char* COLLISION_ELEMENT_NAME = "collision"; // NOLINT
* @brief Parse xml element collision
* @param xml_element The xml element
* @param locator The Tesseract resource locator
* @param version The version number
* @param make_convex_meshes Flag to indicate if the meshes should be converted to convex hulls
* @return A Collision object
*/
std::shared_ptr<tesseract_scene_graph::Collision> parseCollision(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator);
const tesseract_common::ResourceLocator& locator,
bool make_convex_meshes);

/**
* @brief writeCollision Write collision object to URDF XML
Expand Down
76 changes: 0 additions & 76 deletions tesseract_urdf/include/tesseract_urdf/convex_mesh.h

This file was deleted.

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 @@ -50,12 +50,13 @@ static const char* GEOMETRY_ELEMENT_NAME = "geometry"; // NOLINT
* @param xml_element The xml element
* @param locator The Tesseract resource locator
* @param visual Indicate if visual
* @param version The version number
* @param make_convex_meshes Flag to indicate if the meshes should be converted to convex hulls
* @return A Tesseract Geometry
*/
std::shared_ptr<tesseract_geometry::Geometry> parseGeometry(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator,
bool visual);
bool visual,
bool make_convex_meshes);

/**
* @brief writeGeometry Write geometry to URDF XML
Expand Down
3 changes: 2 additions & 1 deletion tesseract_urdf/include/tesseract_urdf/link.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ static const char* LINK_ELEMENT_NAME = "link"; // NOLINT
* @param xml_element The xml element
* @param locator The Tesseract resource locator
* @param available_materials The current available materials
* @param version The version number
* @param make_convex_meshes Flag to indicate if the meshes should be converted to convex hulls
* @return A Tesseract Link
*/
std::shared_ptr<tesseract_scene_graph::Link>
parseLink(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator,
bool make_convex_meshes,
std::unordered_map<std::string, std::shared_ptr<tesseract_scene_graph::Material>>& available_materials);

/**
Expand Down
10 changes: 6 additions & 4 deletions tesseract_urdf/include/tesseract_urdf/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ static const char* MESH_ELEMENT_NAME = "mesh"; // NOLINT
* @param xml_element The xml element
* @param locator The Tesseract resource locator
* @param visual Indicate if visual
* @param version The version number
* @param make_convex Flag to indicate if the mesh should be converted to a convex hull
* @return A vector of Tesseract Meshes
*/
std::vector<std::shared_ptr<tesseract_geometry::Mesh>> parseMesh(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator,
bool visual);
std::vector<std::shared_ptr<tesseract_geometry::PolygonMesh>>
parseMesh(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator,
bool visual,
bool make_convex);

/**
* @brief writeMesh Write a mesh to URDF XML and PLY file
Expand Down
1 change: 0 additions & 1 deletion tesseract_urdf/include/tesseract_urdf/visual.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ static const char* VISUAL_ELEMENT_NAME = "visual"; // NOLINT
* @brief Parse xml element visual
* @param xml_element The xml element
* @param locator The Tesseract resource locator
* @param version The version number
* @return A Visual object
*/
std::shared_ptr<tesseract_scene_graph::Visual>
Expand Down
5 changes: 3 additions & 2 deletions tesseract_urdf/src/collision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP
namespace tesseract_urdf
{
tesseract_scene_graph::Collision::Ptr parseCollision(const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator)
const tesseract_common::ResourceLocator& locator,
bool make_convex_meshes)
{
// get name
std::string collision_name = tesseract_common::StringAttribute(xml_element, "name", "");
Expand Down Expand Up @@ -71,7 +72,7 @@ tesseract_scene_graph::Collision::Ptr parseCollision(const tinyxml2::XMLElement*
tesseract_geometry::Geometry::Ptr geom;
try
{
geom = parseGeometry(geometry, locator, false);
geom = parseGeometry(geometry, locator, false, make_convex_meshes);
}
catch (...)
{
Expand Down
150 changes: 0 additions & 150 deletions tesseract_urdf/src/convex_mesh.cpp

This file was deleted.

Loading

0 comments on commit 9fdabd5

Please sign in to comment.