collab/igvc2018
git clone https://git.julia.blue/collab/igvc2018
469e5be
imu
1#### 2# Copying these here for testing purposes later . . . 3#### 4 5# # # # # # # # # 6 7#roll = math.atan2(acc_y, math.sqrt(acc_x**2 + acc_z**2)) 8#pitch = math.atan2(acc_x, math.sqrt(acc_y**2 + acc_z**2)) 9 10# # # # # # # # # 11 12#mag_norm = math.sqrt((mag_x * mag_x) + (mag_y * mag_y) + (mag_z * mag_z)) 13#mag_x /= mag_norm 14#mag_y /= mag_norm 15#mag_z /= mag_norm 16 17# # # # # # # # # 18 19#yaw = (math.atan2((-mag_y * math.cos(comp_roll)) + (mag_z * math.sin(comp_roll)), 20# (mag_x * math.cos(comp_pitch)) + (mag_y * math.sin(comp_pitch)) * math.sin(comp_roll) + 21# (mag_z * math.sin(comp_pitch) * math.cos(comp_roll)))) * RAD_TO_DEGREES 22 23# # # # # # # # # 24 25#yaw = math.atan2(mag_y, mag_x) 26 27#yaw = math.atan2(-mag_y * math.cos(roll) + mag_z * math.sin(roll), 28# mag_x * math.cos(pitch) + mag_z * math.sin(pitch) * math.sin(roll) 29# + mag_z * math.sin(pitch) * math.cos(roll)) 30 31#magnetic_x = (mag_x * math.cos(comp_pitch)) + (mag_y * math.sin(comp_roll) * math.sin(comp_pitch)) 32#+ (mag_z * math.cos(comp_roll) * math.sin(comp_pitch)) 33#magnetic_y = (mag_y * math.cos(comp_roll)) - (mag_z * math.sin(comp_roll)) 34 35#yaw = (math.atan2(mag_x, mag_y) * RAD_TO_DEGREES)