ESE350 project, Spring 2016, University of Pennsylvania
Dependencies: Adafruit9-DOf Receiver mbed-rtos mbed
Diff: quadcopter.cpp
- Revision:
- 13:291ba30c7806
- Parent:
- 12:422963993df5
- Child:
- 14:64b06476d943
diff -r 422963993df5 -r 291ba30c7806 quadcopter.cpp --- a/quadcopter.cpp Sat Apr 02 21:40:37 2016 +0000 +++ b/quadcopter.cpp Sat Apr 02 22:06:46 2016 +0000 @@ -26,9 +26,6 @@ accel_ = Adafruit_LSM303_Accel_Unified(30301); mag_ = Adafruit_LSM303_Mag_Unified(30302); gyro_ = Adafruit_L3GD20_Unified(20); - - - } void Quadcopter::initAllSensors() @@ -46,13 +43,13 @@ if (dof_.magGetOrientation(SENSOR_AXIS_Z, &mag_event_, &orientation_)) { } - gyro_.getEvent(&gyro_event_); + gyro_.getEvent(&gyro_event_); - gyro_event_.gyro.x -= offsetAngRate_.x; - gyro_event_.gyro.y -= offsetAngRate_.y; - gyro_event_.gyro.z -= offsetAngRate_.z; - - + gyro_event_.gyro.x -= offsetAngRate_.x; + gyro_event_.gyro.y -= offsetAngRate_.y; + gyro_event_.gyro.z -= offsetAngRate_.z; + + // measured values (will come from IMU/parameter class/Input to function later) // angles state_.phi = orientation_.roll; @@ -97,10 +94,8 @@ //print("F: %f M_x: %f M_y: %f M_z: %f\n\r", controlInput_.f, controlInput_.mz, controlInput_.my, controlInput_.mz); // pc.printf("F: %f\n\r", F); - +} - -} motors Quadcopter::getPwm() { //motors motorPwm_;// weired errror, should not be necessary