From 3fea22ef96fa98a5e1d092981b3dd398b5793f5d Mon Sep 17 00:00:00 2001 From: SlicedBacon Date: Fri, 11 Oct 2024 15:36:04 -0400 Subject: [PATCH 1/4] Add Core Functionality Description Markdown Documentation describing the main casting functionality within OpenAthena Android --- ANDROIDCOREFUNCTIONALITY.md | 97 +++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 ANDROIDCOREFUNCTIONALITY.md diff --git a/ANDROIDCOREFUNCTIONALITY.md b/ANDROIDCOREFUNCTIONALITY.md new file mode 100644 index 0000000..005e253 --- /dev/null +++ b/ANDROIDCOREFUNCTIONALITY.md @@ -0,0 +1,97 @@ +# 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 +@startuml +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 +@enduml + +## 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. + +@startuml +class MetaDataExtractor { + isDroneModelRecognized() + getLensType() + isThermal() + getDistortionParameters() + getMatchingDrone() + getSensorPhysicalHeight() + getSensorPhysicalWidth() + getMetaDataValues() + handleDJI() + handleSkydio() + handleAutel() + handleParrot() + handleTeal() + getTagString() + getIntrinsicMatrixFromExif() + getIntrinsicMatrixFromKnownCCD() + getIntrinsicMatrixFromExif35mm() + getRayAnglesFromImgPixel() + correctRayAnglesForRoll() + rationalToFloat() +} +@enduml + +### 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. + +@startuml +class DEMParser { + loadDEM() + isHorizontalDatumWGS84() + getXResolution() + getYResolution() + getNumCols() + getNumRows() + getMinLon() + getMaxLon() + getMinLat() + getMaxLat() + idwInterpolation() + getAltFromLatLon() +} +@enduml + +### 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. + +@startuml +class TargetGetter { + resolveTarget() + minArcAngle() + radNormalize() + degNormalize() + azumuthToUnitCircle() + radius_at_lat_lon() + inverse_haversine() + haversine() + haversine_bearing() + squared() + sqrt() + asin() + cos() + atan2() +} +@enduml + +### 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. From 1d6502db76c39d79662ea4ffcffd60438195436f Mon Sep 17 00:00:00 2001 From: SlicedBacon Date: Fri, 11 Oct 2024 15:38:57 -0400 Subject: [PATCH 2/4] update to allow plantuml display properly --- ANDROIDCOREFUNCTIONALITY.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ANDROIDCOREFUNCTIONALITY.md b/ANDROIDCOREFUNCTIONALITY.md index 005e253..42ee77f 100644 --- a/ANDROIDCOREFUNCTIONALITY.md +++ b/ANDROIDCOREFUNCTIONALITY.md @@ -4,6 +4,7 @@ These classes are managed by the AthenaApp and MainActivity classes. ## OpenAthena Class Diagram +'''plantuml @startuml class Application class AthenaApp @@ -20,12 +21,14 @@ MainActivity *-- AthenaApp : contains MainActivity *-- TargetGetter : contains TargetGetter *-- DEMParser : contains @enduml +''' ## 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. +'''plantuml @startuml class MetaDataExtractor { isDroneModelRecognized() @@ -50,6 +53,7 @@ class MetaDataExtractor { rationalToFloat() } @enduml +''' ### 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. @@ -74,6 +78,7 @@ class DEMParser { ### 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. +'''plantuml @startuml class TargetGetter { resolveTarget() @@ -92,6 +97,7 @@ class TargetGetter { atan2() } @enduml +''' ### 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. From 409b02059793b69e89520e1427f2fc3b3dde029e Mon Sep 17 00:00:00 2001 From: SlicedBacon Date: Fri, 11 Oct 2024 15:50:43 -0400 Subject: [PATCH 3/4] quick conversion to mermaid over plantuml --- ANDROIDCOREFUNCTIONALITY.md | 157 ++++++++++++++++++------------------ 1 file changed, 80 insertions(+), 77 deletions(-) diff --git a/ANDROIDCOREFUNCTIONALITY.md b/ANDROIDCOREFUNCTIONALITY.md index 42ee77f..edac814 100644 --- a/ANDROIDCOREFUNCTIONALITY.md +++ b/ANDROIDCOREFUNCTIONALITY.md @@ -4,23 +4,24 @@ These classes are managed by the AthenaApp and MainActivity classes. ## OpenAthena Class Diagram -'''plantuml -@startuml -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 -@enduml +'''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 @@ -28,75 +29,77 @@ TargetGetter *-- DEMParser : contains ### 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. -'''plantuml -@startuml -class MetaDataExtractor { - isDroneModelRecognized() - getLensType() - isThermal() - getDistortionParameters() - getMatchingDrone() - getSensorPhysicalHeight() - getSensorPhysicalWidth() - getMetaDataValues() - handleDJI() - handleSkydio() - handleAutel() - handleParrot() - handleTeal() - getTagString() - getIntrinsicMatrixFromExif() - getIntrinsicMatrixFromKnownCCD() - getIntrinsicMatrixFromExif35mm() - getRayAnglesFromImgPixel() - correctRayAnglesForRoll() - rationalToFloat() -} -@enduml +'''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. -@startuml -class DEMParser { - loadDEM() - isHorizontalDatumWGS84() - getXResolution() - getYResolution() - getNumCols() - getNumRows() - getMinLon() - getMaxLon() - getMinLat() - getMaxLat() - idwInterpolation() - getAltFromLatLon() -} -@enduml +'''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. -'''plantuml -@startuml -class TargetGetter { - resolveTarget() - minArcAngle() - radNormalize() - degNormalize() - azumuthToUnitCircle() - radius_at_lat_lon() - inverse_haversine() - haversine() - haversine_bearing() - squared() - sqrt() - asin() - cos() - atan2() -} -@enduml +'''mermaid +classDiagram + class TargetGetter { + + resolveTarget() + + minArcAngle() + + radNormalize() + + degNormalize() + + azumuthToUnitCircle() + + radius_at_lat_lon() + + inverse_haversine() + + haversine() + + haversine_bearing() + + squared() + + sqrt() + + asin() + + cos() + + atan2() + } + ''' ### MainActivity and AthenaApp From f6d81f5bf86ee682be33a7afc8b8a6b2f5d98fd5 Mon Sep 17 00:00:00 2001 From: SlicedBacon Date: Fri, 11 Oct 2024 15:54:04 -0400 Subject: [PATCH 4/4] Update ANDROIDCOREFUNCTIONALITY.md --- ANDROIDCOREFUNCTIONALITY.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ANDROIDCOREFUNCTIONALITY.md b/ANDROIDCOREFUNCTIONALITY.md index edac814..9d71912 100644 --- a/ANDROIDCOREFUNCTIONALITY.md +++ b/ANDROIDCOREFUNCTIONALITY.md @@ -4,7 +4,7 @@ These classes are managed by the AthenaApp and MainActivity classes. ## OpenAthena Class Diagram -'''mermaid +```mermaid classDiagram class Application class AthenaApp @@ -22,14 +22,14 @@ classDiagram 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 +```mermaid classDiagram class MetaDataExtractor { + isDroneModelRecognized() @@ -54,12 +54,12 @@ classDiagram + 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 +```mermaid classDiagram class DEMParser { + loadDEM() @@ -76,12 +76,12 @@ classDiagram + 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 +```mermaid classDiagram class TargetGetter { + resolveTarget() @@ -100,7 +100,6 @@ classDiagram + 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.