From badb9f7407f551113a93c2cd9a9e43c03812364c Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Fri, 31 Mar 2017 19:22:26 -0700 Subject: [PATCH] Linux build fixes from madratman. --- .../controllers/rosflight/AirSimRosFlightBoard.hpp | 8 ++++---- .../controllers/rosflight/RosFlightDroneController.hpp | 4 ++-- AirLib/include/controllers/rosflight/firmware/mixer.hpp | 2 +- AirLib/include/controllers/rosflight/firmware/sensors.hpp | 2 +- AirLib/include/sensors/gps/GpsSimpleParams.hpp | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/AirLib/include/controllers/rosflight/AirSimRosFlightBoard.hpp b/AirLib/include/controllers/rosflight/AirSimRosFlightBoard.hpp index c1161f3c64..390499036e 100644 --- a/AirLib/include/controllers/rosflight/AirSimRosFlightBoard.hpp +++ b/AirLib/include/controllers/rosflight/AirSimRosFlightBoard.hpp @@ -102,7 +102,7 @@ class AirSimRosFlightBoard : public rosflight::Board { if (index < OutputMotorCount) motors_pwm_[index] = value; else - throw std::exception("cannot write motor output for index > motor count"); + throw std::runtime_error("cannot write motor output for index > motor count"); } virtual void set_led(uint8_t index, bool is_on) override @@ -172,12 +172,12 @@ class AirSimRosFlightBoard : public rosflight::Board { virtual void read_diff_pressure(float& differential_pressure, float& temp, float& velocity) override { - throw std::exception("Diff pressure sensor is not available"); + throw std::runtime_error("Diff pressure sensor is not available"); } virtual float read_sonar() override { - throw std::exception("Sonar sensor is not available"); + throw std::runtime_error("Sonar sensor is not available"); } virtual void read_mag(int16_t mag_adc[3]) override @@ -256,7 +256,7 @@ class AirSimRosFlightBoard : public rosflight::Board { const float kAccelScale = 1.0; //as set in PARAM_ACCEL_SCALE in ROSFlight const float kAccelG = 9.80665f; //as set in ROSFlight sensors.c init_sensors() function - // 16.4 dps/lsb scalefactor for all Invensense devices + // 16.4 dps/lsb scalefactor for all Invensense devices const float kGyroScale = (1.0f / 16.4f) * (M_PIf / 180.0f); static constexpr uint OutputMotorCount = 16; diff --git a/AirLib/include/controllers/rosflight/RosFlightDroneController.hpp b/AirLib/include/controllers/rosflight/RosFlightDroneController.hpp index df19a031b3..7743d925fc 100644 --- a/AirLib/include/controllers/rosflight/RosFlightDroneController.hpp +++ b/AirLib/include/controllers/rosflight/RosFlightDroneController.hpp @@ -74,8 +74,8 @@ class RosFlightDroneController : public DroneControllerBase { case 1: index_quadx = 2; break; case 2: index_quadx = 3; break; case 3: index_quadx = 0; break; - default: - throw std::exception("Rotor index beyond 3 is not supported yet in ROSFlight firmware"); + default: + throw std::runtime_error("Rotor index beyond 3 is not supported yet in ROSFlight firmware"); } auto control_signal = board_->getMotorControlSignal(index_quadx); diff --git a/AirLib/include/controllers/rosflight/firmware/mixer.hpp b/AirLib/include/controllers/rosflight/firmware/mixer.hpp index becc2dde1d..b67c69f430 100644 --- a/AirLib/include/controllers/rosflight/firmware/mixer.hpp +++ b/AirLib/include/controllers/rosflight/firmware/mixer.hpp @@ -38,7 +38,7 @@ class Mixer { private: void write_motor(uint8_t index, int32_t value); - void Mixer::write_servo(uint8_t index, int32_t value); + void write_servo(uint8_t index, int32_t value); private: typedef enum diff --git a/AirLib/include/controllers/rosflight/firmware/sensors.hpp b/AirLib/include/controllers/rosflight/firmware/sensors.hpp index c11a3fed72..046d6aaf58 100644 --- a/AirLib/include/controllers/rosflight/firmware/sensors.hpp +++ b/AirLib/include/controllers/rosflight/firmware/sensors.hpp @@ -78,7 +78,7 @@ class Sensors { vector_t calib_gyro_sum = { 0.0f, 0.0f, 0.0f }; uint16_t calib_accel_count = 0; vector_t calib_accel_sum = { 0.0f, 0.0f, 0.0f }; - static constexpr vector_t gravity = { 0.0f, 0.0f, 9.80665f }; + vector_t gravity = { 0.0f, 0.0f, 9.80665f }; float acc_temp_sum = 0.0f; }; diff --git a/AirLib/include/sensors/gps/GpsSimpleParams.hpp b/AirLib/include/sensors/gps/GpsSimpleParams.hpp index 59dd42d8ec..2a67476512 100644 --- a/AirLib/include/sensors/gps/GpsSimpleParams.hpp +++ b/AirLib/include/sensors/gps/GpsSimpleParams.hpp @@ -15,7 +15,7 @@ struct GpsSimpleParams { real_T eph_final = 0.3f, epv_final = 0.4f; real_T eph_min_3d = 3.0f, eph_min_2d = 4.0f; - real_T update_latency = 0.2f; //sec + real_T update_latency = 0.1f; //sec real_T update_frequency = 50; //Hz real_T startup_delay = 1; //sec };