-
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
Support for <fluid_added_mass> definition in URDF files #1467
Comments
Friendly ping :) @azeey do you have any thoughts on this? |
Hi @gabrielfpacheco, we're pretty tied up with the Gazebo Ionic feature freeze, so I won't be able to give you much guidance at the moment. My only thought is if it would be possible to use "blob insertion" for this (http://sdformat.org/tutorials?tut=sdformat_urdf_extensions&cat=specification&#gazebo-elements-for-links)
So would this work? <?xml version="1.0" ?>
<robot name="added_mass_example">
<link name="base_link">
</link>
<gazebo reference="base_link">
<inertial>
<pose>1 2 3 -0.1 0.2 -0.3</pose>
<mass>1</mass>
<inertia>...</inertia>
<fluid_added_mass>
...
</fluid_added_mass>
</inertial>
</gazebo>
</robot> |
Thank you for your response, especially considering the high workload related to the Gazebo Ionic feature freeze.
I have previously tried this approach, but $ gz sdf -p added_mass_example.urdf
Warning [parser_urdf.cc:2774] Error Code 19: Msg: urdf2sdf: link[base_link] has no <inertial> block defined. Please ensure this link has a valid mass to prevent any missing links or joints in the resulting SDF model.
Warning [parser_urdf.cc:2777] Error Code 19: Msg: urdf2sdf: link[base_link] is not modeled in sdf.<sdf version='1.11'>
<model name='added_mass_example'/>
</sdf> While blob insertion works with the visual and collision tags by merging their contents into existing visual/collision tags, it does not work similarly for inertial. Instead of merging, it generates a second (undesirable) inertial element. For instance: <?xml version="1.0" ?>
<robot name="added_mass_example">
<link name="base_link">
<inertial name="inertial">
<origin xyz="1 2 3" rpy="0 0 0"/>
<mass value="1"/>
<inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1"/>
</inertial>
</link>
<gazebo reference="base_link">
<inertial>
<fluid_added_mass>
<xx>1</xx>
<yy>1</yy>
<zz>1</zz>
<pp>1</pp>
<qq>1</qq>
<rr>1</rr>
</fluid_added_mass>
</inertial>
</gazebo>
</robot> Running <sdf version='1.11'>
<model name='added_mass_example'>
<link name='base_link'>
<inertial>
<pose>1 2 3 0 0 0</pose>
<mass>1</mass>
<inertia>
<ixx>1</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>1</iyy>
<iyz>0</iyz>
<izz>1</izz>
</inertia>
</inertial>
<inertial>
<fluid_added_mass>
<xx>1</xx>
<yy>1</yy>
<zz>1</zz>
<pp>1</pp>
<qq>1</qq>
<rr>1</rr>
</fluid_added_mass>
</inertial>
</link>
</model>
</sdf> |
After #1077, SDFormat v1.10 introduced <fluid_added_mass> to the link's
<inertial>
. However, the corresponding support to set this property from a URDF file has not been created. This issue aims to discuss potential solution paths.Desired behavior
An URDF with a
<gazebo>
tag defining the fluid added mass for the linkShould generate a corresponding SDF as follows:
Alternatives considered
Within a
<gazebo reference="link_name">
tag:Handle
<fluid_added_mass>
as other link-specific properties, such asmu1
andmu2
, and place it directly into<inertial>
where it belongs since a link is always supposed to have one, and only one, inertial element. This is the expected behavior shown in the previous section.Handle the entire
<inertial>
block similarly to<visual>
/<collision>
, i.e.: the content of the element will be inserted into eachinertial
(expected only one) of theSDFormat
link. This is described below by using existing behavior for the<visual>
element to insert the fluid added mass content into a link's visual element.Original "test.urdf" example using "visual" capabilities
SDF result, inserting the desired fluid added mass into "visual". Behavior to be replicated for "inertial"
Implementation suggestion
As the URDF specification does not define fluid added mass matrix, this inertial property is only necessary for Gazebo and the
CreateInertial
method would be kept the same.sdformat/src/parser_urdf.cc
Line 2970 in f360776
Depending on the preferred alternative, update
ParseSDFExtension
to either include<fluid_added_mass>
directly into SDF<inertial>
or change the whole inertial behavior to be such as <<visual>
which might require the creation of aInsertSDFExtensionInertial
similar to InsertSDFExtensionCollision and InsertSDFExtensionVisual.sdformat/src/parser_urdf.cc
Line 1273 in f360776
Additional context
If there is a clear solution path which would best fit the package design, I would be more than happy to contribute with a PR.
The text was updated successfully, but these errors were encountered: