uuv_simulator
uuv_simulator copied to clipboard
Incorrect Coefficient of Drag Calculation in LiftDragModel.cc
The compute function in LiftDragTwoLines::compute produces a negative drag when the angle of attack is negative. In other words, it produces thrust when the angle of attack is negative.
This occurs because of how coefficient of drag is calculated. Unlike coefficient of lift, which should change signs based on the sign of the angle of attack (alpha), coefficient of drag should always stay positive.
It would be best to change: Line 256: cd = this->cda * alpha; -> cd = this->cda * fabs(alpha); and Line 241: cd = -this->cda * this->alphaStall +this->cdaStall * sumAlpha; -> cd = this->cda * this->alphaStall +this->cdaStall * -sumAlpha;
Hi @jzhu1234, did you manage to test this? I can try it out too, but it would be good to compare with your results.
I tested it by temporarily removing lift force so I could see the direction of the drag forces in RViz. I used a similar model to the ECA A9, except the fins are in a plus configuration.
With the current branch, in RViz I could see the drag forces go in opposite directions when I told the vehicle to dive, rise, or turn.
On Fri, Mar 15, 2019 at 3:55 PM Musa Morena Marcusso Manhães < [email protected]> wrote:
Hi @jzhu1234 https://github.com/jzhu1234, did you manage to test this? I can try it out too, but it would be good to compare with your results.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/uuvsimulator/uuv_simulator/issues/351#issuecomment-473421137, or mute the thread https://github.com/notifications/unsubscribe-auth/ASdL0zru4YgkW1lSXFww-IzyAd_mMmiwks5vW_qmgaJpZM4b3Le4 .
is it possible to provide your configuration for a test scenario so I can reproduce it here?
iver_base.xacro - The vehicle we model is smaller than the eca-a9, so the x and y values would have to be adjusted.
x = length from origin y = radius
<xacro:fin_macro namespace="${namespace}" fin_id="0">
<origin xyz="-x -r 0" rpy="${90*d2r} 0 0" />
</xacro:fin_macro>
<xacro:fin_macro namespace="${namespace}" fin_id="1">
<origin xyz="-x 0 -r" rpy="${180*d2r} 0 0" />
</xacro:fin_macro>
<xacro:fin_macro namespace="${namespace}" fin_id="2">
<origin xyz="-x r 0" rpy="${-90*d2r} 0 0" />
</xacro:fin_macro>
<xacro:fin_macro namespace="${namespace}" fin_id="3">
<origin xyz="-x 0 r" rpy="0 0 0" />
</xacro:fin_macro>
iver_snippets.xacro a0 = 0 astall = 0.174533 cla = 10.0 clastall = -1.0 cda = 1.55 cdastall = 1.55