vrx_classic_changing_wind_params_tutorial - osrf/vrx GitHub Wiki

Changing the Wind

In this example we'll walk through running a simulation with different wind conditions.

Default wind parameters

The default wind parameters (speed, variability, direction, etc.) are defined in the vrx_gazebo/worlds/xacros/usv_wind_plugin.xacro file.

  • This file defines the usv_wind_gazebo macro that is used to add the usv_wind_plugin to a Gazebo world.
  • Changing parameters in this file will change the default wind conditions for the simulation.

Wind Objects

The Gazebo world file defines which models are affected by the wind and how they are affected.

  • Each affected object is listed as a wind_obj under the wind_objs element.
  • The wind coefficients for each object are included in its wind_obj description.

For example, below is an exerpt from the vrx_gazebo/worlds/sandisland.world.xacro file:

<xacro:include filename="$(find vrx_gazebo)/worlds/xacros/gazebo_wind_plugin.xacro"/>
<xacro:usv_wind_gazebo>
  <wind_objs>
    <wind_obj>         
      <name>wamv</name>
      <link_name>base_link</link_name>
      <coeff_vector>0.5 0.5 0.33</coeff_vector>
    </wind_obj>
  </wind_objs>
</xacro:usv_wind_gazebo>

These lines call the usv_wind_gazebo macro and specify that the wind forces should be applied to the wamv model with the wind coefficients given.

Any number of wind_obj's may be added under wind_objs. Only one link per model is supported.

Changing wind parameters

To change the wind plugin parameters we can do a combination of the following:

Note: Make sure to run catkin_make after any changes to process the XML macros.

Visualizing the impact of wind parameters

For development purposes, the instantaneous wind speed is published as a ROS message. After launching the simulation, we can visualize wind speed using rqt_topic as follows:

rqt_plot /vrx/debug/wind/speed/data

Below are some examples to illustrate how the wind parameters affect the time history:

Wind Parameters Time History
mean_vel = 8; var_gain = 0; var_time = 1 Screenshot from 2019-07-02 13-25-52.png
mean_vel = 0; var_gain = 8; var_time = 1 Screenshot from 2019-07-02 13-29-55.png
mean_vel = 0; var_gain = 8; var_time = 10 Screenshot from 2019-07-02 13-32-09.png
mean_vel = 8; var_gain = 8; var_time = 1 Screenshot from 2019-07-02 13-34-08.png

For another example, see vrx_gazebo/worlds/wind_test.world.xacro

See Also:

⚠️ **GitHub.com Fallback** ⚠️