Skip to content

Commit

Permalink
Merge branch 'apriltags-2.0.0' of https://github.com/deltacv/AprilTag…
Browse files Browse the repository at this point in the history
…Desktop into apriltags-2.0.0
  • Loading branch information
serivesmejia committed Aug 5, 2023
2 parents a58581f + bbc0ed0 commit bdc03b1
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
File renamed without changes.
30 changes: 30 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on: [push, pull_request]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: build
13 changes: 10 additions & 3 deletions src/main/java/org/openftc/apriltag/ApriltagDetectionJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

package org.openftc.apriltag;

import org.firstinspires.ftc.robotcore.external.matrices.GeneralMatrixF;
import io.github.deltacv.apriltag.NativeLibLoader;
import org.opencv.core.Point;

Expand Down Expand Up @@ -126,9 +127,15 @@ public static ArrayList<AprilTagDetection> getDetections(long ptrDetections, dou
detection.pose.x = pose[0];
detection.pose.y = pose[1];
detection.pose.z = pose[2];
detection.pose.yaw = pose[3];
detection.pose.pitch = pose[4];
detection.pose.roll = pose[5];

float[] rotMtxVals = new float[3*3];

for (int i = 0; i < 9; i++)
{
rotMtxVals[i] = (float) pose[3 + i];
}

detection.pose.R = new GeneralMatrixF(3, 3, rotMtxVals);

detections.add(detection);
}
Expand Down

0 comments on commit bdc03b1

Please sign in to comment.