diff --git a/Migration.md b/Migration.md index 4f6632b474..b6cd731352 100644 --- a/Migration.md +++ b/Migration.md @@ -23,6 +23,10 @@ release will remove the deprecated code. `gz::sim::systems::kPostPhysicsSensorPriority` constant to ensure that its `Update` phase executes after `Physics::Update` and before systems with default priority. + * **Deprecated** + + In the Hydrodynamics system, added mass has been deprecated in favour of + the builtin sdformat `` tag that offers better stability + guarantees. ## Gazebo Sim 7.x to 8.0 * **Deprecated** diff --git a/examples/worlds/acoustic_comms_demo.sdf b/examples/worlds/acoustic_comms_demo.sdf index 6e1be4c4b9..9db0b7460e 100644 --- a/examples/worlds/acoustic_comms_demo.sdf +++ b/examples/worlds/acoustic_comms_demo.sdf @@ -71,7 +71,7 @@ 0 0 1 0 0 1.57 - https://fuel.gazebosim.org/1.0/accurrent/models/MBARI Tethys LRAUV + https://fuel.gazebosim.org/1.0/OpenRobotics/models/LRAUV Post-Ionic base_link - -4.876161 - -126.324739 - -126.324739 - 0 - -33.46 - -33.46 -6.2282 0 -601.27 @@ -172,7 +166,7 @@ 15 0 1 0 0 1.57 - https://fuel.gazebosim.org/1.0/accurrent/models/MBARI Tethys LRAUV + https://fuel.gazebosim.org/1.0/OpenRobotics/models/LRAUV Post-Ionic triton @@ -250,12 +244,6 @@ filename="gz-sim-hydrodynamics-system" name="gz::sim::systems::Hydrodynamics"> base_link - -4.876161 - -126.324739 - -126.324739 - 0 - -33.46 - -33.46 -6.2282 0 -601.27 @@ -274,7 +262,7 @@ -15 0 1 0 0 1.57 - https://fuel.gazebosim.org/1.0/accurrent/models/MBARI Tethys LRAUV + https://fuel.gazebosim.org/1.0/OpenRobotics/models/LRAUV Post-Ionic daphne @@ -352,12 +340,6 @@ filename="gz-sim-hydrodynamics-system" name="gz::sim::systems::Hydrodynamics"> base_link - -4.876161 - -126.324739 - -126.324739 - 0 - -33.46 - -33.46 -6.2282 0 -601.27 diff --git a/examples/worlds/auv_controls.sdf b/examples/worlds/auv_controls.sdf index 18914a6629..45f39d8958 100644 --- a/examples/worlds/auv_controls.sdf +++ b/examples/worlds/auv_controls.sdf @@ -71,7 +71,7 @@ 0 0 1 0 0 1.57 - https://fuel.gazebosim.org/1.0/accurrent/models/MBARI%20Tethys%20LRAUV + https://fuel.gazebosim.org/1.0/OpenRobotics/models/LRAUV Post-Ionic base_link - -4.876161 - -126.324739 - -126.324739 - 0 - -33.46 - -33.46 -6.2282 0 -601.27 diff --git a/examples/worlds/dvl_world.sdf b/examples/worlds/dvl_world.sdf index 0b599a3cb4..5369129c01 100644 --- a/examples/worlds/dvl_world.sdf +++ b/examples/worlds/dvl_world.sdf @@ -134,10 +134,9 @@ - 0 0 -80 0 0 1.57 - https://fuel.gazebosim.org/1.0/accurrent/models/MBARI Tethys LRAUV + https://fuel.gazebosim.org/1.0/OpenRobotics/models/LRAUV Post-Ionic base_link - -4.876161 - -126.324739 - -126.324739 - 0 - -33.46 - -33.46 - -6.2282 0 -601.27 0 diff --git a/examples/worlds/lrauv_control_demo.sdf b/examples/worlds/lrauv_control_demo.sdf index 56e3900b2b..db4f22360a 100644 --- a/examples/worlds/lrauv_control_demo.sdf +++ b/examples/worlds/lrauv_control_demo.sdf @@ -175,7 +175,7 @@ 0 0 1 0 0 0 - https://fuel.gazebosim.org/1.0/accurrent/models/MBARI Tethys LRAUV + https://fuel.gazebosim.org/1.0/OpenRobotics/models/LRAUV Post-Ionic base_link - -4.876161 - -126.324739 - -126.324739 - 0 - -33.46 - -33.46 -6.2282 0 -601.27 diff --git a/examples/worlds/multi_lrauv_race.sdf b/examples/worlds/multi_lrauv_race.sdf index 902d89111a..375a0a1332 100644 --- a/examples/worlds/multi_lrauv_race.sdf +++ b/examples/worlds/multi_lrauv_race.sdf @@ -59,7 +59,7 @@ 0 0 1 0 0 1.57 - https://fuel.gazebosim.org/1.0/accurrent/models/MBARI Tethys LRAUV + https://fuel.gazebosim.org/1.0/OpenRobotics/models/LRAUV Post-Ionic base_link - -4.876161 - -126.324739 - -126.324739 - 0 - -33.46 - -33.46 -6.2282 0 -601.27 @@ -152,7 +146,7 @@ 5 0 1 0 0 1.57 - https://fuel.gazebosim.org/1.0/accurrent/models/MBARI Tethys LRAUV + https://fuel.gazebosim.org/1.0/OpenRobotics/models/LRAUV Post-Ionic triton @@ -222,13 +216,6 @@ filename="gz-sim-hydrodynamics-system" name="gz::sim::systems::Hydrodynamics"> base_link - -4.876161 - -126.324739 - -126.324739 - 0 - -33.46 - -33.46 - -6.2282 0 -601.27 0 @@ -246,7 +233,7 @@ -5 0 1 0 0 1.57 - https://fuel.gazebosim.org/1.0/accurrent/models/MBARI Tethys LRAUV + https://fuel.gazebosim.org/1.0/OpenRobotics/models/LRAUV Post-Ionic daphne @@ -316,12 +303,6 @@ filename="gz-sim-hydrodynamics-system" name="gz::sim::systems::Hydrodynamics"> base_link - -4.876161 - -126.324739 - -126.324739 - 0 - -33.46 - -33.46 -6.2282 0 -601.27 diff --git a/include/gz/sim/components/Model.hh b/include/gz/sim/components/Model.hh index decd6776ed..d7d2663852 100644 --- a/include/gz/sim/components/Model.hh +++ b/include/gz/sim/components/Model.hh @@ -71,13 +71,13 @@ namespace serializers << std::endl; warned = true; } - skip = true; + return _out; } } _out << "" << "" - << (skip ? std::string() : modelElem->ToString("")) + << modelElem->ToString("") << ""; return _out; } diff --git a/tutorials/adding_system_plugins.md b/tutorials/adding_system_plugins.md index 8cfa596b63..21bef1cfba 100644 --- a/tutorials/adding_system_plugins.md +++ b/tutorials/adding_system_plugins.md @@ -103,12 +103,6 @@ Uncomment the following block from `buoyant_turtle.sdf`: filename="gz-sim-hydrodynamics-system" name="gz::sim::systems::Hydrodynamics"> base_link - -0.04876161 - -1.26324739 - -1.26324739 - 0 - -0.3346 - -0.3346 -0.62282 -5 -60.127 diff --git a/tutorials/files/theory_hydrodynamics/buoyant_cylinder.sdf b/tutorials/files/theory_hydrodynamics/buoyant_cylinder.sdf index 1fac04516b..ddd7fda05e 100644 --- a/tutorials/files/theory_hydrodynamics/buoyant_cylinder.sdf +++ b/tutorials/files/theory_hydrodynamics/buoyant_cylinder.sdf @@ -291,6 +291,14 @@ 0 0.61250000000000006 + + 0.04876161 + 1.26324739 + 1.26324739 + 0 + 0.3346 + 0.3346 + @@ -329,12 +337,6 @@ filename="gz-sim-hydrodynamics-system" name="gz::sim::systems::Hydrodynamics"> base_link - -0.04876161 - -1.26324739 - -1.26324739 - 0 - -0.3346 - -0.3346 -0.62282 -5 -60.127 diff --git a/tutorials/files/underwater_vehicles/buoyant_lrauv.sdf b/tutorials/files/underwater_vehicles/buoyant_lrauv.sdf index e9f40fcbc0..07d4ff23d3 100644 --- a/tutorials/files/underwater_vehicles/buoyant_lrauv.sdf +++ b/tutorials/files/underwater_vehicles/buoyant_lrauv.sdf @@ -271,16 +271,10 @@ - - + --> diff --git a/tutorials/files/underwater_vehicles/my_lrauv/model.sdf b/tutorials/files/underwater_vehicles/my_lrauv/model.sdf index 55d2e36b26..c22d00494c 100644 --- a/tutorials/files/underwater_vehicles/my_lrauv/model.sdf +++ b/tutorials/files/underwater_vehicles/my_lrauv/model.sdf @@ -60,7 +60,32 @@ -0.0000000006729 0.0002633558262 + + 4.876161 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 126.324739 + 0.0 + 0.0 + 0.0 + 0.0 + 126.324739 + 0.0 + 0.0 + 0.0 + 0.1916 + 33.46 + 0.0 + 0.0 + 33.46 + 0.0 + + + diff --git a/tutorials/migration_hydrodynamics_addedmass.md b/tutorials/migration_hydrodynamics_addedmass.md new file mode 100644 index 0000000000..889c553c4b --- /dev/null +++ b/tutorials/migration_hydrodynamics_addedmass.md @@ -0,0 +1,85 @@ +# Migrating Added Mass from the Hydrodynamics to the Fluid Added Mass tag + +Historically, we used the specify added mass in the parameters of the hydrodynamics plugin. +Starting with Gazebo Ionic, we have deprecated that in favour of using the SDF `` tag directly. This guarantees better numerical stability. That being said, in order to actually simulate added mass your underlying physics engine must be able to support the added mass tag. So far that only includes the DART physics engine. + +# Example migration + +Given an example plugin config: +``` + + base_link + -4.876161 + -126.324739 + -126.324739 + 0 + -33.46 + -33.46 + -6.2282 + 0 + -601.27 + 0 + -601.27 + 0 + -0.1916 + 0 + -632.698957 + 0 + -632.698957 + 0 + +``` + +In your model file under the link's inertial tag add the parameters like so: +``` + + + + + + + 147.8671 + + 3.000000 + 0 + 0 + 41.980233 + 0 + 41.980233 + + + 4.876161 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 126.324739 + 0.0 + 0.0 + 0.0 + 0.0 + 126.324739 + 0.0 + 0.0 + 0.0 + 0.1916 + 33.46 + 0.0 + 0.0 + 33.46 + 0.0 + + + ... + +``` + +Finally get rid of all the parameters with `Dot` in the plugin defintition. + + +# Parameter mappings + +The hydrodynamics plugin traditionally uses `` format. Whereas the added mass is specified in the SDFormat file as ``. So for instance `` becomes ``. diff --git a/tutorials/surface_vehicles.md b/tutorials/surface_vehicles.md index a89186a502..0a4ab4d140 100644 --- a/tutorials/surface_vehicles.md +++ b/tutorials/surface_vehicles.md @@ -235,9 +235,6 @@ hydrodynamics. filename="gz-sim-hydrodynamics-system" name="gz::sim::systems::Hydrodynamics"> base_link - 0.0 - 0.0 - 0.0 -51.3 -72.4 -40.0 diff --git a/tutorials/theory_hydrodynamics.md b/tutorials/theory_hydrodynamics.md index d2e3deb47d..9885a52f5a 100644 --- a/tutorials/theory_hydrodynamics.md +++ b/tutorials/theory_hydrodynamics.md @@ -50,12 +50,6 @@ The next table summarizes all the available SDF parameters. Parameter | Description ------------------| ------------- - | Added mass in surge - | Added mass in sway - | Added mass in heave - | Added mass in roll - | Added mass in pitch - | Added mass in yaw | Quadratic drag in surge | Linear drag in surge | Quadratic drag in sway @@ -70,10 +64,9 @@ Parameter | Description | Linear drag in yaw | Default ocean current vector -**Note about added mass**: SDFormat also supports added mass natively. Until we -deprecate the added mass parameters of this plugin, do not set the added mass -parameters in both places, choose one (either in this plugin or under -`` of your link). + +For added mass we recommend setting the added mass directly on the +link via SDF. This can be done via the sdformat [`fluid_added_mass`](http://sdformat.org/spec?ver=1.11&elem=link#inertial_fluid_added_mass) tag. # A simple example diff --git a/tutorials/underwater_vehicles.md b/tutorials/underwater_vehicles.md index 1efcd90aef..e486ae2b2c 100644 --- a/tutorials/underwater_vehicles.md +++ b/tutorials/underwater_vehicles.md @@ -203,12 +203,6 @@ Uncomment the following block from `buoyant_lrauv.sdf` to enable hydrodynamics. filename="gz-sim-hydrodynamics-system" name="gz::sim::systems::Hydrodynamics"> base_link - -4.876161 - -126.324739 - -126.324739 - 0 - -33.46 - -33.46 -6.2282 0 -601.27