Skip to content

Commit

Permalink
Merge deltacv/apriltags-2.0.0
Browse files Browse the repository at this point in the history
Apriltags 2.0.0
  • Loading branch information
serivesmejia authored Aug 15, 2023
2 parents 47784bf + 0ecb94a commit 37ce1e5
Show file tree
Hide file tree
Showing 122 changed files with 5,442 additions and 182,038 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/build_natives.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CMake
on:
push:
branches:
- "**"
env:
BUILD_TYPE: Release
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-java@v3
with:
distribution: adopt
java-version: "8"
- name: Configure CMake
run: cmake .
- name: Build
run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}}
- uses: actions/upload-artifact@v3
with:
name: native-linux-amd64
path: ${{github.workspace}}/*.so
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-java@v3
with:
distribution: adopt
java-version: "8"
- name: Configure CMake
run: cmake -T ClangCL .
- name: Build
run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}}
- uses: actions/upload-artifact@v3
with:
name: native-windows-amd64
path: ${{github.workspace}}\${{env.BUILD_TYPE}}\*.dll
build-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-java@v3
with:
distribution: adopt
java-version: "8"
- name: Configure CMake
run: cmake .
- name: Build
run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}}
- uses: actions/upload-artifact@v3
with:
name: native-mac-amd64
path: ${{github.workspace}}/*.dylib
build-mac-cross-m1:
needs:
- build-linux
- build-windows
- build-mac
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-java@v3
with:
distribution: adopt
java-version: "8"
- name: Configure CMake
run: cmake -DCMAKE_OSX_ARCHITECTURES="arm64" .
- name: Build
run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}}
- uses: actions/download-artifact@v3
with:
name: native-windows-amd64
path: ${{github.workspace}}
- uses: actions/download-artifact@v3
with:
name: native-linux-amd64
path: ${{github.workspace}}
- uses: actions/download-artifact@v3
with:
name: native-mac-amd64
path: ${{github.workspace}}

- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: natives-${{github.ref}}
prerelease: true
title: Natives from ${{github.ref}}
files: |
${{github.workspace}}/*.dll
${{github.workspace}}/*.so
${{github.workspace}}/*.dylib
File renamed without changes.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Created by https://www.toptal.com/developers/gitignore/api/intellij
# Edit at https://www.toptal.com/developers/gitignore?templates=intellij

*.DS_Store

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
Expand Down Expand Up @@ -125,4 +127,4 @@ _deps
# End of https://www.toptal.com/developers/gitignore/api/cmake

*.a
*.cmake
*.cmake
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/main/cpp/apriltag"]
path = src/main/cpp/apriltag
url = https://github.com/AprilRobotics/apriltag
91 changes: 54 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,28 @@
# This ensures that a certain set of CMake features is available to
# your build.

cmake_minimum_required(VERSION 3.4.1)
cmake_minimum_required(VERSION 3.5)
set(CMAKE_CXX_STANDARD 20)

project("apriltag")

if(NOT DEFINED ARCH)
if(DEFINED CMAKE_OSX_ARCHITECTURES AND NOT "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
set(ARCH ${CMAKE_OSX_ARCHITECTURES})
else()
set(ARCH ${CMAKE_SYSTEM_PROCESSOR})
endif()
endif()

string(TOLOWER ${ARCH} ARCH)


if("${ARCH}" STREQUAL "x86_64")
set(ARCH "amd64")
endif()

message(STATUS "Target architecture: ${ARCH}")

message(STATUS $ENV{JAVA_HOME})

set(JAVA_AWT_LIBRARY NotNeeded)
Expand All @@ -17,10 +34,6 @@ set(JAVA_AWT_INCLUDE_PATH NotNeeded)

find_package(JNI REQUIRED)

# option(CMAKE_USE_WIN32_THREADS_INIT "using WIN32 threads" ON)

set (CMAKE_CXX_STANDARD 11)

add_library( # Specifies the name of the library.
apriltag

Expand All @@ -30,40 +43,44 @@ add_library( # Specifies the name of the library.
# Provides a relative path to your source file(s).
src/main/cpp/AprilTagDetectorJNI.cpp
src/main/cpp/AprilTagDetectionJNI.cpp
src/main/cpp/apriltag_common/src/g2d.c
src/main/cpp/apriltag_common/src/getopt.c
src/main/cpp/apriltag_common/src/homography.c
src/main/cpp/apriltag_common/src/image_u8.c
src/main/cpp/apriltag_common/src/image_u8x3.c
src/main/cpp/apriltag_common/src/image_u8x4.c
src/main/cpp/apriltag_common/src/matd.c
src/main/cpp/apriltag_common/src/pam.c
src/main/cpp/apriltag_common/src/pjpeg.c
src/main/cpp/apriltag_common/src/pjpeg-idct.c
src/main/cpp/apriltag_common/src/pnm.c
src/main/cpp/apriltag_common/src/string_util.c
src/main/cpp/apriltag_common/src/pthreads_cross.cpp
src/main/cpp/apriltag_common/src/svd22.c
src/main/cpp/apriltag_common/src/time_util.c
src/main/cpp/apriltag_common/src/unionfind.c
src/main/cpp/apriltag_common/src/workerpool.c
src/main/cpp/apriltag_common/src/zarray.c
src/main/cpp/apriltag_common/src/zhash.c
src/main/cpp/apriltag_common/src/zmaxheap.c
src/main/cpp/apriltag/src/apriltag.c
src/main/cpp/apriltag/src/apriltag_pose.c
src/main/cpp/apriltag/src/apriltag_quad_thresh.c
src/main/cpp/apriltag/src/tag16h5.c
src/main/cpp/apriltag/src/tag25h9.c
src/main/cpp/apriltag/src/tag36h11.c
src/main/cpp/apriltag/src/tagCircle21h7.c
src/main/cpp/apriltag/src/tagStandard41h12.c)

src/main/cpp/apriltag/common/g2d.c
src/main/cpp/apriltag/common/getopt.c
src/main/cpp/apriltag/common/homography.c
src/main/cpp/apriltag/common/image_u8.c
src/main/cpp/apriltag/common/image_u8x3.c
src/main/cpp/apriltag/common/image_u8x4.c
src/main/cpp/apriltag/common/matd.c
src/main/cpp/apriltag/common/pam.c
src/main/cpp/apriltag/common/pjpeg.c
src/main/cpp/apriltag/common/pjpeg-idct.c
src/main/cpp/apriltag/common/pnm.c
src/main/cpp/apriltag/common/string_util.c
src/main/cpp/apriltag/common/pthreads_cross.cpp
src/main/cpp/apriltag/common/svd22.c
src/main/cpp/apriltag/common/time_util.c
src/main/cpp/apriltag/common/unionfind.c
src/main/cpp/apriltag/common/workerpool.c
src/main/cpp/apriltag/common/zarray.c
src/main/cpp/apriltag/common/zhash.c
src/main/cpp/apriltag/common/zmaxheap.c
src/main/cpp/apriltag/apriltag.c
src/main/cpp/apriltag/apriltag_pose.c
src/main/cpp/apriltag/apriltag_quad_thresh.c
src/main/cpp/apriltag/tag16h5.c
src/main/cpp/apriltag/tag25h9.c
src/main/cpp/apriltag/tag36h11.c
src/main/cpp/apriltag/tagCircle21h7.c
src/main/cpp/apriltag/tagStandard41h12.c
)

set_target_properties(apriltag PROPERTIES OUTPUT_NAME "apriltag_${ARCH}")

# set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")

# Specifies a path to native header files.
include_directories(
src/main/cpp/apriltag/include
src/main/cpp/apriltag_common/include
#${CMAKE_JAVA_}
src/main/cpp/apriltag
src/main/cpp/apriltag/common
${JNI_INCLUDE_DIRS}
)

35 changes: 35 additions & 0 deletions RobotCore/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
plugins {
id 'java'
id 'maven-publish'
}

group 'org.firstinspires.ftc'
version '8.2.0'

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}


task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = "sources"
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
}
}
}

repositories {
mavenCentral()
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
}
Binary file added RobotCore/libs/Vuforia.jar
Binary file not shown.
Loading

0 comments on commit 37ce1e5

Please sign in to comment.