-
Notifications
You must be signed in to change notification settings - Fork 269
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
Revert to use of cos^2 in LiftDrag plugin #2273
Conversation
The changes in #2189 have caused a regression for our upstream users. This fix disables moment calculations by defaulting Cma to zero. It should help mitigate some of the regression. There is also an [ongoing discussion](#2189 (comment)) as to whether the cos term should be cos^2 or cos. Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
In response to #2189 (comment) As suggested by @srmainwaring I also renamed cosSweepAngle -> cos2SweepAngle to prevent further confusion. Signed-off-by: Arjo Chakravarty <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## gz-sim7 #2273 +/- ##
===========================================
- Coverage 64.74% 64.72% -0.03%
===========================================
Files 357 357
Lines 29141 29139 -2
===========================================
- Hits 18868 18860 -8
- Misses 10273 10279 +6 ☔ View full report in Codecov by Sentry. |
Looks like it needs a rebase and a commit squash to the 3 lines changed from cos->cos2. |
It's OK theres no need to do anything since we squash and rebase before we merge into main in anycase. |
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.
LGTM. Suggested more detail in the comment to explain origin of formula.
Co-authored-by: Rhys Mainwaring <[email protected]> Signed-off-by: Arjo Chakravarty <[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.
I ported the Gazebo-classic LiftDrag
to gz-sim, but I mostly copied the existing code. I didn't find any references for the equations used.
src/systems/lift_drag/LiftDrag.cc
Outdated
@@ -327,8 +327,9 @@ void LiftDragPrivate::Update(EntityComponentManager &_ecm) | |||
double sinSweepAngle = math::clamp( | |||
spanwiseI.Dot(velI), minRatio, maxRatio); | |||
|
|||
// get cos from trig identity | |||
double cosSweepAngle = sqrt(1.0 - sinSweepAngle * sinSweepAngle); | |||
// The sweep adjustment depends on the velocity component normal to the wing leading |
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.
linter seems unhappy about these lines.
double cosSweepAngle = sqrt(1.0 - sinSweepAngle * sinSweepAngle); | ||
// The sweep adjustment depends on the velocity component normal to the wing leading | ||
// edge which appears quadratically in the dynamic pressure, so scale by cos^2 . | ||
double cos2SweepAngle = 1.0 - sinSweepAngle * sinSweepAngle; |
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.
@frede791 will this break your models?
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.
No, shouldn't be an issue for the PX4 models.
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.
No this is fine.
Signed-off-by: Arjo Chakravarty <[email protected]>
🦟 Bug fix
Fixes #
Summary
In response to #2189 (comment)
As suggested by @srmainwaring I also renamed cosSweepAngle ->
cos2SweepAngle to prevent further confusion.
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.