Browse Source

Plane: allow for settable main loop rate

master
Andrew Tridgell 9 years ago committed by Randy Mackay
parent
commit
513d5c17b9
  1. 3
      ArduPlane/Plane.h
  2. 2
      ArduPlane/system.cpp
  3. 4
      ArduPlane/test.cpp

3
ArduPlane/Plane.h

@ -146,9 +146,6 @@ private: @@ -146,9 +146,6 @@ private:
AP_Vehicle::FixedWing aparm;
AP_HAL::BetterStream* cliSerial;
// the rate we run the main loop
const AP_InertialSensor::Sample_rate ins_sample_rate = AP_InertialSensor::RATE_50HZ;
// Global parameters are all contained within the 'g' class.
Parameters g;

2
ArduPlane/system.cpp

@ -569,7 +569,7 @@ void Plane::startup_INS_ground(void) @@ -569,7 +569,7 @@ void Plane::startup_INS_ground(void)
ahrs.set_vehicle_class(AHRS_VEHICLE_FIXED_WING);
ahrs.set_wind_estimation(true);
ins.init(ins_sample_rate);
ins.init(scheduler.get_loop_rate_hz());
ahrs.reset();
// read Baro pressure at ground

4
ArduPlane/test.cpp

@ -350,7 +350,7 @@ int8_t Plane::test_ins(uint8_t argc, const Menu::arg *argv) @@ -350,7 +350,7 @@ int8_t Plane::test_ins(uint8_t argc, const Menu::arg *argv)
ahrs.set_fly_forward(true);
ahrs.set_wind_estimation(true);
ins.init(ins_sample_rate);
ins.init(scheduler.get_loop_rate_hz());
ahrs.reset();
print_hit_enter();
@ -411,7 +411,7 @@ int8_t Plane::test_mag(uint8_t argc, const Menu::arg *argv) @@ -411,7 +411,7 @@ int8_t Plane::test_mag(uint8_t argc, const Menu::arg *argv)
ahrs.set_compass(&compass);
// we need the AHRS initialised for this test
ins.init(ins_sample_rate);
ins.init(scheduler.get_loop_rate_hz());
ahrs.reset();
uint16_t counter = 0;

Loading…
Cancel
Save