-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding tests for hydrodynamics #1617
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you target this PR at ign-gazebo6
(Fortress)? That's where the plugin was first added. Then after merged we forward-port.
73728b4
to
df60e57
Compare
df60e57
to
b3da1a7
Compare
Signed-off-by: Dharini Dutia <[email protected]>
b3da1a7
to
e96d7ad
Compare
Signed-off-by: Dharini Dutia <[email protected]>
Signed-off-by: Dharini Dutia <[email protected]>
Signed-off-by: Dharini Dutia <[email protected]>
Signed-off-by: Dharini Dutia <[email protected]>
Signed-off-by: Dharini Dutia <[email protected]>
Signed-off-by: Dharini Dutia <[email protected]>
Signed-off-by: Dharini Dutia <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test expectations seem reasonable. You might want to put in a disclaimer that added mass was flipped as thats a behaviour change. In any case we should look at deprecating added mass here in Garden and onwards. I'll follow up with a few more tests from my side next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests look to me like good high-level tests. I'll defer any language-specific comments to more experienced reviewers.
auto dt = (double)_info.dt.count()/1e9; | ||
auto alpha = 0.9; | ||
stateDot = alpha * (state - this->dataPtr->prevState)/dt | ||
+ (1-alpha) * this->dataPtr->prevStateDot; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious, what's the reason to filter stateDot
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to smoothen the rate of change of velocity, we can directly capture WorldLinearAccelerationt
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm saying because having the rolling average filter here means that stateDot
depends on all previously visited states (rather than just the last one). I'm not sure if or how much we want to worry about this, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a valid point. It was discussed in the Buoy Sim project that this might introduce lag and instability.
@arjo129 How should I proceed here? I'm thinking to get this in to be at par with the current changes (though I want to make sure this is generally sound and not specific for LRAUV). And have a separate effort to make this suitable for buoy as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can go ahead and remove this. It will not effect LRAUV much. Alternatively we can add an alpha. Finally I thought we were deprecating the added mass within this plugin and switching to the new added mass formulation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I compared the previous implementation, the filter and WorldLinearAcceleration
and the previous implementation is definitely the most stable. Going with that and we can iterate on it in future, thanks!
Signed-off-by: Dharini Dutia <[email protected]>
40a39cb
to
0fef948
Compare
Codecov Report
@@ Coverage Diff @@
## ign-gazebo6 #1617 +/- ##
===============================================
+ Coverage 64.54% 64.69% +0.14%
===============================================
Files 320 321 +1
Lines 25904 26055 +151
===============================================
+ Hits 16720 16855 +135
- Misses 9184 9200 +16
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Dharini Dutia <[email protected]>
Summary
Updated the plugin with downstream changes from LRAUV Hydrodynamics plugin with the added mass contribution sign and smoothening
stateDot
calculation.Added tests for verifying:
Setup
Using basic shapes: sphere and cylinders in the test world.
To get hydrodynamic plugin parameters for the models,
2/5 MR^2
, cylinder =1/2 MR^2
2/3 ρπR^3
, cylinder =ρπR^2 L
-> zDotWC=6πηR
-> zWC=1/4 ρA
->zWWResources
Test it
Run the test
./build/ignition-gazebo6/bin/INTEGRATION_hydrodynamics
or check the world directly
ign gazebo src/ign-gazebo/test/worlds/hydrodynamics.sdf
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.