-
Notifications
You must be signed in to change notification settings - Fork 37
Enable and fix the TGO CaSSIS driver #720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 10 commits
f1d497a
53e9c47
553b334
2840aaa
e332e3f
95310b8
bd5e6f3
38099fd
6fe3c82
bf72317
015acd0
f206665
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,8 @@ namespace ale { | |
| CAHVOR, | ||
| LUNARORBITER, | ||
| RADTAN, | ||
| KPLOSHADOWCAM | ||
| KPLOSHADOWCAM, | ||
| CASSIS | ||
| }; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -366,6 +366,8 @@ DistortionType getDistortionModel(json isd) { | |
| return DistortionType::RADTAN; | ||
| } else if (distortion.compare("kplo_shadowcam") == 0) { | ||
| return DistortionType::KPLOSHADOWCAM; | ||
| } else if (distortion.compare("cassis") == 0) { | ||
| return DistortionType::CASSIS; | ||
| } | ||
| } catch (...) { | ||
| throw std::runtime_error("Could not parse the distortion model."); | ||
|
|
@@ -559,6 +561,19 @@ std::vector<double> getDistortionCoeffs(json isd) { | |
| coefficients = std::vector<double>(1, 0.0); | ||
| } | ||
| } break; | ||
| case DistortionType::CASSIS: { | ||
| try { | ||
| coefficients = isd.at("optical_distortion") | ||
| .at("cassis") | ||
| .at("coefficients") | ||
| .get<std::vector<double>>(); | ||
| return coefficients; | ||
| } catch (...) { | ||
| throw std::runtime_error( | ||
| "Could not parse the cassis distortion model coefficients."); | ||
| coefficients = std::vector<double>(36, 0.0); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does this do? It's right after the throw.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. That line is unreachable dead code: the throw above it unwinds out of the catch, so the zero-fill never runs, and even if it did the local coefficients vector is destroyed during stack unwinding and never returned to any caller, so it would have no effect. The vector is also already default-constructed to a valid empty state at its declaration, so there is no uninitialized-value concern either. I removed it. The same dead line exists in the older LUNARORBITER, RADTAN, and KPLOSHADOWCAM cases (this case was copied from them). I did not touch those to keep this PR focused, but I am happy to clean them up here or in a separate PR if you prefer. Done with Claude/AI assistance. |
||
| } | ||
| } break; | ||
| } | ||
| throw std::runtime_error( | ||
| "Could not parse the distortion model coefficients."); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.4.1 fixed the bugs, you can unpin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unpinned. Tests pass.
Done with Claude/AI assistance.