From 56b5747b4e0eee93724a4c2b1f031eeff8062da8 Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Tue, 6 May 2014 18:53:57 +0200 Subject: [PATCH] uncrustify --- flight/modules/Sensors/sensors.c | 20 ++++---- .../calibration/sixpointcalibrationmodel.cpp | 49 +++++++++---------- .../calibration/sixpointcalibrationmodel.h | 10 ++-- 3 files changed, 40 insertions(+), 39 deletions(-) diff --git a/flight/modules/Sensors/sensors.c b/flight/modules/Sensors/sensors.c index b21b67fd4..c1c76ee8f 100644 --- a/flight/modules/Sensors/sensors.c +++ b/flight/modules/Sensors/sensors.c @@ -84,7 +84,9 @@ AccelGyroSettingsData agcal; // These values are initialized by settings but can be updated by the attitude algorithm static float mag_bias[3] = { 0, 0, 0 }; -static float mag_transform[3][3]={{ 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1}}; +static float mag_transform[3][3] = { + { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } +}; // temp coefficient to calculate gyro bias static volatile bool gyro_temp_calibrated = false; static volatile bool accel_temp_calibrated = false; @@ -442,9 +444,9 @@ static void settingsUpdatedCb(__attribute__((unused)) UAVObjEvent *objEv) { RevoCalibrationGet(&cal); AccelGyroSettingsGet(&agcal); - mag_bias[0] = cal.mag_bias.X; - mag_bias[1] = cal.mag_bias.Y; - mag_bias[2] = cal.mag_bias.Z; + mag_bias[0] = cal.mag_bias.X; + mag_bias[1] = cal.mag_bias.Y; + mag_bias[2] = cal.mag_bias.Z; accel_temp_calibrated = (agcal.temp_calibrated_extent.max - agcal.temp_calibrated_extent.min > .1f) && (fabsf(agcal.accel_temp_coeff.X) > 1e-9f || fabsf(agcal.accel_temp_coeff.Y) > 1e-9f || fabsf(agcal.accel_temp_coeff.Z) > 1e-9f); @@ -459,16 +461,16 @@ static void settingsUpdatedCb(__attribute__((unused)) UAVObjEvent *objEv) // Indicates not to expend cycles on rotation if (fabsf(attitudeSettings.BoardRotation.Roll) < 0.00001f - && fabsf(attitudeSettings.BoardRotation.Pitch) < 0.00001f && - fabsf(attitudeSettings.BoardRotation.Yaw) <0.00001f ) { + && fabsf(attitudeSettings.BoardRotation.Pitch) < 0.00001f && + fabsf(attitudeSettings.BoardRotation.Yaw) < 0.00001f) { rotate = 0; } else { rotate = 1; } float rotationQuat[4]; - const float rpy[3] = { attitudeSettings.BoardRotation.Roll, - attitudeSettings.BoardRotation.Pitch, - attitudeSettings.BoardRotation.Yaw }; + const float rpy[3] = { attitudeSettings.BoardRotation.Roll, + attitudeSettings.BoardRotation.Pitch, + attitudeSettings.BoardRotation.Yaw }; RPY2Quaternion(rpy, rotationQuat); Quaternion2R(rotationQuat, R); diff --git a/ground/openpilotgcs/src/plugins/config/calibration/sixpointcalibrationmodel.cpp b/ground/openpilotgcs/src/plugins/config/calibration/sixpointcalibrationmodel.cpp index 5f9961e43..becec9b3e 100644 --- a/ground/openpilotgcs/src/plugins/config/calibration/sixpointcalibrationmodel.cpp +++ b/ground/openpilotgcs/src/plugins/config/calibration/sixpointcalibrationmodel.cpp @@ -47,36 +47,35 @@ SixPointCalibrationModel::SixPointCalibrationModel(QObject *parent) : calibratingMag(false), calibratingAccel(false), collectingData(false) - { calibrationStepsMag.clear(); calibrationStepsMag - << CalibrationStep(CALIBRATION_HELPER_IMAGE_NED, - tr("Place horizontally, nose pointing north and click save position...")) - << CalibrationStep(CALIBRATION_HELPER_IMAGE_DWN, - tr("Place with nose down, right side west and click save position...")) - << CalibrationStep(CALIBRATION_HELPER_IMAGE_WDS, - tr("Place right side down, nose west and click save position...")) - << CalibrationStep(CALIBRATION_HELPER_IMAGE_ENU, - tr("Place upside down, nose east and click save position...")) - << CalibrationStep(CALIBRATION_HELPER_IMAGE_USE, - tr("Place with nose up, left side north and click save position...")) - << CalibrationStep(CALIBRATION_HELPER_IMAGE_SUW, - tr("Place with left side down, nose south and click save position...")); + << CalibrationStep(CALIBRATION_HELPER_IMAGE_NED, + tr("Place horizontally, nose pointing north and click save position...")) + << CalibrationStep(CALIBRATION_HELPER_IMAGE_DWN, + tr("Place with nose down, right side west and click save position...")) + << CalibrationStep(CALIBRATION_HELPER_IMAGE_WDS, + tr("Place right side down, nose west and click save position...")) + << CalibrationStep(CALIBRATION_HELPER_IMAGE_ENU, + tr("Place upside down, nose east and click save position...")) + << CalibrationStep(CALIBRATION_HELPER_IMAGE_USE, + tr("Place with nose up, left side north and click save position...")) + << CalibrationStep(CALIBRATION_HELPER_IMAGE_SUW, + tr("Place with left side down, nose south and click save position...")); calibrationStepsAccelOnly.clear(); calibrationStepsAccelOnly << CalibrationStep(CALIBRATION_HELPER_IMAGE_NED, - tr("Place horizontally and click save position...")) - << CalibrationStep(CALIBRATION_HELPER_IMAGE_DWN, - tr("Place with nose down and click save position...")) - << CalibrationStep(CALIBRATION_HELPER_IMAGE_WDS, - tr("Place right side down and click save position...")) - << CalibrationStep(CALIBRATION_HELPER_IMAGE_ENU, - tr("Place upside down and click save position...")) - << CalibrationStep(CALIBRATION_HELPER_IMAGE_USE, - tr("Place with nose up and click save position...")) - << CalibrationStep(CALIBRATION_HELPER_IMAGE_SUW, - tr("Place with left side down and click save position...")); + tr("Place horizontally and click save position...")) + << CalibrationStep(CALIBRATION_HELPER_IMAGE_DWN, + tr("Place with nose down and click save position...")) + << CalibrationStep(CALIBRATION_HELPER_IMAGE_WDS, + tr("Place right side down and click save position...")) + << CalibrationStep(CALIBRATION_HELPER_IMAGE_ENU, + tr("Place upside down and click save position...")) + << CalibrationStep(CALIBRATION_HELPER_IMAGE_USE, + tr("Place with nose up and click save position...")) + << CalibrationStep(CALIBRATION_HELPER_IMAGE_SUW, + tr("Place with left side down and click save position...")); } /********** Six point calibration **************/ @@ -103,7 +102,7 @@ void SixPointCalibrationModel::start(bool calibrateAccel, bool calibrateMag) // Store and reset board rotation before calibration starts storeAndClearBoardRotation(); - if(calibrateMag){ + if (calibrateMag) { currentSteps = &calibrationStepsMag; } else { currentSteps = &calibrationStepsAccelOnly; diff --git a/ground/openpilotgcs/src/plugins/config/calibration/sixpointcalibrationmodel.h b/ground/openpilotgcs/src/plugins/config/calibration/sixpointcalibrationmodel.h index cf453af33..128ff884a 100644 --- a/ground/openpilotgcs/src/plugins/config/calibration/sixpointcalibrationmodel.h +++ b/ground/openpilotgcs/src/plugins/config/calibration/sixpointcalibrationmodel.h @@ -41,15 +41,15 @@ namespace OpenPilot { class SixPointCalibrationModel : public QObject { Q_OBJECT - class CalibrationStep{ - public: - CalibrationStep(QString newVisualHelp, QString newInstructions){ - visualHelp = newVisualHelp; + class CalibrationStep { +public: + CalibrationStep(QString newVisualHelp, QString newInstructions) + { + visualHelp = newVisualHelp; instructions = newInstructions; } QString visualHelp; QString instructions; - }; typedef struct {