Skip to content
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

Added intersectSurface to NaifDskShape so the intercept point would b… #4997

Merged
merged 5 commits into from
Jul 26, 2022

Conversation

scsides
Copy link
Contributor

@scsides scsides commented Jul 15, 2022

Override NaifDskShape::intersectSurface so the intercept is calculated.

Description

footprintinit segfaulted when setGround was called on the subSpacecraftPoint because the intercept destructor had been called after exiting a scope

Related Issue

#4943

Motivation and Context

Stop the segfault

How Has This Been Tested?

footprintinit no longer segfaults and a test was added to make sure the intercept was being calculated

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation change (update to the documentation; no code change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read and agree to abide by the Code of Conduct
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have added myself to the .zenodo.json document.
  • I have added any user impacting changes to the CHANGELOG.md document.

Licensing

This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words:

This work is free and unencumbered software released into the public domain. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain.

  • I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

@scsides scsides requested review from jessemapel and KrisBecker July 15, 2022 16:02
acpaquette
acpaquette previously approved these changes Jul 18, 2022
Copy link
Collaborator

@acpaquette acpaquette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good to me but having @KrisBecker and @jessemapel review would be ideal

Copy link
Contributor

@jessemapel jessemapel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worked with Stuart on the change, so I don't have any input on the functional change. Just the test change.

isis/src/base/objs/NaifDskShape/unitTest.cpp Outdated Show resolved Hide resolved
KrisBecker
KrisBecker previously approved these changes Jul 19, 2022
Copy link
Contributor

@KrisBecker KrisBecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is difficult to follow, top to bottom.

This looks like a good addition. Note that it costs two ray traces in this mod. One to determine the local radius at the lat/lon location and then a ray trace from observer to the surface point. That looks like a total of three ray traces/point so expect it to be a bit slow.

An alternative would be to call ShapeModel::intersectSurface(lat,lon,obs,backcheck). This costs one ray trace but may result in a different intercept. Not sure it would be a different intercept in this context, but you would not need this update for this approach. Though, it would require a modification to Camera::SetGround().

Also note that the back projection check is ignored in this implementation. It may not be returning the same/valid intercept point as the surface point because of occlusion.

@scsides scsides dismissed stale reviews from KrisBecker and acpaquette via 185e711 July 25, 2022 21:54
jessemapel
jessemapel previously approved these changes Jul 26, 2022
@jessemapel jessemapel merged commit acf88f5 into DOI-USGS:dev Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants