vrx_classic_changing_wave_params_tutorial - osrf/vrx GitHub Wiki
In this example we'll walk through running a simulation with different wave scenarios.
The wave field characteristics are defined in the wave_gazebo/world_models/ocean_waves/model.xacro
file.
- This file defines the
ocean_waves
XML macro that is used to add the ocean model to a Gazebo world. - Changing default parameter values in this file will change the default wave conditions for the simulation.
Below is an excerpt showing the macro definition with five optional input parameters and their default values:
<xacro:macro name="ocean_waves" params="gain:=0.1 period:=5
direction_x:=1.0 direction_y:=0.0
angle:=0.4">
The following excerpt from the vrx_gazebo/worlds/example_course.world.xacro
file shows an example of how to use this macro in a world file with the default input parameters:
<!--Waves-->
<xacro:include filename="$(find wave_gazebo)/world_models/ocean_waves/model.xacro"/>
<xacro:ocean_waves/>
To change the wind plugin parameters we can do any combination of the following:
- Change the default wave parameters in the
wave_gazebo/world_models/ocean_waves/model.xacro
file. - Override the default parameters when calling the macro locally in a world file.
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 in two ways:
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 the value of the gain parameter will be zero for any world that uses the macro without explicitly setting the gain parameter. Consequently, all the wave amplitudes will be zero - a flat ocean. Note, you will need to run catkin_make
so that the changes take effect.
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:
<!--Waves-->
<xacro:include filename="$(find wave_gazebo)/world_models/ocean_waves/model.xacro"/>
<xacro:ocean_waves gain="0.0"/>
Then execute catkin_make
and start vrx.launch
(which uses the example_course world):
catkin_make
roslaunch vrx_gazebo vrx.launch
This will bring up a simulation envirornment in which the ocean waves all have zero amplitude.
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.
- 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.
- We may also want to test with different wave directions to make sure that a particular solution isn't dependent on a particular wave direction.
We've posted a video showing how we would test with three different seastates - including how to break a buoy!