Browse Source

We should call imu.update() before asking for accel/gyro values so that we get timely, fresh numbers.

Most other consumers of the accel/gyro values should be asking us for them anyway.  At that point, what they are getting are the values we sampled here.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1376 f9c3cf11-9bcb-44bc-f272-b75c42450872
mission-4.1.18
DrZiplok@gmail.com 14 years ago
parent
commit
cd341cef90
  1. 1
      libraries/AP_DCM/AP_DCM.cpp

1
libraries/AP_DCM/AP_DCM.cpp

@ -41,6 +41,7 @@ AP_DCM::set_compass(Compass *compass)
void void
AP_DCM::update_DCM(float _G_Dt) AP_DCM::update_DCM(float _G_Dt)
{ {
_imu->update();
_gyro_vector = _imu->get_gyro(); // Get current values for IMU sensors _gyro_vector = _imu->get_gyro(); // Get current values for IMU sensors
_accel_vector = _imu->get_accel(); // Get current values for IMU sensors _accel_vector = _imu->get_accel(); // Get current values for IMU sensors

Loading…
Cancel
Save