-
Notifications
You must be signed in to change notification settings - Fork 97
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
URDF to SDF conversion ignores links without inertia #199
Comments
Original comment by Silvio Traversaro (Bitbucket: traversaro). To be honest, I think the ideal solution to the issue would be if both URDF and SDF could explicitly represent "purely kinematic frames", and in this way a URDF containing a "purely kinematic frame" would be converted to a SDF model containing a "purely kinematic frame". Clearly this is not immediate, as it would also require introducing a URDF tag or similar,or at least a Gazebo-specific extension of the URDF. |
Original comment by Silvio Traversaro (Bitbucket: traversaro).
That would be great, and it would make possible to actually replace URDF files with SDF for control/planning applications. By the way, I thought about it and there is no need to modify the URDF specification at the moment: as soon as SDF supports "pure kinematic frames", it would just be necessary However, there are several corner cases: what about an URDF where all the links are inertial-less (similar to the example in this): you cannot model the non-fixed joints in Gazebo/SDF unless they actually connect physical links, how should that be converted? Perhaps the conversion should simply fail, providing a clear error explaining the reason for the failure, but even that would mean breaking backward compatibility. |
Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).
That's a good point. In this specific case, besides being connected by joints, the links also contain visuals, so they're definitely more than just frames.
Personally, I lean more towards choosing a well-defined behaviour, documenting it well, and at most printing warnings instead of failing. The idea being that over time, users will start adopting the well-defined convention. |
Original comment by Silvio Traversaro (Bitbucket: traversaro). For some reason, the first comment to this issue is visible to me only if I am logged in bitbucket. |
Original comment by Silvio Traversaro (Bitbucket: traversaro). The comment that for some reason is hidden is: |
Original comment by Silvio Traversaro (Bitbucket: traversaro). Anyhow, now that sdf v1.7 supports frames, I think the best way to deal with this is to make sure that URDF links without inertia are converted to SDF frames. |
Original comment by Silvio Traversaro (Bitbucket: traversaro).
As https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/676 is already changing the URDF → SDF converter to emit SDF 1.7 files, this probably would be even more doable. |
Original comment by Kaelin (Bitbucket: Kaelin). I happen to have run into a variant of this issue today and spent a while debugging it. In addition to the case of having not declared an An error in this case, even if massless links aren’t implemented, would be much appreciated. |
Copying relevant comments from Asana: @scpeters : links without inertias connected to another link via a fixed joint could clearly be converted to a frame on the parent link, but what if the link without inertia has a collision or visual, or it's connected by a different type of joint? @EricCousineau-TRI @azeey |
Other related issue (it is a sort of "corner case"): #105 . |
Thanks @traversaro for pointing that out. My previous comment is not entirely correct. It would be true if the massless link is attached to a "massive" link with a fixed joint. Here's my current understanding: Current behavior
Desired behavior
|
For what @traversaro commented on, I've made a Wiki edit: If this is a corrected edit, @azeey could you include a link to the spec in your above post? |
In case the fixed joint contains a force torque sensor, as described in the last section of this tutorial, I assume the sensor element should be conveniently modified, when replacing the massless link with a frame, so that the sensor is not silently removed, and its measurements are still correct and with respect to the correct frame. |
SOLVED MY PROBLEM, BIG THANKS! |
we should improve the console error message for this: gazebosim/gazebo-classic#2869 |
I suspect this is what you are experiencing @fabiodinatale. Anyhow, this is quite a different problem from the one described in this issue. In this issue we are discussing that URDF to SDF ignores links without inertia, while the issue is about URDF to SDF ignoring links with really small mass, that is quite a different problem. For this reason, I opened a new issue: #1007 . |
Thanks @traversaro! |
Probably this will be fixed by #1148 . |
maybe in some cases, but #1148 only has an effect for links connected by fixed joints, so the The challenge is that URDF defaults to zero inertia values if |
Let's start improving the user information until a proper fix is made: first step #1171 |
This can probably be considered fixed by #1238, in the end links without inertial properties or has a mass of 0, that is not attached rigidly with fixed joints, cannot be considered a correct workflow, the best we can do is to warn users about it in the cases where joint lumping and frames cannot resolve them. Debug messages promoted to warningsBefore #1238, links and joints that were ignored due to inertial issues, were reported via More specific warningsOther than the names of massless links, which links or joints were ignored, warnings will also provide suggestions to resolve such issues, in the event that joint lumping can help.
Joint lumpingJoint lumping is an existing mechanism to reduce the number of fixed joints in a model, see http://sdformat.org/tutorials?tut=sdformat_urdf_extensions&cat=specification&#fixed-joint-lumping. When a massless link has a fixed parent joint or child joint, the joint lumping mechanism can conveniently resolve the issue, by lumping inertias into the previously massless link, or convert it into frames. However in the event that joint lumping is turned off manually, the warning would suggest that users allow joint lumping to help resolve this massless link issue. See https://github.com/gazebosim/sdformat/blob/sdf12/test/integration/urdf_to_sdf.cc#L475-L561 for an example. |
When converting from URDF to SDFormat, some links without an <inertial> block or a small mass may be dropped with only debug messages in a log file, which are easily missed. This makes the following changes: * When a massless link in the middle of a kinematic chain is successfully merged to its parent by fixed joint reduction, fix bug that was dropping the massless link's child links and joints. * Print no warnings or debug messages when a massless link is successfully merged to a parent by fixed joint reduction. * Promote debug messages to warnings / errors when links are dropped to improve visibility. Improve message clarity and suggest fixes to the user. * Change massless threshold test to `> 0` instead of being within a 1e-6 tolerance of 0. * Add unit and integration tests. Related to #199 and #1007. (cherry picked from commit 6ffe669) Signed-off-by: Aaron Chong <[email protected]> Co-authored-by: Steve Peters <[email protected]>
Original report (archived issue) by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).
For example, this:
Results in:
But when inertia is added, the link is not ignored:
It could be argued that:
But I'd expect a URDF link without an inertia element to be converted to an SDF link without an inertia element, which is valid SDF.
This can become very confusing for someone trying to convert URDF files from the beginner tutorials to SDF and getting an empty model - based on a true story.
The text was updated successfully, but these errors were encountered: