New version of quadcopter software written to OO principles
Dependencies: mbed MODSERIAL filter mbed-rtos ConfigFile PID PPM FreeIMU_external_magnetometer TinyGPS
Diff: Sensors/Imu/Imu.cpp
- Revision:
- 4:9ffbf9101992
- Parent:
- 3:4823d6750629
--- a/Sensors/Imu/Imu.cpp Fri Apr 24 16:50:20 2015 +0000
+++ b/Sensors/Imu/Imu.cpp Fri May 08 09:07:38 2015 +0000
@@ -93,6 +93,20 @@
return (normalAltitude * 100);
}
+Imu::Acceleration Imu::getAcceleration()
+{
+ //Get raw accel data
+ float values[9];
+ _freeImu.getValues(values);
+
+ Acceleration acceleration;
+ acceleration.x = values[0];
+ acceleration.y = values[1];
+ acceleration.z = values[2];
+
+ return acceleration;
+}
+
Imu::Velocity Imu::getVelocity(float time)
{
//Get quaternion
Joseph Roberts