-
Notifications
You must be signed in to change notification settings - Fork 7
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
Basic Markdown Documentation of Android Casting Structure #174
Open
SlicedBacon
wants to merge
4
commits into
Theta-Limited:master
Choose a base branch
from
SlicedBacon:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# OpenAthena Android Core Functionality | ||
Core Casting Functionality within OA Android is defined by 3 main classes: MetaDataExtractor, DEMParser, and TargetGetter. | ||
These classes are managed by the AthenaApp and MainActivity classes. | ||
|
||
|
||
## OpenAthena Class Diagram | ||
```mermaid | ||
classDiagram | ||
class Application | ||
class AthenaApp | ||
class MetadataExtractor | ||
class DEMParser | ||
class TargetGetter | ||
class MainActivity | ||
class Serializable | ||
|
||
Application --|> AthenaApp : extends | ||
AthenaApp *-- DEMParser : contains | ||
Serializable --|> DEMParser : implements | ||
MainActivity *-- MetadataExtractor : contains | ||
MainActivity *-- AthenaApp : contains | ||
MainActivity *-- TargetGetter : contains | ||
TargetGetter *-- DEMParser : contains | ||
|
||
``` | ||
|
||
## OpenAthena Main Classes | ||
|
||
### MetadataExtractor | ||
The MetadataExtractor class is responsible for extracting metadata from a given drone image. Different drones have different metadata structures, so this class defines behaviors for extracting necessary common information from a variety of drone types. The main interaction with the engine is the getMetaDataValues() method, which handles the actual metadata extraction. | ||
|
||
```mermaid | ||
classDiagram | ||
class MetaDataExtractor { | ||
+ isDroneModelRecognized() | ||
+ getLensType() | ||
+ isThermal() | ||
+ getDistortionParameters() | ||
+ getMatchingDrone() | ||
+ getSensorPhysicalHeight() | ||
+ getSensorPhysicalWidth() | ||
+ getMetaDataValues() | ||
+ handleDJI() | ||
+ handleSkydio() | ||
+ handleAutel() | ||
+ handleParrot() | ||
+ handleTeal() | ||
+ getTagString() | ||
+ getIntrinsicMatrixFromExif() | ||
+ getIntrinsicMatrixFromKnownCCD() | ||
+ getIntrinsicMatrixFromExif35mm() | ||
+ getRayAnglesFromImgPixel() | ||
+ correctRayAnglesForRoll() | ||
+ rationalToFloat() | ||
} | ||
|
||
``` | ||
|
||
### DEMParser | ||
The DEMParser ingests a Digital Elevation Model(DEM) and loads it into the terrain raycast engine. The parser handles DEMs of different formats, ensures elevation type compatibility, and contains a local cache of the DEM being used. The method getAltFromLatLon() can then be called to extract the altitude of a given latitude longitude coordinate. | ||
|
||
```mermaid | ||
classDiagram | ||
class DEMParser { | ||
+ loadDEM() | ||
+ isHorizontalDatumWGS84() | ||
+ getXResolution() | ||
+ getYResolution() | ||
+ getNumCols() | ||
+ getNumRows() | ||
+ getMinLon() | ||
+ getMaxLon() | ||
+ getMinLat() | ||
+ getMaxLat() | ||
+ idwInterpolation() | ||
+ getAltFromLatLon() | ||
} | ||
|
||
``` | ||
|
||
### TargetGetter | ||
TargetGetter is the main terrain casting class within the software. All of the necessary mathematical functions are contained here, and this can be considered the heart of the terrain raycast software. Calling the resolveTarget() method with the necessary drone metadata will cast against the internal representation of a DEM. | ||
|
||
```mermaid | ||
classDiagram | ||
class TargetGetter { | ||
+ resolveTarget() | ||
+ minArcAngle() | ||
+ radNormalize() | ||
+ degNormalize() | ||
+ azumuthToUnitCircle() | ||
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. Typo, 'azumuth' -> azimuth |
||
+ radius_at_lat_lon() | ||
+ inverse_haversine() | ||
+ haversine() | ||
+ haversine_bearing() | ||
+ squared() | ||
+ sqrt() | ||
+ asin() | ||
+ cos() | ||
+ atan2() | ||
} | ||
|
||
``` | ||
### MainActivity and AthenaApp | ||
These main components are managed by the MainActivity and AthenaApp classes. MainActivity can be considered the entry point for all major actions within OpenAthena. Metadata extraction, DEM management, and target acquisition all take place within MainActivity. Activities may not be persistent across the life of the application, so AthenaApp is used to hold all state information persistently across activities. It is for this reason that both TargetGetter and AthenaApp contain a DEMParser object, with the persistent object being passed to TargetGetter as necessary. These classes do not contribute to the actual casting functionality, but manage the casting functionality within Android. | ||
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. And AthenaActivity abstract class and its static variables |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The association here presents a bit of a false equivalency. AthenaApp is a singleton for managing persistent app state, while MainActivity, DEM Activity, FullscreenSelectionActivity, etc. extend the AthenaActivity abstract class. AthenaActivity manages the behavior of subclasses much more than AthenaApp