diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..82b0934 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,59 @@ +name: CI +on: + push: + branches: + - master + tags: '*' + pull_request: +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.3' + - '1.7' + - 'nightly' + os: + - ubuntu-latest + arch: + - x64 + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: julia-actions/cache@v1 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v2 + with: + files: lcov.info + docs: + name: Documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: '1' + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-docdeploy@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + - run: | + julia --project=docs -e ' + using Documenter: DocMeta, doctest + using AprilTags + DocMeta.setdocmeta!(AprilTags, :DocTestSetup, :(using AprilTags); recursive=true) + doctest(AprilTags)' diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index 678fb47..7ddad2a 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -1,26 +1,45 @@ name: CompatHelper - on: schedule: - - cron: '20 00 * * *' - issues: - types: [opened, reopened] - + - cron: 0 0 * * * + workflow_dispatch: +permissions: + contents: write + pull-requests: write jobs: CompatHelper: - runs-on: ${{ matrix.os }} - strategy: - matrix: - julia-version: [1.2.0] - julia-arch: [x86] - os: [ubuntu-latest] + runs-on: ubuntu-latest steps: - - uses: julia-actions/setup-julia@latest + - name: Check if Julia is already available in the PATH + id: julia_in_path + run: which julia + continue-on-error: true + - name: Install Julia, but only if it is not already available in the PATH + uses: julia-actions/setup-julia@v1 with: - version: ${{ matrix.julia-version }} - - name: Pkg.add("CompatHelper") - run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - - name: CompatHelper.main() + version: '1' + # arch: ${{ runner.arch }} + if: steps.julia_in_path.outcome != 'success' + - name: "Add the General registry via Git" + run: | + import Pkg + ENV["JULIA_PKG_SERVER"] = "" + Pkg.Registry.add("General") + shell: julia --color=yes {0} + - name: "Install CompatHelper" + run: | + import Pkg + name = "CompatHelper" + uuid = "aa819f21-2bde-4658-8897-bab36330d9b7" + version = "3" + Pkg.add(; name, uuid, version) + shell: julia --color=yes {0} + - name: "Run CompatHelper" + run: | + import CompatHelper + CompatHelper.main() + shell: julia --color=yes {0} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: julia -e 'using CompatHelper; CompatHelper.main()' + COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} + # COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3c11827..0000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -## Documentation: http://docs.travis-ci.com/user/languages/julia/ -language: julia -# dist: trusty # for a more recent ImageMagick from Images.jl build script - -os: - - linux - - osx - - windows -dist: xenial -julia: - - 1.5 -notifications: - email: false -git: - depth: 99999999 - -## uncomment and modify the following lines to manually install system packages -# addons: -# apt: # apt-get for linux -# packages: -# - imagemagick -# - gfortran -#before_script: # homebrew for mac -# - if [ $TRAVIS_OS_NAME = osx ]; then brew install gcc; fi - -jobs: - include: - - stage: "Documentation" - julia: 1.5 - os: linux - script: - - julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - - julia --project=docs/ docs/make.jl - after_success: skip - fast_finish: true - allow_failures: - - julia: nightly - -after_success: - # push coverage results to Coveralls - # - julia -e 'cd(Pkg.dir("AprilTags")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())' - # push coverage results to Codecov - - julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())' - #- julia -e 'import Pkg; cd(Pkg.dir("AprilTags")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())' diff --git a/Project.toml b/Project.toml index 03ed58a..d7e58e4 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "AprilTags" uuid = "f0fec3d5-a81e-5a6a-8c28-d2b34f3659de" keywords = ["AprilTags", "fiducials", "markers", "camera", "calibration"] desc = "Visual fiducial marking system" -version = "0.9.0" +version = "0.9.1" [deps] AprilTags_jll = "49f4e9a8-0306-5d58-91df-e9c3c0e42747" @@ -18,9 +18,9 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] AprilTags_jll = "0.1.0" -ColorTypes = "0.10" +ColorTypes = "0.10, 0.11" Colors = "0.8, 0.9, 0.10, 0.11, 0.12" -DocStringExtensions = "0.8" +DocStringExtensions = "0.8, 0.9" FixedPointNumbers = "0.7, 0.8" ImageDraw = "0.1, 0.2" Requires = "1.0" diff --git a/README.md b/README.md index bcf094c..53b6c45 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # AprilTags -[![Build Status](https://travis-ci.org/JuliaRobotics/AprilTags.jl.svg?branch=master)](https://travis-ci.org/JuliaRobotics/AprilTags.jl) +[![CI](https://github.com/JuliaRobotics/AprilTags.jl/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/JuliaRobotics/AprilTags.jl/actions/workflows/CI.yml) [![codecov.io](http://codecov.io/github/JuliaRobotics/AprilTags.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaRobotics/AprilTags.jl?branch=master) [![docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://juliarobotics.github.io/AprilTags.jl/latest/) diff --git a/docs/Project.toml b/docs/Project.toml index ce87d15..4fd08f4 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,5 +1,6 @@ [deps] +AprilTags = "f0fec3d5-a81e-5a6a-8c28-d2b34f3659de" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" [compat] -Documenter = "~0.21" +Documenter = "0.27" diff --git a/docs/make.jl b/docs/make.jl index 90eb8aa..4c7edc0 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,20 +1,20 @@ -using Pkg -Pkg.build("AprilTags") -using Documenter, AprilTags +using AprilTags +using Documenter makedocs( modules = [AprilTags], - format = :html, + format=Documenter.HTML(; + prettyurls=get(ENV, "CI", "false") == "true", + ), sitename = "AprilTags.jl", pages = Any[ "Home" => "index.md", "Functions" => "func_ref.md" ] - # html_prettyurls = !("local" in ARGS), ) deploydocs( repo = "github.com/JuliaRobotics/AprilTags.jl.git", target = "build" -) + ) diff --git a/docs/src/index.md b/docs/src/index.md index 4fd5f24..396f3d6 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -153,6 +153,7 @@ See the [Calibration example](https://github.com/JuliaRobotics/AprilTags.jl/blob ```@docs calcCalibResidualAprilTags! +calcCornerProjectionsAprilTags! ``` ## Manual Outline diff --git a/src/calibrationutils.jl b/src/calibrationutils.jl index ddebc97..499bce9 100644 --- a/src/calibrationutils.jl +++ b/src/calibrationutils.jl @@ -159,16 +159,16 @@ using AprilTags using FileIO # where are the photos of the calibration files -filepaths = [photo1.jpg; photo2.jpg;...] +filepaths = ["photo1.jpg"; "photo2.jpg";...] # load the images into memory imgs = load.(filepaths) -# It's imporant that you measure and specif_height the tag length correctly here +# It's imporant that you measure and specify the tag length correctly here # 30 mm is just a guess, insert your own correct tag measurements here. taglength = 0.03 # rough guess of what calibration parameters might be -# x,y <==> rows,colums +# img[rows,columns] <==> img[height, width] c_width = size(imgs[1],2) / 2 # columns across in Images.jl c_height = size(imgs[1],1) / 2 # rows down in Images.jl f_width = size(imgs[1],1) @@ -220,7 +220,7 @@ freeDetector!(detector) # could also use a deepcopy to duplicate the memory to a ### Related -[`calcCornerProjectionsAprilTags`](@ref) +[`calcCornerProjectionsAprilTags!`](@ref) """ function calcCalibResidualAprilTags!( images::AbstractVector, allTags::AbstractVector; diff --git a/src/helpers.jl b/src/helpers.jl index 5d18bc2..38a6128 100644 --- a/src/helpers.jl +++ b/src/helpers.jl @@ -1,13 +1,32 @@ @enum TagFamilies tag36h11 tag25h9 tag16h5 +""" + $(TYPEDEF) +Represents the detected April tag. +--- +Fields: + $(TYPEDFIELDS) +""" struct AprilTag + "The family of the tag." family::String + "The decoded ID of the tag." id::Int + """How many error bits were corrected? + Note: accepting large numbers of corrected errors leads to greatly increased false positive rates. + NOTE: As of this implementation, the detector cannot detect tags with a Hamming distance greater than 2.""" hamming::Int - # goodness::Float32 + """A measure of the quality of the binary decoding process: the average difference between the intensity of a data bit versus + the decision threshold. Higher numbers roughly indicate better decodes. This is a reasonable measure of detection accuracy + only for very small tags-- not effective for larger tags (where we could have sampled anywhere within a bit cell and still + gotten a good detection.)""" decision_margin::Float32 + """The 3x3 homography matrix describing the projection from an "ideal" tag (with corners at (-1,1), (1,1), (1,-1), and (-1,-1)) + to pixels in the image.""" H::Matrix{Float64} + "The center of the detection in image pixel coordinates" c::Vector{Float64} + "The corners of the tag in image pixel coordinates. These always wrap counter-clock wise around the tag." p::Vector{Vector{Float64}} end