{
initialize_sensor_data(accel, gyro, magnetic);
- if (magnetic != NULL)
+ if (gyro != NULL && magnetic != NULL) {
+
orientation_triad_algorithm();
- else if (gyro != NULL)
- compute_accel_orientation();
- if (gyro != NULL) {
compute_covariance();
- if (magnetic != NULL)
- time_update();
- else
- time_update_gaming_rv();
+ time_update();
measurement_update();
- if (magnetic == NULL) {
- m_quaternion = m_quat_gaming_rv;
- } else {
- m_quaternion = m_quat_9axis;
- }
+ m_quaternion = m_quat_9axis;
+
+ } else if (!gyro) {
+
+ orientation_triad_algorithm();
- } else {
m_quaternion = m_quat_aid;
+
+ } else if (!magnetic) {
+
+ compute_accel_orientation();
+
+ compute_covariance();
+
+ time_update_gaming_rv();
+
+ measurement_update();
+
+ m_quaternion = m_quat_gaming_rv;
}
}
orientation.m_ang.m_vec[0] *= pitch_phase_compensation;
orientation.m_ang.m_vec[1] *= roll_phase_compensation;
- orientation.m_ang.m_vec[2] *= azimuth_phase_compensation;
+ orientation.m_ang.m_vec[2] *= azimuth_phase_compensation;
if (orientation.m_ang.m_vec[2] < 0)
orientation.m_ang.m_vec[2] += 360;
<DEFAULT_SAMPLING_TIME value="100" />
</GAMING_ROTATION_VECTOR>
</DEVICE>
-
+
<DEVICE type="Mobile-RD-PQ_V2">
<FUSION>
<NAME value="FUSION_SENSOR" />