Skip to content

Commit

Permalink
add drone lat,lon,hae,cameraRollAngleDeg,cameraSlantAngleDeg to CoT o…
Browse files Browse the repository at this point in the history
…penAthenaCalculationInfo field, rename

slantAngleDegrees to raySlantAngleDeg
  • Loading branch information
mkrupczak3 committed May 26, 2024
1 parent 5d4e867 commit b265763
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/openathena/CursorOnTargetSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public static String buildCoT(String uid, String imageISO, String nowAsISO, Stri

Element openAthenaCalculationInfo = doc.createElement("openAthenaCalculationInfo");
double theta = Math.toDegrees(Math.atan2(Double.parseDouble(le),Double.parseDouble(ce)));
openAthenaCalculationInfo.setAttribute("slantAngleDegrees", String.valueOf(theta));
openAthenaCalculationInfo.setAttribute("raySlantAngleDeg", String.valueOf(theta));
// add all the various calculation data from oaInfoMap to use for statistics/experimentation and debugging
for (Map.Entry<String,String> entry : oaInfoMap.entrySet()) {
openAthenaCalculationInfo.setAttribute(entry.getKey(), entry.getValue());
Expand Down
9 changes: 8 additions & 1 deletion app/src/main/java/com/openathena/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -595,14 +595,21 @@ public void calculateImage(View view, boolean shouldISendCoT)
double[] values = theMeta.getMetadataValues(exif);
double y = values[0];
double x = values[1];
// MetadataExctractor.getMetadataValues auto converts vertical datum to EGM96 AMSL
// MetadataExctractor.getMetadataValues auto converts vertical datum to WGS84 ellipsoidal
double z = values[2];
double azimuth = values[3];
// pitch angle in OpenAthena convention, positive degrees downwards from horizon
double theta = values[4];
double roll = values[5];

Log.i(TAG, "parsed xmpMeta\n");

openAthenaCalculationInfo.put("droneLatitude", roundDouble(y));
openAthenaCalculationInfo.put("droneLongitude", roundDouble(x));
openAthenaCalculationInfo.put("droneElevationHAE", roundDouble(z));
openAthenaCalculationInfo.put("cameraRollAngleDeg", roundDouble(roll));
openAthenaCalculationInfo.put("cameraSlantAngleDeg", roundDouble(theta));

appendText(getString(R.string.opened_exif_for_image_msg));
attribs += MetadataExtractor.getTagString(ExifInterface.TAG_DATETIME, exif);
attribs += MetadataExtractor.getTagString(ExifInterface.TAG_MAKE, exif);
Expand Down

0 comments on commit b265763

Please sign in to comment.