Is there a way to generate a constant wind like a wind tunnel?

I entered the following command to generate a wind of 5m / s in the x direction and hover the drone at the same time to record the log.

parrot-gz topic -p “~/wind” -m linear_velocity{x:5\ y:0\ z:0}

The tilt of the drone during the log and simulation did not change as expected (for example, the pitch angle fluctuates between + and-over time and is not constant), and it seems that the wind is not blowing in a certain direction.

Is there a way to generate a stable wind in a certain direction like a wind tunnel?

Hello,

Did you remove the wind plugin from the .world file? You should remove it or it will override your wind settings.

Another solution would be to use the wind plugin like this:

<plugin name="wind" filename="libsphinx_wind.so">
  <!-- Wind mean speed in m/s. -->
  <magnitude_mean>5.0</magnitude_mean>
  <!-- Wind mean direction in decimal degrees. -->
  <direction_mean>0.0</direction_mean>
  <!-- Wind mean elevation in decimal degrees. -->
  <elevation_mean>0.0</elevation_mean>
  <!-- Lowpass filter time characteristics in seconds.
          A value of 0 seconds deactivate the filter. -->
  <magnitude_time_for_rise>0.0</magnitude_time_for_rise>
  <direction_time_for_rise>0.0</direction_time_for_rise>
  <elevation_time_for_rise>0.0</elevation_time_for_rise>
  <!-- Wind expressions where "val" is the mean value. -->
  <magnitude_expr>val</magnitude_expr>
  <direction_expr>val</direction_expr>
  <elevation_expr>val</elevation_expr>
</plugin>
2 Likes

Thank you for your reply.

By fixing the value of <direction_expr> in the .world file, I was able to generate the wind from a certain direction.

I wanted to generate wind from the z direction (wind from below and above the drone), so I fixed the value of <direction_expr> and entered the following command, but x = 5, y = 0, z = 0 wind speed has occurred.

parrot-gz topic -p “~ / wind” -m linear_velocity {x: 0 \ y: 0 \ z: 5}

Is it possible to generate wind in the z direction (wind from below or above the drone)?

If you use the wind plugin, you have to use JSON-RPC commands to modify plugin parameters:

For example, to set the wind magnitude to 5 m/s along the x axis:

echo '{"jsonrpc": "2.0", "method": "SetParam", "params": {"machine":"world", "object":"wind/wind", "parameter":"magnitude_mean", "value":"5"}, "id": 1}' | curl -d @- http://127.0.0.1:8383 | python -m json.tool
echo '{"jsonrpc": "2.0", "method": "SetParam", "params": {"machine":"world", "object":"wind/wind", "parameter":"magnitude_expr", "value":"val"}, "id": 1}' | curl -d @- http://127.0.0.1:8383 | python -m json.tool

To set the wind direction along the z axis:

echo '{"jsonrpc": "2.0", "method": "SetParam", "params": {"machine":"world", "object":"wind/wind", "parameter":"elevation_mean", "value":"90"}, "id": 1}' | curl -d @- http://127.0.0.1:8383 | python -m json.tool

I entered the following command, but could not generate wind in the z-axis direction.

echo ‘{“jsonrpc”: “2.0”, “method”: “SetParam”, “params”: {“machine”:“world”, “object”:“wind/wind”, “parameter”:“elevation_mean”, “value”:“90”}, “id”: 1}’ | curl -d @- http://127.0.0.1:8383 | python -m json.tool
echo ‘{“jsonrpc”: “2.0”, “method”: “SetParam”, “params”: {“machine”:“world”, “object”:“wind/wind”, “parameter”:“magnitude_mean”, “value”:“5”}, “id”: 1}’ | curl -d @- http://127.0.0.1:8383 | python -m json.tool

It is possible to generate wind in the x-axis and y-axis directions (wind from the front and side of the drone), but it may not be possible to generate wind in the z-axis direction (wind from below and above the drone).

Sorry for the late reply.

If you use the plugin, you have to follow these steps:

1 - Deactivate the filters:

echo '{"jsonrpc": "2.0", "method": "SetParam", "params": {"machine":"world", "object":"wind/wind", "parameter":"direction_time_for_rise", "value":"0"}, "id": 1}' | curl -d @- http://127.0.0.1:8383 | python -m json.tool
echo '{"jsonrpc": "2.0", "method": "SetParam", "params": {"machine":"world", "object":"wind/wind", "parameter":"elevation_time_for_rise", "value":"0"}, "id": 1}' | curl -d @- http://127.0.0.1:8383 | python -m json.tool
echo '{"jsonrpc": "2.0", "method": "SetParam", "params": {"machine":"world", "object":"wind/wind", "parameter":"magnitude_time_for_rise", "value":"0"}, "id": 1}' | curl -d @- http://127.0.0.1:8383 | python -m json.tool

2 - Reset the expressions:

echo '{"jsonrpc": "2.0", "method": "SetParam", "params": {"machine":"world", "object":"wind/wind", "parameter":"direction_expr", "value":"val"}, "id": 1}' | curl -d @- http://127.0.0.1:8383 | python -m json.tool
echo '{"jsonrpc": "2.0", "method": "SetParam", "params": {"machine":"world", "object":"wind/wind", "parameter":"elevation_expr", "value":"val"}, "id": 1}' | curl -d @- http://127.0.0.1:8383 | python -m json.tool
echo '{"jsonrpc": "2.0", "method": "SetParam", "params": {"machine":"world", "object":"wind/wind", "parameter":"magnitude_expr", "value":"val"}, "id": 1}' | curl -d @- http://127.0.0.1:8383 | python -m json.tool

3 - Set the magnitude value:

echo '{"jsonrpc": "2.0", "method": "SetParam", "params": {"machine":"world", "object":"wind/wind", "parameter":"magnitude_mean", "value":"5"}, "id": 1}' | curl -d @- http://127.0.0.1:8383 | python -m json.tool

4 - Set the elevation value:

echo '{"jsonrpc": "2.0", "method": "SetParam", "params": {"machine":"world", "object":"wind/wind", "parameter":"elevation_mean", "value":"90"}, "id": 1}' | curl -d @- http://127.0.0.1:8383 | python -m json.tool

There is an issue that prevents from changing the elevation_mean value if the magnitude_mean is 0. So the magnitude_mean value must be greater than zero BEFORE setting the elevation_mean value.