Skip to content

Commit

Permalink
magfit: check for bad ATT data and ignore it
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed Jun 27, 2023
1 parent b360511 commit d8cb291
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/widgets/MagFitTool.vue
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ export default {
yaw: data.yaw[i]
}
const BAT = null
if (ATT.roll === undefined) {
console.log('skipping bad data', ATT)
continue
}
const yaw = this.getYaw(ATT, MAG, corrections) // matches
// console.log('yaw: ', yaw)
const expected = this.expectedField(ATT, yaw) // matches
Expand Down Expand Up @@ -485,6 +489,10 @@ export default {
pitch: data.pitch[i],
yaw: data.yaw[i]
}
if (ATT.roll === undefined) {
console.log('skipping bad data', ATT)
continue
}
const BAT = null
const yaw = this.getYaw(ATT, MAG, corr) // matches
// console.log('yaw: ', yaw)
Expand Down
4 changes: 4 additions & 0 deletions src/mavextra/vector3.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class Vector3 {
equals (v) {
return this.x === v.x && this.y === v.y && this.z === v.z
}

isNaN () {
return isNaN(this.x) || isNaN(this.y) || isNaN(this.z)
}
}

export { Vector3 }

0 comments on commit d8cb291

Please sign in to comment.