c++11 initialization cleanup (#237)

This commit is contained in:
Daniel Agar
2017-02-05 13:05:10 -05:00
committed by GitHub
parent 7883085e4a
commit 2750961be6
18 changed files with 102 additions and 139 deletions
+4 -6
View File
@@ -54,10 +54,6 @@ ECL_PitchController::ECL_PitchController() :
{
}
ECL_PitchController::~ECL_PitchController()
{
}
float ECL_PitchController::control_attitude(const struct ECL_ControlData &ctl_data)
{
@@ -124,6 +120,7 @@ float ECL_PitchController::control_bodyrate(const struct ECL_ControlData &ctl_da
/* flying inverted (wings upside down)*/
bool inverted = false;
float constrained_roll;
/* roll is used as feedforward term and inverted flight needs to be considered */
if (fabsf(ctl_data.roll) < math::radians(90.0f)) {
/* not inverted, but numerically still potentially close to infinity */
@@ -132,6 +129,7 @@ float ECL_PitchController::control_bodyrate(const struct ECL_ControlData &ctl_da
} else {
/* inverted flight, constrain on the two extremes of -pi..+pi to avoid infinity */
inverted = true;
/* note: the ranges are extended by 10 deg here to avoid numeric resolution effects */
if (ctl_data.roll > 0.0f) {
/* right hemisphere */
@@ -148,10 +146,10 @@ float ECL_PitchController::control_bodyrate(const struct ECL_ControlData &ctl_da
/* Calculate desired body fixed y-axis angular rate needed to compensate for roll angle.
For reference see Automatic Control of Aircraft and Missiles by John H. Blakelock, pg. 175
Availible on google books 8/11/2015:
Availible on google books 8/11/2015:
https://books.google.com/books?id=ubcczZUDCsMC&pg=PA175#v=onepage&q&f=false*/
float body_fixed_turn_offset = (fabsf((CONSTANTS_ONE_G / airspeed) *
tanf(constrained_roll) * sinf(constrained_roll)));
tanf(constrained_roll) * sinf(constrained_roll)));
if (inverted) {
body_fixed_turn_offset = -body_fixed_turn_offset;