osrf / vrx

Virtual RobotX (VRX) resources.
Apache License 2.0
389 stars 178 forks source link

Bouncing buoys in perception task #689

Closed M1chaelM closed 1 year ago

M1chaelM commented 1 year ago

@tejalbarnwal Reports that buoys dropped from just above the surface in the perception task exhibit strange behavior, causing them to bounce off the surface of the water. See this video.

caguero commented 1 year ago

Hints:

tejalbarnwal commented 1 year ago

Hey, I made the following observations:

  1. When we decrease the gain of the waves, the oscillation automatically reduce Following is gif presenting the simulation with period 6 and gain 0.2

    This is the reason we don't observe the same behavior with perception_task0

  2. Spawning from lowered z (unchanged drag values and unchanged geometry)

    We see that bouncing for round buoys increased. This may be happening due to the abrupt total buoyancy force(of a magnitude of approximately 20 times the actual weight of buoys) and the drag force not being so significant.

  3. Spawning all from above 0(the entire buoy is above 0)

This one performed better than the values from the main and the case where spawn from a negative z Though we see oscillations haven't reduced completely.

  1. Reduction in size(without modification to spawning position and unchanged drag values)

    I tried to modify the geometry element(like reducing the radius of the round buoy); though we see oscillations have reduced for some, for others, it hasn't. The reduced size also increases the submerged part, giving a little more realistic sense. GIF: link

  2. Reduction in size(with spawned positions being all above 0) GIF Link We see that magnitude of oscillations has reduced, which dampens out after some time.

  3. I also played with the linear drag coefficient and increased it to see its effect Some background: The underlying drag force estimation is done with a very simple model, and the drag coefficient needs tuning according to the behavior we aspire for. I referred to the text pointed out in the comments and the steps there to tune it. link to the book. See 2.5 pg 186

I tried four different configurations(the original value of drag for round buoys is 25): a. Increased drag to 75, with all buoys spawned above 0: link

b. Increased drag to 150, with all buoys spawned above 0: link

c. Increased drag to 150, with spawning positions of buoys unchanged: link

d. Increased drag to 150, with all buoys spawned below 0: link

With all the above observations, the dynamics of waves with drag forces are not working as we require. It is very wierd to see that orange buoys, when raised from below, experience good enough drag, but it is not the case with black buoys even if the drag coefficient is set at 150.

For the purpose of finding the best set of parameters:

  1. We spawn all buoys from above
  2. We increase the linear drag coefficient
  3. We reduced the size a little bit to make it more realistic for round buoys I came to a conclusion with the following parameters: Spawned z position be at least equal to the size of the radius for round buoys, and other buoys could be spawned from the z=0.7 positions. We increase the drag coefficient to around 75 for perception_task1 and perception_task2 to have negligible oscillations. We could achieve the same by reducing the size of round buoys inside the buoyancy plugin to 0.18 instead of 0.25 and then increasing the drag coefficient to around 40 to have negligible oscillations.
tejalbarnwal commented 1 year ago

Edit: perception_task1 with updated parameters(drag coefficient 40, geometry radius 0.18 from the original value of 0.25): link

https://github.com/osrf/vrx/assets/64950661/97d5f70b-ede1-43bc-8b8f-d25935df9972

perception_task1 with updated parameters(drag coefficient 75, reduce geometry to 0.21 from the original value of 0.25): link

https://github.com/osrf/vrx/assets/64950661/698eda96-39b9-4af4-87c5-845dd51050d6

I think the second configuration is better as it reduces the velocity of the round buoy with just one oscillation, and we still see a major chunk of the sphere. Let me know your thoughts. I will then set the values accordingly.

caguero commented 1 year ago

Thanks for the detailed analysis, this looks like a great improvement! Let's go with the second configuration then.