-
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
Porting Advanced Lift Drag Plugin to Gazebo #2185
Conversation
I have updated the PR description to include more detail regarding the PX4 origin and what is the plugin is aiming to achieve and also addressed the requested changes. |
Signed-off-by: frederik <[email protected]>
Signed-off-by: frederik <[email protected]>
Signed-off-by: frederik <[email protected]>
Any chance we could get a minimal example or test? |
Here is a flight log of a test flight I conducted with the advanced plane and the advanced lift drag plugin: |
Here is an additional flight, which also includes a landing. |
Signed-off-by: frederik <[email protected]>
Hi @frede791 ,
Similarly the original liftdrag plugin has the following example and tests:
It is important to include such minimal examples and tests so that when we change things we can catch regressions. It also allows us as reviewers to quickly test things otherwise I would be approving this blindly as many of us don't necessarily work with Pixhawk on a day-to-day basis. If you can;t write a test, at least an example file or instructions to test would be nice. Perhaps basing it off the PR you created for the pixhawk community would be nice. |
… codecheck Signed-off-by: frederik <[email protected]>
I've updated the formatting of the plugin files to conform with codecheck. I also included an example file that was adapted from the PX4 advanced plane and used a similar layout as in the lift drag plugin example. |
Since generating this plugin requires a lot of parameters taken from AVL, I have written a standalone tool that can automate this process by only requiring some physical dimensions of the vehicle. At the moment, I am planning on placing this within the PX4 codebase: |
Apologies, I've been very busy the past few weeks and hence have not had the time to look at the tool. Perhaps you can present this tool at a simulation meeting or an aerial working group meeting. I'm not sure we should include it in here. Perhaps a tutorial linking to the tool you wrote would be good. 😄 |
The README for the tool I created is pretty self-contained but it would perhaps make sense to add in a README here which links to the tool. |
That sounds great. Alternatively, you can add a link to the tool in the header documentation.
…On Sun, Oct 22, 2023, 6:28 PM Frederik Markus ***@***.***> wrote:
The README for the tool I created is pretty self-contained but it would
perhaps make sense to add in a README here which links to the tool.
—
Reply to this email directly, view it on GitHub
<#2185 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEEMQEROWASFGSY6IAUJXDYATYLRAVCNFSM6AAAAAA5PE5KYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZUGA2TMMJUGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Signed-off-by: frederik <[email protected]>
Signed-off-by: frederik <[email protected]>
Signed-off-by: frederik <[email protected]>
@arjo129 I've added in a short section in the header file that links to the tool itself. Also fixed some linting issues (that |
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 getting closer however, I'm unable to run the examples as the mesh paths are hard coded. Consider uploading the plane model to fuel.
Signed-off-by: frederik <[email protected]>
Signed-off-by: frederik <[email protected]>
Signed-off-by: frederik <[email protected]>
@arjo129 Addressed your issues and uploaded the plane to Gazebo fuel. |
Codecov Report
@@ Coverage Diff @@
## gz-sim7 #2185 +/- ##
===========================================
- Coverage 65.00% 64.75% -0.25%
===========================================
Files 356 357 +1
Lines 28932 29145 +213
===========================================
+ Hits 18808 18874 +66
- Misses 10124 10271 +147
|
Signed-off-by: frederik <[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.
There are still some things that aren't quite right.
Signed-off-by: frederik <[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 don't think you understood my point. The plane starts at zero velocity. You should not invalidate the config because of that. I recommend you try actually running the example rather than have me constantly correct your code.
Signed-off-by: frederik <[email protected]>
I added an additional variable |
I'd argue that you could have more than one position where zero speed is acceptable. Say you are testing a delivery scenario. Its possible that you want your plane to take off and land multiple times. I think all you need to do is not apply any force if velocity is zero. This is consistent with real world dynamics as you can't have lift or drag unless relative airspeed is zero. |
Yes that is a valid point, so you would just return without throwing an error. |
Yep that is correct.
…On Wed, Nov 1, 2023 at 4:10 PM Frederik Markus ***@***.***> wrote:
Yes that is a valid point, so you would just return without throwing an
error.
—
Reply to this email directly, view it on GitHub
<#2185 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEEMQGIYNCAG7YQ3H3KAETYCH7WLAVCNFSM6AAAAAA5PE5KYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBYGU3DSMJVGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Signed-off-by: frederik <[email protected]>
removed the position variable and let the update function return without throwing an error. |
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 just tried it. It looks great. I just have one small suggestion to improve the documentation in the example. Once you incorporate it, this looks good to me! Thanks for iterating on this PR.
Co-authored-by: Arjo Chakravarty <[email protected]> Signed-off-by: Frederik Markus <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Points have been addressed. Review is stale.
🎉 New Feature
Summary
This is a plugin that ports the behaviour of the advanced lift drag plugin that was present in Gazebo Classic to Gazebo. The physics implementation have not changed, but the plugin has been adapted to work with the entity component system. Primary modeling differences in the advanced_lift_drag plugin from the original liftdrag_plugin include:
The objective is to provide a more accurate model of a wing than what is provided in the basic lift drag plugin.
Test it
Another PR is currently being pursued to also port the advanced plane to PX4. This should provide the ability to test the plugin on the already existing vehicles. Alternatively, one can also write their own model and use AVL to figure out the necessary parameters.
This plugin originates from a custom plugin from PX4 that was written for gazebo classic. It should be included in Gazebo in order to provide compatability with the advanced plane model in PX4. The original source code comes from https://github.com/PX4/PX4-SITL_gazebo-classic/blob/20ded0757b4f2cb362833538716caf1e938b162a/src/liftdrag_plugin/advanced_liftdrag_plugin.cpp and was written by @karthik-s-feather.
Port < Gazebo Classic advanced_lift_drag> to < Gazebo advanced_lift_drag>
Branch comparison: https://github.com/frede791/gz-sim/blob/gz-sim7/src/systems/advanced_lift_drag/AdvancedLiftDrag.cc ... https://github.com/PX4/PX4-SITL_gazebo-classic/blob/20ded0757b4f2cb362833538716caf1e938b162a/src/liftdrag_plugin/advanced_liftdrag_plugin.cpp