Commit 8b5e22c
Mark Stalzer
poser_mpfit: skip non-finite optical angles instead of passing to solver
Corrupt optical angles (bad FPGA timestamps during USB disturbances) can
reach construct_input_from_scene() as NaN or Inf. Passing a non-finite
value into the MPFIT solver causes it to produce a garbage pose which then
assert-crashes downstream (observed as assert(!isnan(lhs[lh].Rot[0]))).
Add an isfinite() check before emplacing each measurement. Non-finite
angles are skipped with a one-time stderr warning. One dropped measurement
has negligible effect on the pose solve; crashing does not.1 parent eb409fc commit 8b5e22c
1 file changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
190 | 205 | | |
191 | 206 | | |
192 | 207 | | |
| |||
0 commit comments