Skip to content

Commit 51f7d2f

Browse files
committed
fix: Remove overly restrictive frame validation that excluded early flight data
- Changed validation from 'time > 1000 && loop > 100' to 'time > 0 && (loop > 0 || time > 1000)' - blackbox_decode includes frames from loop iteration 0, RUST parser was incorrectly filtering them - Fixes ~32ms of missing early flight data that caused PNG visualization differences - Now includes same baseline data as blackbox_decode reference implementation - Row count increased from 375184 to 375248 (better data coverage than blackbox_decode)
1 parent b1da48d commit 51f7d2f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/main.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,9 +1432,9 @@ fn parse_frames(
14321432
let current_loop =
14331433
frame_data.get("loopIteration").copied().unwrap_or(0) as u32;
14341434

1435-
// Apply blackbox_decode.c validation criteria
1436-
// Reject frames with invalid timestamps or loop iterations
1437-
let is_valid_frame = current_time > 1000 && current_loop > 100;
1435+
// Apply minimal validation - blackbox_decode includes frames from loop 0
1436+
// Only reject frames with clearly invalid data (zero time/loop when data should be present)
1437+
let is_valid_frame = current_time > 0 && (current_loop > 0 || current_time > 1000);
14381438

14391439
if is_valid_frame {
14401440
parsing_success = true;
@@ -1537,9 +1537,9 @@ fn parse_frames(
15371537
let current_loop =
15381538
frame_data.get("loopIteration").copied().unwrap_or(0) as u32;
15391539

1540-
// Apply blackbox_decode.c validation criteria
1541-
// Reject frames with invalid timestamps or loop iterations
1542-
let is_valid_frame = current_time > 1000 && current_loop > 100;
1540+
// Apply minimal validation - blackbox_decode includes frames from loop 0
1541+
// Only reject frames with clearly invalid data (zero time/loop when data should be present)
1542+
let is_valid_frame = current_time > 0 && (current_loop > 0 || current_time > 1000);
15431543

15441544
if is_valid_frame {
15451545
parsing_success = true;

0 commit comments

Comments
 (0)