Update URDF parser to use Tesseract XML namespace#1081
Update URDF parser to use Tesseract XML namespace#1081Levi-Armstrong merged 17 commits intotesseract-robotics:masterfrom
Conversation
I think more discussion is needed because this will have significant impact throughout Tesseract because most leverage xacro's outside of tesseract with no easy way to enable this convex hull functionality instead of duplicating and updating with the tesseract namespace to get same behavior. I think there still needs to be a global way to enable this. |
|
It looks like you can namespace attributes so we could do the following to define global setting which can be overriden locally? |
|
I like the idea of using namespace attributes where possible better than adding new elements. That way existing tools can still function (mostly) correctly without needing to understand Tesseract-specific attributes (e.g., Rviz would still render Is the global attribute really that useful? I wonder if it would be more confusing rather than helpful, especially when you start thinking about composing xacros where one xacro might want it to be on and another off, but at the highest level there can only be one value of that attribute that gets applied to all underlying xacros. I would rather just specify it at the individual mesh level to be very explicit for clarity and consistency |
While I agree that is it better to be explicit, though I do not think there is an easy way around having a global attribute which does not add significant burden to the developer. This is not easy to accomplish if you are using third party packages like fanuc, motoman, etc., because without a global attribute you would have to copy all third party xacros and modify them when you want to use convex hulls. I think we can provide the global option but change the default to |
|
Yeah, I've run into a similar problem; I ended up running xacro to create a URDF of the fully defined system, then manually added all of the custom namespace elements/attributes that I needed, which is somewhat tedious. I'll add the global attribute and set the default to not convert mesh to convex hulls, and I'll add the mesh element specific override attributes. |
9fdabd5 to
f7b1f72
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1081 +/- ##
=======================================
Coverage 88.54% 88.54%
=======================================
Files 293 292 -1
Lines 16778 16729 -49
=======================================
- Hits 14856 14813 -43
+ Misses 1922 1916 -6 🚀 New features to boost your workflow:
|
|
Also thinking we should just make the default true, because I think it is fine that we are different as long as there is ability to change the behavior. This would also require less changes possible throughout the repos. |
I would prefer to keep the default to be false (i.e., the global option is false when the attribute is not present) and make users specify that attribute explicitly. Automatically converting all mesh collision geometry to convex hulls without the users explicit instruction can result in collision checking errors that are very confusing and hard to explain for someone who doesn't know that this conversion is going on under the hood. I can add this attribute to the rest of the URDFs in |
|
My concern is that tesseract has had this default behavior since the beginning and this change is likely to break a lot existing implementation. It could go unnoticed and difficult to track down for them. If we go with false then I would recommend that it is required that the urdf contain the global attribute and have no default. |
|
Okay, let's make |
7bbc450 to
56c2ad7
Compare
|
@marip8 Do think that we should remove convex_mesh support in the urdf and just use mesh with the attribute? |
Yes, I completely removed the |
|
After adding b681a5c to fix the Windows build, I see the following error in clang-tidy and MacOS: @Levi-Armstrong any idea how to proceed? |
b681a5c to
bf8f363
Compare
Does the following work? const auto parse_collision_fn = [global_make_convex = false](const tinyxml2::XMLElement* xml_element,
const tesseract_common::ResourceLocator& locator) {
return tesseract_urdf::parseCollision(xml_element, locator, global_make_convex);
}; |
|
It appears that I fixed the issue by only providing |
|
I think the issue is that it is const. |
|
Lets hold off merging this until I finish fixing 0.28 release. |
…mes; updated names of tesseract-specific elements
…added mesh `tesseract:make_convex` attribute
bc624bf to
20ce81e
Compare
20ce81e to
3558002
Compare
|
Good initiative. Will the new style Tesseract URDF satisfy the official urdfdom XSD? See ros/urdfdom#200 for the latest version (WIP). |
Yes, I believe so. These changes do not overwrite any elements or attributes that are already specified in the urdfdom XSD. It only adds a few new namespaced geometry elements (e.g., |
|
@marip8 You good if I squash merge this? |
Great. Would it be possible to add this to the unit tests? |
Yes it should be ready for merge now and squashing the history is fine with me |
What do you mean exactly? There are unit tests that parse all of these elements with their new names and test the |
Yes |
9c15d37
into
tesseract-robotics:master
This PR addresses #1059 by removing the URDF tag
tesseract_versionand moving the custom geometry implementations to atesseractXML namespace. This should allow us to make further Tesseract-specific URDF additions in a clearer manner. Users will need to specify this XML namespace as follows:I think the URL is somewhat arbitrary, but should generally point to a location that gives the user more information about what elements are available in this namespace.
This PR also removes the behavior in
tesseract_version< 2 of automatically converting collision mesh files into into convex hulls. Now, if users wanttesseractto automatically convert mesh files to convex hulls, they will need to add the attributetesseract:make_convex="true|false"either at the global level (as an attribute in therobotelement) or at the individual mesh level (i.e., as an attribute in themeshelement)