gazebosim / gz-sim

Open source robotics simulator. The latest version of Gazebo.
https://gazebosim.org
Apache License 2.0
672 stars 262 forks source link

Lift Drag Plugin: #2189 breaks reverse thrust when used to model propellers #2476

Open srmainwaring opened 2 months ago

srmainwaring commented 2 months ago

Environment

Not environment specific.

Description

Previous behaviour

Changed behaviour

Steps to reproduce

  1. The iris quadcopter example in ardupilot_gazebo models propeller thrust by applying the lift drag plugin to each propeller blade. The upwards direction is along the axis of rotation and the forward direction is along the +/- y-direction depending upon whether the rotation is cw or ccw and which blade is being modelled (for a two blade prop).
  2. When spinning in the intended direction the prop provides the expected thrust. When reversed the prop now provides no thrust, previously the thrust would be reversed provided suitable lift drag parameters were selected.

This is the change from #2189 that altered the behaviour.

https://github.com/gazebosim/gz-sim/blob/90a7ba7e79e76d50b2cb97e4a20aad5ebba9b023/src/systems/lift_drag/LiftDrag.cc#L306-L310

arjo129 commented 2 months ago

Slightly related is this conversation: https://github.com/gazebosim/gz-sim/pull/2189/files#r1348128692

I'm open to removing this line, but it seems that there are two different use cases: (1) for reversible thrust in the case of propellers and (2) for no reversible thrust (I dont think a reversed airfoil would have the same lift-drag coefficients). We probably should have a simple reversible tag that defaults to true. I should have thought of this when reviewing said PR :facepalm: .

srmainwaring commented 2 months ago

We probably should have a simple reversible tag that defaults to true.

That would be a good solution that preserves previous behaviour. I'll raise a PR with the change.

Most airfoils are not symmetric when reversed, but there are exceptions: https://en.wikipedia.org/wiki/Sikorsky_S-72