lrauv icon indicating copy to clipboard operation
lrauv copied to clipboard

Using the VBS to sink causes the vehicle to translate forwards and go into a spin.

Open arjo129 opened this issue 4 years ago • 7 comments

How to reproduce:

In one terminal:

ign gazebo -v4 buoyant_tethys.sdf

In another:

ign topic -t  /model/tethys/buoyancy_engine/ -m ignition.msgs.Double -p "data: 0"

Expected behavior

The vehicle pitches a little bit and then sinks mostly vertically.

Current behaviour

Peek 2021-10-13 14-18 The vehicle sinks but keeps getting pushed backwards, this is likely to some weird numerical issue.

arjo129 avatar Oct 13 '21 06:10 arjo129

Spinning in yaw seems to be from the Added Mass terms and Translation is from the damping terms.

arjo129 avatar Oct 13 '21 06:10 arjo129

The longer picture is also interesting:

image

Another thing that could be related, these are the plots for the horizontal and vertical fins. With the vehicle's movement, they wiggle a bit, pushed by external forces:

image

chapulina avatar Oct 13 '21 17:10 chapulina

I've narrowed this down to an issue of transformations. Basically by sprinkling debug statements throughout the course of the Hydrodynamics plugin I get the following:

[Dbg] [HydrodynamicsPlugin.cc:248] Pose Rotation -0 0.105406 0
[Dbg] [HydrodynamicsPlugin.cc:249] Transformed Vel 0.062581 -0 -0.066591
[Dbg] [HydrodynamicsPlugin.cc:250] Original Vel 0.055228 -0 -0.072805
[Dbg] [HydrodynamicsPlugin.cc:321] Original force-0.015606 0 2.6208
[Dbg] [HydrodynamicsPlugin.cc:322] Transformed force0.260217 0 2.60789

The hydrodynamics should produce a force which opposes the direction of motion. This is happening in the local frame correctly, however when we transform back to the global frame we get incorrect results.

arjo129 avatar Oct 14 '21 01:10 arjo129

This manifests itself when going up using the Buoyancy Engine: Upward_buoyancy

But does not manifest itself when dropping the drop weight. drop_weight_hydro

arjo129 avatar Oct 14 '21 05:10 arjo129

Force visuallizations are very telling of a problem in hydrodynamics. The Blue arrow is hydrodynamic forces. The green arrow buoyancy engine forces. sinking_lrauv_problem

arjo129 avatar Oct 29 '21 03:10 arjo129

HI @arjo129, almost looks like the buoyancy force is stuck in the vehicle frame and not translated into the internal frame — I'd expect the buoyancy force to always work against gravity, regardless of the vehicle's orientation. What do you think?

braanan avatar Oct 29 '21 14:10 braanan

I checked and its not that. The buoyancy force from the vbs is always pointing opposite gravity. Its not very clear in the video but when I print it I see that its only acting in the Z axis.The hydro on the other hand is all over the place.

arjo129 avatar Oct 29 '21 23:10 arjo129