vrx_classic_changing_wind_params_tutorial - osrf/vrx GitHub Wiki
In this example we'll walk through running a simulation with different wind conditions.
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 theusv_wind_plugin
to a Gazebo world. - Changing parameters in this file will change the default wind conditions for the simulation.
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 thewind_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.
To change the wind plugin parameters we can do a combination of the following:
- Change the default wind parameters vrx_gazebo/worlds/xacros/usv_wind_plugin.xacro
- Override the default parameters when calling the macro in the vrx_gazebo/worlds/sandisland.world.xacro file.
- Change the models affected by wind or their coefficients in vrx_gazebo/worlds/sandisland.world.xacro.
Note: Make sure to run catkin_make
after any changes to process the XML macros.
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 | |
mean_vel = 0; var_gain = 8; var_time = 1 | |
mean_vel = 0; var_gain = 8; var_time = 10 | |
mean_vel = 8; var_gain = 8; var_time = 1 |
For another example, see vrx_gazebo/worlds/wind_test.world.xacro