Skip to content

Commit

Permalink
Linux build fixes from madratman.
Browse files Browse the repository at this point in the history
  • Loading branch information
lovettchris committed Apr 1, 2017
1 parent 644951b commit badb9f7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions AirLib/include/controllers/rosflight/AirSimRosFlightBoard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion AirLib/include/controllers/rosflight/firmware/mixer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion AirLib/include/controllers/rosflight/firmware/sensors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
2 changes: 1 addition & 1 deletion AirLib/include/sensors/gps/GpsSimpleParams.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down

0 comments on commit badb9f7

Please sign in to comment.