osrf / vrx

Virtual RobotX (VRX) resources.
Apache License 2.0
390 stars 180 forks source link

update order of wavefield parameters message #674

Closed tejalbarnwal closed 1 year ago

tejalbarnwal commented 1 year ago

Aims to close #651 and #650

Sub-Tasks

Test it

Launching one of the 2023 practice worlds with a considerable gain parameter(like say 0.8) would work

ros2 launch vrx_gz competition.launch.py world:=2023_practice/practice_2023_stationkeeping2_task
tejalbarnwal commented 1 year ago

Also, I found that the 2023_practice/practice_2023_follow_path0_task*.sdf files don't include a publisher plugin to publish the wavefield parameters. I wanted to confirm if this is intentional or if I should add that snippet.

caguero commented 1 year ago

Also, I found that the 2023_practice/practice_2023_follow_path0_task*.sdf files don't include a publisher plugin to publish the wavefield parameters. I wanted to confirm if this is intentional or if I should add that snippet.

That wasn't intentional if that's the case. Good catch!

tejalbarnwal commented 1 year ago

Also, I found that the 2023_practice/practice_2023_follow_path0_task*.sdf files don't include a publisher plugin to publish the wavefield parameters. I wanted to confirm if this is intentional or if I should add that snippet.

That wasn't intentional if that's the case. Good catch!

Hey, I will update the respective world files.

I also wanted to share some experimental tuning that I performed. As Jessica mentioned in the previous weekly meeting, keeping the steepness parameter to 1 could have led to the formation of loops. I first tried keeping the steepness to 0.5 and then slowly increasing it to 1.0 but could not observe considerable changes. I also tried increasing the value to 10.0, hoping that maybe it would help me observe, but I couldn't. Therefore, I created some recordings with different values of steepness parameters. I have attached them here. It is possible I might be missing something, and it would really help if you could provide your input.

j-herman commented 1 year ago

Hi Tejal, I took a look through the code for the wave field to try to refresh my memory on how this should work. You won't see anything change with steepness parameters above 1 because the values get clipped.
Some ideas to try for troubleshooting - zoom in a bit more than what you have in those video clips, and see if it helps distinguish wave characteristics. Try varying the gain parameter, maybe with zero wind, to see if you are getting appropriate visuals to match the wave size. You can look at the VRX Classis videos to get an idea of what the waves were like, in case that helps. I tried running a few world's on my laptop to look at this, and the surface visuals really didn't seem to be varying the way I would have expected. Wondering if maybe we are seeing something like issue 665? I'll need to spend a little more solid time on this to be sure, and I want to run it in docker as well.

tejalbarnwal commented 1 year ago

Hi Tejal, I took a look through the code for the wave field to try to refresh my memory on how this should work. You won't see anything change with steepness parameters above 1 because the values get clipped. Some ideas to try for troubleshooting - zoom in a bit more than what you have in those video clips, and see if it helps distinguish wave characteristics. Try varying the gain parameter, maybe with zero wind, to see if you are getting appropriate visuals to match the wave size. You can look at the VRX Classis videos to get an idea of what the waves were like, in case that helps. I tried running a few world's on my laptop to look at this, and the surface visuals really didn't seem to be varying the way I would have expected. Wondering if maybe we are seeing something like issue 665? I'll need to spend a little more solid time on this to be sure, and I want to run it in docker as well.

I experimented with disabling the wind plugin altogether and tried playing with gain, steepness, and even period as well. The effect of changing the period is evident, but that is not the case for steepness, even when I set the gain value to maximum(1.0). As suggested, this time, I observed the waves from close and tried to compare them with the videos shown in vrx (gazebo classic, video link).

Though the water surface around the vehicle is sort of similar shape to that shown in the here in the top left and right images, the ocean waves shown in the bottom left and right images are different from what I am experiencing. Further, it seems changing the steepness parameter has little effect on how ocean waves appear. I have attached an image below for the same. An obvious distinction I noticed was that a low steepness parameter resulted in less bouncing of the vehicle on the surface than a larger steepness value.

Steepness:1, period:5.0, gain:1.0 image image

steepness:0.5, period5.0, gain:1.0 image image

caguero commented 1 year ago

I experimented with disabling the wind plugin altogether and tried playing with gain, steepness, and even period as well. The effect of changing the period is evident, but that is not the case for steepness, even when I set the gain value to maximum(1.0).

One important detail is that gain can go bigger than 1. Could you double-check if steepness is more evident with higher values of gain?

caguero commented 1 year ago

I experimented with disabling the wind plugin altogether and tried playing with gain, steepness, and even period as well. The effect of changing the period is evident, but that is not the case for steepness, even when I set the gain value to maximum(1.0).

One important detail is that gain can go bigger than 1. Could you double-check if steepness is more evident with higher values of gain?

Another idea could be to log some values of P.x, P.y, P.z from the shader (https://github.com/osrf/vrx/blob/main/vrx_gz/models/coast_waves/materials/programs/GerstnerWaves_vs_330.glsl#L120-L122) and plot them to see if we see something interesting changing the steepness.

tejalbarnwal commented 1 year ago

I experimented with disabling the wind plugin altogether and tried playing with gain, steepness, and even period as well. The effect of changing the period is evident, but that is not the case for steepness, even when I set the gain value to maximum(1.0).

One important detail is that gain can go bigger than 1. Could you double-check if steepness is more evident with higher values of gain?

Another idea could be to log some values of P.x, P.y, P.z from the shader (https://github.com/osrf/vrx/blob/main/vrx_gz/models/coast_waves/materials/programs/GerstnerWaves_vs_330.glsl#L120-L122) and plot them to see if we see something interesting changing the steepness.

Okay, i will try it out today

tejalbarnwal commented 1 year ago

As discussed in the meeting, we can table this discussion for another time, as it appears that the steepness of ocean waves does not have a visual impact. Therefore, closing this PR.