Skip to content

changing_wave_params_tutorial

M1chaelM edited this page Jul 15, 2021 · 3 revisions

Changing the Wave Field

As an illustrative example, we'll go through testing the simulation with different wave scenarios. The wave field characteristics are defined in the wave_gazebo/world_models/ocean_waves/model.xacro file. When we open the file we see a section that looks like this...

 <xacro:macro name="ocean_waves" params="gain:=0.1 period:=5
                     direction_x:=1.0 direction_y:=0.0
                     angle:=0.4">

This specifies the ocean_waves macro with five optional input parameters. This macro is used to add the ocean model to world descriptions within the VRX simulation. For example, the vrx_gazebo/worlds/example_course.world.xacro file contains this snippet

    <!--Waves-->
    <xacro:include filename="$(find wave_gazebo)/world_models/ocean_waves/model.xacro"/>
    <xacro:ocean_waves/>

which calls the ocean_waves macro with using the default input parameters.

Consider the case where we are testing a new algorithm and want to start with a flat ocean (no waves) before adding wave induced motion. We could accomplish this a few different ways.

Option 1: Change global default parameters. One option is to change the default wave parameter values. Edit the wave_gazebo/world_models/ocean_waves/model.xacro file, changing the gain value to zero, so it looks like this.

 <xacro:macro name="ocean_waves" params="gain:=0.0 period:=5
                     direction_x:=1.0 direction_y:=0.0
                     angle:=0.4">

Now, for any world that uses the macro without explicitly setting the gain parameter, the value will be zero so all the wave amplitudes will be zero - a flat ocean. Note, you will need to run catkin_make so that the changes take effect.

Option 2: Change local parameters. A second option is to explicitly set the parameters when calling the macro. For example, edit the vrx_gazebo/worlds/example_course.world.xacro to set the gain parameter to zero when calling the macro like so...

  <!--Waves-->
    <xacro:include filename="$(find wave_gazebo)/world_models/ocean_waves/model.xacro"/>
    <xacro:ocean_waves gain="0.0"/>

Then execute catkin_make and when you run roslaunch vrx_gazebo vrx.launch (which uses the example_course world) the ocean waves will all have zero amplitude.

After testing in zero seastate, we may want to stress our algorithm by increasing the seastate. This can be accomplished by increasing the gain and/or peak period of the wave spectrum. It might also be important to test with different wave directions to make sure that a particular solution isn't dependent on a particular wave direction. Ideally, solutions would be tested over the range of possible seastate parameters - see current version of the VRX Technical Guide for the envelope of values which used in the VRX challenge.

We've posted a video showing how we would test with three different seastates - including how to break a buoy!

Clone this wiki locally