![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ESE350 project, Spring 2016, University of Pennsylvania
Dependencies: Adafruit9-DOf Receiver mbed-rtos mbed
Diff: sensor.cpp
- Revision:
- 35:35997980a8ba
- Parent:
- 29:ae765492fa8b
- Child:
- 37:a983eb9fd9c5
--- a/sensor.cpp Sun Apr 24 17:15:20 2016 +0000 +++ b/sensor.cpp Tue Apr 26 18:50:55 2016 +0000 @@ -43,9 +43,8 @@ for (int n = 0; n < NUM_SAMPLES; n++) { gyro.getEvent(&gyro_event); accel.getEvent(&accel_event); - dof.accelGetOrientation(&accel_event, &orientation); mag.getEvent(&mag_event); - dof.magGetOrientation(SENSOR_AXIS_Z, &mag_event, &orientation); + dof.fusionGetOrientation(&accel_event, &mag_event, &orientation); initial_offsets->gyro_x += gyro_event.gyro.x; initial_offsets->gyro_y += gyro_event.gyro.y; initial_offsets->gyro_z += gyro_event.gyro.z;