File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 3737#define DETECTION_THRESHOLD 25
3838// How many abnormal rotations to receive before we consider it valid
3939#define RESET_THRESHOLD 75
40+ // Invalid rotation threshold in radians
41+ #define ROTATION_THRESHOLD 0.52f
4042
4143// TODO: move to esb
4244extern uint8_t stored_trackers ;
Original file line number Diff line number Diff line change @@ -294,8 +294,8 @@ void hid_write_packet_n(uint8_t *data, uint8_t rssi)
294294 uint8_t * cur_p = & cur_p_trackers [data [1 ]];
295295 float mag = q_diff_mag (q , last_q ); // difference between last valid
296296 float mag_cur = q_diff_mag (q , cur_q ); // difference between last received
297- bool mag_invalid = mag > 0.26f && mag < 6.28f - 0.26f ; // possibly invalid rotation
298- bool mag_cur_invalid = mag_cur > 0.26f && mag_cur < 6.28f - 0.26f ; // possibly inconsistent rotation
297+ bool mag_invalid = mag > ROTATION_THRESHOLD && mag < 6.28f - ROTATION_THRESHOLD ; // possibly invalid rotation
298+ bool mag_cur_invalid = mag_cur > ROTATION_THRESHOLD && mag_cur < 6.28f - ROTATION_THRESHOLD ; // possibly inconsistent rotation
299299 if (mag_invalid && !last_invalid )
300300 {
301301 if (!mag_cur_invalid && last_valid_trackers [data [1 ]] >= RESET_THRESHOLD - 1 )
You can’t perform that action at this time.
0 commit comments