-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ParserConfig: save auto inertial values by default (#1325)
* Copy the inertial_stats.sdf file replace the user-defined inertial with //inertial/@auto=true and equivalent //collision/density values. * Change default value of ConfigureResolveAutoInertials to SAVE_CALCULATION to match previous API behavior. * Warn and return default inertial values if custom inertia calculator is unset. --------- Signed-off-by: Steve Peters <[email protected]> Signed-off-by: Addisu Z. Taddese <[email protected]> Co-authored-by: Addisu Z. Taddese <[email protected]>
- Loading branch information
Showing
11 changed files
with
189 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?xml version="1.0" ?> | ||
<sdf version="1.11"> | ||
<!--- | ||
Model consists of 4 cubes places symmetrically in the XY plane. | ||
+y | ||
│ | ||
┌─┼─┐ | ||
L3 │ │ │(0,5,0) | ||
└─┼─┘ | ||
│ | ||
L2┌───┐ │ ┌───┐L1 | ||
────┼┼┼┼┼───┼─────┼┼┼┼┼─── +x | ||
└───┘ │ └───┘ | ||
(-5,0,0) │ (5,0,0) | ||
┌─┼─┐ | ||
│ │ │(0,-5,0) | ||
└─┼─┘ | ||
L4│ | ||
--> | ||
<![CDATA[ | ||
This model is used to verify the "gz sdf --inertial-stats" tool. | ||
]]> | ||
<model name="test_model"> | ||
<pose>0 0 0 0 0 0</pose> | ||
|
||
<link name="link_1"> | ||
<pose>5 0 0 0 0 0</pose> | ||
<inertial auto='true' /> | ||
<collision name="collision_1"> | ||
<density>6</density> | ||
<geometry> | ||
<box> | ||
<size>1 1 1</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
<visual name="visual_1"> | ||
<geometry> | ||
<box> | ||
<size>1 1 1</size> | ||
</box> | ||
</geometry> | ||
</visual> | ||
</link> | ||
|
||
<link name="link_2"> | ||
<pose>-5 0 0 0 0 0</pose> | ||
<inertial auto='true' /> | ||
<collision name="collision_2"> | ||
<density>6</density> | ||
<geometry> | ||
<box> | ||
<size>1 1 1</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
<visual name="visual_2"> | ||
<geometry> | ||
<box> | ||
<size>1 1 1</size> | ||
</box> | ||
</geometry> | ||
</visual> | ||
</link> | ||
|
||
<link name="link_3"> | ||
<pose>0 5 0 0 0 0</pose> | ||
<inertial auto='true' /> | ||
<collision name="collision_3"> | ||
<density>6</density> | ||
<geometry> | ||
<box> | ||
<size>1 1 1</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
<visual name="visual_3"> | ||
<geometry> | ||
<box> | ||
<size>1 1 1</size> | ||
</box> | ||
</geometry> | ||
</visual> | ||
</link> | ||
|
||
<link name="link_4"> | ||
<pose>0 -5 0 0 0 0</pose> | ||
<inertial auto='true' /> | ||
<collision name="collision_4"> | ||
<density>6</density> | ||
<geometry> | ||
<box> | ||
<size>1 1 1</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
<visual name="visual_4"> | ||
<geometry> | ||
<box> | ||
<size>1 1 1</size> | ||
</box> | ||
</geometry> | ||
</visual> | ||
</link> | ||
</model> | ||
|
||
</sdf> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" ?> | ||
<!-- Since sdformat itself doesn't have an moment of inertia calculator for meshes, this file is not expected to load without errors --> | ||
<sdf version='1.11'> | ||
<model name='test_model'> | ||
<link name='L1'> | ||
<inertial auto='true'/> | ||
<collision name="collision"> | ||
<geometry> | ||
<mesh> | ||
<uri>box.dae</uri> | ||
</mesh> | ||
</geometry> | ||
</collision> | ||
</link> | ||
</model> | ||
</sdf> | ||
|