diff --git a/.clang-format b/.clang-format index 7762ec9d..cd54eb45 100644 --- a/.clang-format +++ b/.clang-format @@ -1,9 +1,14 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + # Modified from https://github.com/ament/ament_lint/blob/master/ament_clang_format/ament_clang_format/configuration/.clang-format Language: Cpp BasedOnStyle: Google AccessModifierOffset: -2 AlignAfterOpenBracket: AlwaysBreak +AllowShortFunctionsOnASingleLine: InlineOnly BraceWrapping: AfterClass: true AfterFunction: true @@ -33,6 +38,9 @@ IncludeCategories: - Regex: .*_msgs/.* Priority: 3 CaseSensitive: true + - Regex: .*_srvs/.* + Priority: 3 + CaseSensitive: true # Other Package headers - Regex: <.*> Priority: 2 diff --git a/.cspell.json b/.cspell.json index 2a97aa78..2b8b8ced 100644 --- a/.cspell.json +++ b/.cspell.json @@ -90,6 +90,7 @@ "solvepnp", "sqpnp", "srvs", + "stringop", "subsampled", "subsamples", "subsampling", diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 3f3bf243..8e2d7193 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -1,10 +1,15 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + version: 2 updates: - package-ecosystem: github-actions directory: / + # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#scheduleinterval schedule: - interval: daily + interval: monthly open-pull-requests-limit: 1 labels: - - bot - - github-actions + - tag:bot + - type:github-actions diff --git a/.github/sync-files.yaml b/.github/sync-files.yaml index 23fac8d2..bf1b6e7e 100644 --- a/.github/sync-files.yaml +++ b/.github/sync-files.yaml @@ -1,24 +1,32 @@ -- repository: autowarefoundation/autoware +- repository: autowarefoundation/sync-file-templates files: - source: .github/dependabot.yaml + - source: .github/workflows/build-and-test.yaml + - source: .github/workflows/build-and-test-differential.yaml + - source: .github/workflows/cancel-previous-workflows.yaml + - source: .github/workflows/check-build-depends.yaml + - source: .github/workflows/clang-tidy-pr-comments.yaml + - source: .github/workflows/clang-tidy-pr-comments-manually.yaml - source: .github/workflows/pre-commit.yaml - source: .github/workflows/pre-commit-optional.yaml - source: .github/workflows/semantic-pull-request.yaml - source: .github/workflows/spell-check-differential.yaml + pre-commands: | + sd " with:\n" " with:\n local-cspell-json: .cspell.json\n" {source} + - source: .github/workflows/spell-check-daily.yaml + pre-commands: | + sd " with:\n" " with:\n local-cspell-json: .cspell.json\n" {source} + - source: .github/workflows/sync-files.yaml - source: .clang-format - source: .markdown-link-check.json - source: .markdownlint.yaml - source: .pre-commit-config-optional.yaml + - source: .pre-commit-config.yaml - source: .prettierignore - source: .prettierrc.yaml - source: .yamllint.yaml + - source: CODE_OF_CONDUCT.md + - source: CONTRIBUTING.md - source: CPPLINT.cfg + - source: LICENSE - source: setup.cfg - -- repository: autowarefoundation/autoware_common - files: - - source: .github/workflows/build-and-test.yaml - - source: .github/workflows/build-and-test-differential.yaml - - source: .github/workflows/check-build-depends.yaml - - source: .github/workflows/clang-tidy-pr-comments.yaml - - source: .github/workflows/sync-files.yaml diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 2144d724..9c2ac70e 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -1,29 +1,57 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + name: build-and-test-differential on: pull_request: + types: + - opened + - synchronize + - reopened + - labeled + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true jobs: + require-label: + uses: autowarefoundation/autoware-github-actions/.github/workflows/require-label.yaml@v1 + with: + label: run:build-and-test-differential + build-and-test-differential: - runs-on: ubuntu-latest + needs: require-label + if: ${{ needs.require-label.outputs.result == 'true' }} + runs-on: ubuntu-22.04 container: ${{ matrix.container }} strategy: fail-fast: false matrix: rosdistro: - humble + - jazzy include: - rosdistro: humble container: ros:humble build-depends-repos: build_depends.repos + - rosdistro: jazzy + container: ros:jazzy + build-depends-repos: build_depends.repos steps: - - name: Cancel previous runs - uses: styfle/cancel-workflow-action@0.12.1 + - name: Set PR fetch depth + run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}" - - name: Check out repository + - name: Checkout PR branch and all PR commits uses: actions/checkout@v4 with: - fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: ${{ env.PR_FETCH_DEPTH }} + + - name: Show disk space before the tasks + run: df -h - name: Remove exec_depend uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 @@ -57,3 +85,6 @@ jobs: fail_ci_if_error: false verbose: true flags: differential + + - name: Show disk space after the tasks + run: df -h diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index fa1abd8c..a6996cf2 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + name: build-and-test on: @@ -6,23 +10,36 @@ on: - cron: 0 0 * * * workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true + jobs: build-and-test: if: ${{ github.event_name != 'push' || github.ref_name == github.event.repository.default_branch }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 container: ${{ matrix.container }} strategy: fail-fast: false matrix: rosdistro: - humble + - jazzy include: - rosdistro: humble container: ros:humble build-depends-repos: build_depends.repos + - rosdistro: jazzy + container: ros:jazzy + build-depends-repos: build_depends.repos steps: - name: Check out repository uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Show disk space before the tasks + run: df -h - name: Remove exec_depend uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 @@ -56,3 +73,6 @@ jobs: fail_ci_if_error: false verbose: true flags: total + + - name: Show disk space after the tasks + run: df -h diff --git a/.github/workflows/cancel-previous-workflows.yaml b/.github/workflows/cancel-previous-workflows.yaml new file mode 100644 index 00000000..2037da36 --- /dev/null +++ b/.github/workflows/cancel-previous-workflows.yaml @@ -0,0 +1,20 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + +# Deprecated: Use concurrency in each workflow instead. + +name: cancel-previous-workflows + +on: + pull_request_target: + +jobs: + cancel-previous-workflows: + runs-on: ubuntu-22.04 + steps: + - name: Cancel previous runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + workflow_id: all + all_but_latest: true diff --git a/.github/workflows/check-build-depends.yaml b/.github/workflows/check-build-depends.yaml index c790c213..3fcbd6d9 100644 --- a/.github/workflows/check-build-depends.yaml +++ b/.github/workflows/check-build-depends.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + name: check-build-depends on: @@ -5,9 +9,13 @@ on: paths: - build_depends*.repos +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true + jobs: check-build-depends: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 container: ${{ matrix.container }} strategy: fail-fast: false diff --git a/.github/workflows/clang-tidy-pr-comments-manually.yaml b/.github/workflows/clang-tidy-pr-comments-manually.yaml new file mode 100644 index 00000000..e6e1afd8 --- /dev/null +++ b/.github/workflows/clang-tidy-pr-comments-manually.yaml @@ -0,0 +1,71 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + +name: clang-tidy-pr-comments-manually + +on: + workflow_dispatch: + inputs: + workflow_run_id_or_url: + description: The target workflow run ID or URL of the build-and-test-differential workflow + required: true + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + clang-tidy-pr-comments-manually: + runs-on: ubuntu-22.04 + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Download analysis results + run: | + workflow_run_id=$(echo "${{ inputs.workflow_run_id_or_url }}" | sed -e "s|.*runs/||" -e "s|/jobs.*||") + gh run download "$workflow_run_id" -D /tmp || true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Check if the fixes.yaml file exists + id: check-fixes-yaml-existence + uses: autowarefoundation/autoware-github-actions/check-file-existence@v1 + with: + files: /tmp/clang-tidy-result/fixes.yaml + + - name: Set variables + if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }} + id: set-variables + run: | + echo "pr-id=$(cat /tmp/clang-tidy-result/pr-id.txt)" >> $GITHUB_OUTPUT + echo "pr-head-repo=$(cat /tmp/clang-tidy-result/pr-head-repo.txt)" >> $GITHUB_OUTPUT + echo "pr-head-ref=$(cat /tmp/clang-tidy-result/pr-head-ref.txt)" >> $GITHUB_OUTPUT + + - name: Check out PR head + if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }} + uses: actions/checkout@v4 + with: + repository: ${{ steps.set-variables.outputs.pr-head-repo }} + ref: ${{ steps.set-variables.outputs.pr-head-ref }} + persist-credentials: false + + - name: Replace paths in fixes.yaml + if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }} + run: | + sed -i -e "s|/__w/|/home/runner/work/|g" /tmp/clang-tidy-result/fixes.yaml + cat /tmp/clang-tidy-result/fixes.yaml + + - name: Copy fixes.yaml to access from Docker Container Action + if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }} + run: | + cp /tmp/clang-tidy-result/fixes.yaml fixes.yaml + + - name: Run clang-tidy-pr-comments action + if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }} + uses: platisd/clang-tidy-pr-comments@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + clang_tidy_fixes: fixes.yaml + pull_request_id: ${{ steps.set-variables.outputs.pr-id }} diff --git a/.github/workflows/clang-tidy-pr-comments.yaml b/.github/workflows/clang-tidy-pr-comments.yaml index 9d4210a2..1d808b0b 100644 --- a/.github/workflows/clang-tidy-pr-comments.yaml +++ b/.github/workflows/clang-tidy-pr-comments.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + name: clang-tidy-pr-comments on: @@ -7,28 +11,40 @@ on: types: - completed +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true + jobs: clang-tidy-pr-comments: - if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.event == 'pull_request' && contains(fromJson('["success", "failure"]'), github.event.workflow_run.conclusion) }} + runs-on: ubuntu-22.04 steps: - name: Check out repository uses: actions/checkout@v4 - name: Download analysis results run: | - gh run download ${{ github.event.workflow_run.id }} -D /tmp + gh run download ${{ github.event.workflow_run.id }} -D /tmp || true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Check if the fixes.yaml file exists + id: check-fixes-yaml-existence + uses: autowarefoundation/autoware-github-actions/check-file-existence@v1 + with: + files: /tmp/clang-tidy-result/fixes.yaml + - name: Set variables + if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }} id: set-variables run: | - echo ::set-output name=pr-id::"$(cat /tmp/clang-tidy-result/pr-id.txt)" - echo ::set-output name=pr-head-repo::"$(cat /tmp/clang-tidy-result/pr-head-repo.txt)" - echo ::set-output name=pr-head-ref::"$(cat /tmp/clang-tidy-result/pr-head-ref.txt)" + echo "pr-id=$(cat /tmp/clang-tidy-result/pr-id.txt)" >> $GITHUB_OUTPUT + echo "pr-head-repo=$(cat /tmp/clang-tidy-result/pr-head-repo.txt)" >> $GITHUB_OUTPUT + echo "pr-head-ref=$(cat /tmp/clang-tidy-result/pr-head-ref.txt)" >> $GITHUB_OUTPUT - name: Check out PR head + if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }} uses: actions/checkout@v4 with: repository: ${{ steps.set-variables.outputs.pr-head-repo }} @@ -36,15 +52,18 @@ jobs: persist-credentials: false - name: Replace paths in fixes.yaml + if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }} run: | sed -i -e "s|/__w/|/home/runner/work/|g" /tmp/clang-tidy-result/fixes.yaml cat /tmp/clang-tidy-result/fixes.yaml - name: Copy fixes.yaml to access from Docker Container Action + if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }} run: | cp /tmp/clang-tidy-result/fixes.yaml fixes.yaml - name: Run clang-tidy-pr-comments action + if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }} uses: platisd/clang-tidy-pr-comments@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/spell-check-differential.yaml b/.github/workflows/spell-check-differential.yaml index 1fbf2ff4..e3d2c708 100644 --- a/.github/workflows/spell-check-differential.yaml +++ b/.github/workflows/spell-check-differential.yaml @@ -1,11 +1,19 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + name: spell-check-differential on: pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true + jobs: spell-check-differential: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Check out repository uses: actions/checkout@v4 @@ -13,4 +21,7 @@ jobs: - name: Run spell-check uses: autowarefoundation/autoware-github-actions/spell-check@v1 with: - cspell-json-url: https://raw.githubusercontent.com/tier4/autoware-spell-check-dict/main/.cspell.json + cspell-json-url: https://raw.githubusercontent.com/autowarefoundation/autoware-spell-check-dict/main/.cspell.json + dict-packages: | + https://github.com/autowarefoundation/autoware-spell-check-dict + https://github.com/tier4/cspell-dicts diff --git a/.github/workflows/sync-files.yaml b/.github/workflows/sync-files.yaml index c15244a3..a8a03539 100644 --- a/.github/workflows/sync-files.yaml +++ b/.github/workflows/sync-files.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + name: sync-files on: @@ -5,16 +9,13 @@ on: - cron: 0 0 * * * workflow_dispatch: -jobs: - check-secret: - uses: autowarefoundation/autoware-github-actions/.github/workflows/check-secret.yaml@v1 - secrets: - secret: ${{ secrets.APP_ID }} +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true +jobs: sync-files: - needs: check-secret - if: ${{ needs.check-secret.outputs.set == 'true' }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Generate token id: generate-token @@ -28,6 +29,6 @@ jobs: with: token: ${{ steps.generate-token.outputs.token }} pr-labels: | - bot - sync-files + tag:bot + tag:sync-files auto-merge-method: squash diff --git a/.github/workflows/sync-tier4-universe-to-jazzy.yml b/.github/workflows/sync-tier4-universe-to-jazzy.yml new file mode 100644 index 00000000..eb93f608 --- /dev/null +++ b/.github/workflows/sync-tier4-universe-to-jazzy.yml @@ -0,0 +1,27 @@ +name: sync-tier4-universe-to-jazzy +on: + schedule: + - cron: 0 0 * * * + workflow_dispatch: + +jobs: + sync-branches: + runs-on: ubuntu-latest + steps: + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - name: Run sync-branches + uses: autowarefoundation/autoware-github-actions/sync-branches@v1 + with: + token: ${{ steps.generate-token.outputs.token }} + base-branch: jazzy + sync-target-repository: git@github.com:tier4/CalibrationTools.git + sync-target-branch: tier4/universe + sync-branch: sync-tier4-universe-to-jazzy + pr-title: "chore: sync tier4/universe to jazzy" + auto-merge-method: merge diff --git a/.gitignore b/.gitignore index 65212347..5e3846f6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ log/ # Python *.pyc + +# pre-commit +node_modules/ diff --git a/.markdown-link-check.json b/.markdown-link-check.json index dec3db1a..c71a3e42 100644 --- a/.markdown-link-check.json +++ b/.markdown-link-check.json @@ -4,6 +4,9 @@ { "pattern": "^http://localhost" }, + { + "pattern": "^http://127\\.0\\.0\\.1" + }, { "pattern": "^https://github.com/.*/discussions/new" } diff --git a/.markdownlint.yaml b/.markdownlint.yaml index df1f518d..3f0ffd4f 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,9 +1,17 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + # See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md for all rules. default: true MD013: false MD024: siblings_only: true +MD029: + style: ordered MD033: false MD041: false +MD045: false MD046: false MD049: false +MD059: false diff --git a/.pre-commit-config-optional.yaml b/.pre-commit-config-optional.yaml index a805f120..75e39d4e 100644 --- a/.pre-commit-config-optional.yaml +++ b/.pre-commit-config-optional.yaml @@ -1,6 +1,16 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + +# https://pre-commit.ci/#configuration +ci: + autofix_commit_msg: "style(pre-commit-optional): autofix" + autoupdate_schedule: quarterly + autoupdate_commit_msg: "ci(pre-commit-optional): quarterly autoupdate" + repos: - repo: https://github.com/tcort/markdown-link-check - rev: v3.10.0 + rev: v3.14.2 hooks: - id: markdown-link-check - args: [--config=.markdown-link-check.json] + args: [--quiet, --config=.markdown-link-check.json] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 31f5c3cb..b8c7d8b3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,16 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + +# https://pre-commit.ci/#configuration ci: - autofix_commit_msg: "ci(pre-commit): autofix" - autoupdate_commit_msg: "ci(pre-commit): autoupdate" + autofix_commit_msg: "style(pre-commit): autofix" + autoupdate_schedule: quarterly + autoupdate_commit_msg: "ci(pre-commit): quarterly autoupdate" repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-json - id: check-merge-conflict @@ -19,7 +25,7 @@ repos: args: [--markdown-linebreak-ext=md] - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.44.0 + rev: v0.47.0 hooks: - id: markdownlint args: [-c, .markdownlint.yaml, --fix] @@ -28,12 +34,18 @@ repos: rev: v4.0.0-alpha.8 hooks: - id: prettier + args: [--no-error-on-unmatched-pattern] - repo: https://github.com/adrienverge/yamllint - rev: v1.37.0 + rev: v1.37.1 hooks: - id: yamllint + - repo: https://github.com/autowarefoundation/autoware-guideline-check + rev: 0.2.0 + hooks: + - id: check-package-depends + - repo: https://github.com/tier4/pre-commit-hooks-ros rev: v0.10.0 hooks: @@ -45,29 +57,30 @@ repos: - id: sort-package-xml - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.10.0.1 + rev: v0.11.0.1 hooks: - id: shellcheck - repo: https://github.com/scop/pre-commit-shfmt - rev: v3.11.0-1 + rev: v3.12.0-2 hooks: - id: shfmt args: [-w, -s, -i=4] - repo: https://github.com/pycqa/isort - rev: 6.0.1 + rev: 7.0.0 hooks: - id: isort + args: [--profile=black, --line-length=100] - - repo: https://github.com/psf/black - rev: 25.1.0 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 25.12.0 hooks: - id: black args: [--line-length=100] - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v20.1.0 + rev: v21.1.8 hooks: - id: clang-format types_or: [c++, c, cuda] @@ -79,4 +92,24 @@ repos: args: [--quiet] exclude: .cu -exclude: .svg + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.36.0 + hooks: + - id: check-metaschema + files: ^.+/schema/.*schema\.json$ + + - repo: local + hooks: + - id: prettier-svg + name: prettier svg + description: Apply Prettier with plugin-xml to svg. + entry: prettier --write --list-different --ignore-unknown --print-width 200 --xml-self-closing-space false --xml-whitespace-sensitivity ignore + language: node + files: .svg$ + additional_dependencies: [prettier@2.7.1, "@prettier/plugin-xml@2.2.0"] + + - repo: https://github.com/AleksaC/hadolint-py + rev: v2.14.0 + hooks: + - id: hadolint + exclude: .svg$ diff --git a/.prettierignore b/.prettierignore index a3c34d00..3e96aace 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,6 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + *.param.yaml *.rviz diff --git a/.prettierrc.yaml b/.prettierrc.yaml index e29bf327..fe476936 100644 --- a/.prettierrc.yaml +++ b/.prettierrc.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + printWidth: 100 tabWidth: 2 overrides: diff --git a/.yamllint.yaml b/.yamllint.yaml index 6228c70f..e0be62db 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -1,7 +1,10 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + extends: default ignore: | - .clang-tidy *.param.yaml rules: diff --git a/CPPLINT.cfg b/CPPLINT.cfg index ba6bdf08..159042db 100644 --- a/CPPLINT.cfg +++ b/CPPLINT.cfg @@ -1,12 +1,18 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + # Modified from https://github.com/ament/ament_lint/blob/ebd524bb9973d5ec1dc48a670ce54f958a5a0243/ament_cpplint/ament_cpplint/main.py#L64-L120 set noparent linelength=100 includeorder=standardcfirst filter=-build/c++11 # we do allow C++11 +filter=-build/c++17 # we allow filter=-build/namespaces_literals # we allow using namespace for literals filter=-runtime/references # we consider passing non-const references to be ok filter=-whitespace/braces # we wrap open curly braces for namespaces, classes and functions filter=-whitespace/indent # we don't indent keywords like public, protected and private with one space +filter=-whitespace/newline # we allow the developer to decide about newline at the end of file (it's clashing with clang-format) filter=-whitespace/parens # we allow closing parenthesis to be on the next line filter=-whitespace/semicolon # we allow the developer to decide about whitespace after a semicolon filter=-build/header_guard # we automatically fix the names of header guards using pre-commit diff --git a/README.md b/README.md index 11dda3f9..20514887 100644 --- a/README.md +++ b/README.md @@ -26,14 +26,13 @@ Calibration tools for sensors used in autonomous driving and robotics (camera, l - [Using your vehicle/robot](#using-your-vehiclerobot) - [Create a new project](#create-a-new-project) - [Integrate a new calibrator](#integrate-a-new-calibrator) - - [Troubleshooting & known issues](TROUBLESHOOTING.md) ## Installation ### Requirements -- Ubuntu 22.04 -- ROS2 Humble +- Ubuntu 22.04 / 24.04 +- ROS 2 Humble / Jazzy ### Installation alongside autoware @@ -75,10 +74,13 @@ With a similar motivation to that of the previous Section, in some cases, a nati ```bash # Build -DOCKER_BUILDKIT=1 docker build --ssh default -t ghcr.io/tier4/sensor-calibration-tools:2.0 -f docker/Dockerfile .. +export ROS_DISTRO=humble # for ROS 2 Humble +export ROS_DISTRO=jazzy # for ROS 2 Jazzy + +DOCKER_BUILDKIT=1 docker build --ssh default -t ghcr.io/tier4/sensor-calibration-tools:$ROS_DISTRO -f docker/Dockerfile --build-arg ROS_DISTRO=$ROS_DISTRO .. # Run - Modify if needed -docker run --gpus all --net=host -e ROS_DOMAIN_ID=$ROS_DOMAIN_ID -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --device=/dev/dri:/dev/dri -it ghcr.io/tier4/sensor-calibration-tools:2.0 /bin/bash +docker run --gpus all --net=host -e ROS_DOMAIN_ID=$ROS_DOMAIN_ID -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --device=/dev/dri:/dev/dri -it ghcr.io/tier4/sensor-calibration-tools:${ROS_DISTRO} /bin/bash # If user encounters issues like "Authorization required", use one of the alternatives below. # Solution 1 (Not recommended): @@ -97,7 +99,7 @@ docker run --gpus all --net=host \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -v /tmp/.docker.xauth:/tmp/.docker.xauth \ --device=/dev/dri:/dev/dri \ - -it ghcr.io/tier4/sensor-calibration-tools:2.0 /bin/bash + -it ghcr.io/tier4/sensor-calibration-tools:${ROS_DISTRO} /bin/bash ``` ## Available tools diff --git a/build_depends.repos b/build_depends.repos index 3dc98c1e..2641fc6d 100644 --- a/build_depends.repos +++ b/build_depends.repos @@ -25,7 +25,7 @@ repositories: version: tier4/universe autoware/universe: type: git - url: https://github.com/autowarefoundation/autoware.universe.git + url: https://github.com/autowarefoundation/autoware_universe.git version: main vendor/lidartag: type: git @@ -42,11 +42,11 @@ repositories: vendor/apriltag_ros: type: git url: https://github.com/christianrauch/apriltag_ros.git - version: e814e9e5d5f1bfb60a4aa685d30977c632bbc540 + version: 6a6c04a16502413f114649f9bdb166c784d4fcfb vendor/ros2_numpy: type: git url: https://github.com/Box-Robotics/ros2_numpy.git - version: humble + version: jazzy vendor/ndt_omp: type: git url: https://github.com/tier4/ndt_omp.git diff --git a/calibration_tools_autoware.repos b/calibration_tools_autoware.repos index 3b973546..57926df3 100644 --- a/calibration_tools_autoware.repos +++ b/calibration_tools_autoware.repos @@ -18,12 +18,16 @@ repositories: vendor/apriltag_ros: type: git url: https://github.com/christianrauch/apriltag_ros.git - version: e814e9e5d5f1bfb60a4aa685d30977c632bbc540 + version: 6a6c04a16502413f114649f9bdb166c784d4fcfb vendor/ros2_numpy: type: git url: https://github.com/Box-Robotics/ros2_numpy.git - version: humble + version: jazzy vendor/image_pipeline: type: git url: https://github.com/tier4/image_pipeline.git version: 47964112293eb19f9f57254b2e6b68706954cc63 + vendor/ndt_omp: + type: git + url: https://github.com/tier4/ndt_omp.git + version: tier4/main diff --git a/calibration_tools_standalone.repos b/calibration_tools_standalone.repos index d869534b..78a08083 100644 --- a/calibration_tools_standalone.repos +++ b/calibration_tools_standalone.repos @@ -29,7 +29,7 @@ repositories: version: tier4/universe autoware/universe: type: git - url: https://github.com/autowarefoundation/autoware.universe.git + url: https://github.com/autowarefoundation/autoware_universe.git version: main vendor/lidartag: type: git @@ -46,11 +46,11 @@ repositories: vendor/apriltag_ros: type: git url: https://github.com/christianrauch/apriltag_ros.git - version: e814e9e5d5f1bfb60a4aa685d30977c632bbc540 + version: 6a6c04a16502413f114649f9bdb166c784d4fcfb vendor/ros2_numpy: type: git url: https://github.com/Box-Robotics/ros2_numpy.git - version: humble + version: jazzy vendor/ndt_omp: type: git url: https://github.com/tier4/ndt_omp.git diff --git a/calibrators/ground_plane_calibrator/src/ground_plane_calibrator.cpp b/calibrators/ground_plane_calibrator/src/ground_plane_calibrator.cpp index 5df40e60..8990557b 100644 --- a/calibrators/ground_plane_calibrator/src/ground_plane_calibrator.cpp +++ b/calibrators/ground_plane_calibrator/src/ground_plane_calibrator.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -23,6 +24,12 @@ #include #include +#if RCLCPP_VERSION_MAJOR <= 16 +#define SERVICE_QOS rmw_qos_profile_services_default +#else +#define SERVICE_QOS rclcpp::ServicesQoS() +#endif + namespace ground_plane_calibrator { @@ -103,7 +110,7 @@ ExtrinsicGroundPlaneCalibrator::ExtrinsicGroundPlaneCalibrator(const rclcpp::Nod std::bind( &ExtrinsicGroundPlaneCalibrator::requestReceivedCallback, this, std::placeholders::_1, std::placeholders::_2), - rmw_qos_profile_services_default, srv_callback_group_); + SERVICE_QOS, srv_callback_group_); // Initialize the filter kalman_filter_.setA(Eigen::DiagonalMatrix(1.0, 1.0, 1.0, 1.0, 1.0, 1.0)); diff --git a/calibrators/intrinsic_camera_calibrator/ceres_intrinsic_camera_calibrator/include/ceres_intrinsic_camera_calibrator/fov_residual.hpp b/calibrators/intrinsic_camera_calibrator/ceres_intrinsic_camera_calibrator/include/ceres_intrinsic_camera_calibrator/fov_residual.hpp index 6866c1f4..a06c8695 100644 --- a/calibrators/intrinsic_camera_calibrator/ceres_intrinsic_camera_calibrator/include/ceres_intrinsic_camera_calibrator/fov_residual.hpp +++ b/calibrators/intrinsic_camera_calibrator/ceres_intrinsic_camera_calibrator/include/ceres_intrinsic_camera_calibrator/fov_residual.hpp @@ -341,7 +341,7 @@ std::vector> getCameraPoints( auto backprojection_err = ceres::sqrt(ceres::pow(u - u_bpr, 2) + ceres::pow(v - v_bpr, 2)); auto sign_shift_x = u <= T(0.0) ? T(-1.0) : u >= width - T(1.0) ? T(1.0) : T(0.0); auto sign_shift_y = v <= T(0.0) ? T(-1.0) : v >= height - T(1.0) ? T(1.0) : T(0.0); - if (ceres::IsNaN(backprojection_err) || backprojection_err > backprojection_err_thr) { + if (ceres::isnan(backprojection_err) || backprojection_err > backprojection_err_thr) { camera_points.push_back({x, y, depth, sign_shift_x, sign_shift_y, backprojection_err, false}); return false; } diff --git a/calibrators/intrinsic_camera_calibrator/ceres_intrinsic_camera_calibrator/src/ceres_camera_intrinsics_optimizer.cpp b/calibrators/intrinsic_camera_calibrator/ceres_intrinsic_camera_calibrator/src/ceres_camera_intrinsics_optimizer.cpp index 6f17bd99..11de5b78 100644 --- a/calibrators/intrinsic_camera_calibrator/ceres_intrinsic_camera_calibrator/src/ceres_camera_intrinsics_optimizer.cpp +++ b/calibrators/intrinsic_camera_calibrator/ceres_intrinsic_camera_calibrator/src/ceres_camera_intrinsics_optimizer.cpp @@ -69,7 +69,10 @@ void CeresCameraIntrinsicsOptimizer::setSourceDimensions(int width, int height) height_ = height; } -void CeresCameraIntrinsicsOptimizer::setVerbose(bool verbose) { verbose_ = verbose; } +void CeresCameraIntrinsicsOptimizer::setVerbose(bool verbose) +{ + verbose_ = verbose; +} void CeresCameraIntrinsicsOptimizer::setData( const cv::Mat_ & camera_matrix, const cv::Mat_ & distortion_coeffs, diff --git a/calibrators/intrinsic_camera_calibrator/ceres_intrinsic_camera_calibrator/src/ceres_intrinsic_camera_calibrator_py.cpp b/calibrators/intrinsic_camera_calibrator/ceres_intrinsic_camera_calibrator/src/ceres_intrinsic_camera_calibrator_py.cpp index 7b15a953..60e12ba0 100644 --- a/calibrators/intrinsic_camera_calibrator/ceres_intrinsic_camera_calibrator/src/ceres_intrinsic_camera_calibrator_py.cpp +++ b/calibrators/intrinsic_camera_calibrator/ceres_intrinsic_camera_calibrator/src/ceres_intrinsic_camera_calibrator_py.cpp @@ -30,7 +30,10 @@ #define STRINGIFY(x) #x #define MACRO_STRINGIFY(x) STRINGIFY(x) -int add(int i, int j) { return i + j; } +int add(int i, int j) +{ + return i + j; +} std::tuple test(const Eigen::MatrixXd & matrix) { diff --git a/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/calibrators/utils.py b/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/calibrators/utils.py index b615c9da..2f654e1a 100644 --- a/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/calibrators/utils.py +++ b/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/calibrators/utils.py @@ -102,7 +102,7 @@ def plot_calibration_data_statistics( tilt_cells: int = int(2 * np.ceil(max_tilt_deg / tilt_resolution)) fig, axes = plt.subplots(3, 5, figsize=(20, 12)) - fig.canvas.set_window_title("Calibration data statistics") + fig.canvas.manager.set_window_title("Calibration data statistics") def process_detections(detections: List[BoardDetection]): pixel_occupancy = np.zeros((pixel_cells, pixel_cells)) @@ -200,8 +200,8 @@ def plot_calibration_results_statistics( fig1, axes1 = plt.subplots(3, 4, figsize=(20, 12)) fig2, axes2 = plt.subplots(3, 1, figsize=(20, 12)) - fig1.canvas.set_window_title("Calibration result statistics") - fig2.canvas.set_window_title("Calibration result statistics vs single shot calibration") + fig1.canvas.manager.set_window_title("Calibration result statistics") + fig2.canvas.manager.set_window_title("Calibration result statistics vs single shot calibration") def process_detections(detections: List[BoardDetection]): pixel_errors = [[[] for i in range(pixel_cells)] for j in range(pixel_cells)] diff --git a/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/camera_calibrator.py b/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/camera_calibrator.py index 88f11e9b..b3b4f16b 100644 --- a/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/camera_calibrator.py +++ b/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/camera_calibrator.py @@ -16,6 +16,7 @@ from collections import defaultdict import copy import logging +import multiprocessing from optparse import OptionParser import os import signal @@ -1354,6 +1355,12 @@ def on_parameter_changed(self): def main(args=None): + try: + multiprocessing.set_start_method("spawn", force=True) + except RuntimeError: + logging.warning( + "Cannot set multiprocessing start method to 'spawn'. Pop-up windows may not work properly." + ) set_logger_severity() parser = OptionParser() parser.add_option("-c", "--config-file", type="string", help="calibration file path") @@ -1384,7 +1391,7 @@ def main(args=None): sys.exit(app.exec_()) except (KeyboardInterrupt, SystemExit): logging.info("Received sigint. Quitting...") - rclpy.shutdown() + rclpy.try_shutdown() def sigint_handler(*args): diff --git a/calibrators/lidar_to_lidar_2d_calibrator/CMakeLists.txt b/calibrators/lidar_to_lidar_2d_calibrator/CMakeLists.txt index 40a3db63..daf8c7c3 100755 --- a/calibrators/lidar_to_lidar_2d_calibrator/CMakeLists.txt +++ b/calibrators/lidar_to_lidar_2d_calibrator/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.5) project(lidar_to_lidar_2d_calibrator) +add_compile_options(-Wno-array-bounds) +add_compile_options(-Wno-stringop-overflow) + find_package(autoware_cmake REQUIRED) find_package(OpenCV REQUIRED) # TODO: consider removing this one later diff --git a/calibrators/lidar_to_lidar_2d_calibrator/src/lidar_to_lidar_2d_calibrator.cpp b/calibrators/lidar_to_lidar_2d_calibrator/src/lidar_to_lidar_2d_calibrator.cpp index 665fac9b..7b30ba6d 100644 --- a/calibrators/lidar_to_lidar_2d_calibrator/src/lidar_to_lidar_2d_calibrator.cpp +++ b/calibrators/lidar_to_lidar_2d_calibrator/src/lidar_to_lidar_2d_calibrator.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -38,6 +39,12 @@ #include #include +#if RCLCPP_VERSION_MAJOR <= 16 +#define SERVICE_QOS rmw_qos_profile_services_default +#else +#define SERVICE_QOS rclcpp::ServicesQoS() +#endif + namespace lidar_to_lidar_2d_calibrator { @@ -115,7 +122,7 @@ LidarToLidar2DCalibrator::LidarToLidar2DCalibrator(const rclcpp::NodeOptions & o std::bind( &LidarToLidar2DCalibrator::requestReceivedCallback, this, std::placeholders::_1, std::placeholders::_2), - rmw_qos_profile_services_default, srv_callback_group_); + SERVICE_QOS, srv_callback_group_); // Initialize the filter kalman_filter_.setA(Eigen::DiagonalMatrix(1.0, 1.0, 1.0)); diff --git a/calibrators/mapping_based_calibrator/CMakeLists.txt b/calibrators/mapping_based_calibrator/CMakeLists.txt index 1b8d02f8..2dcc903a 100644 --- a/calibrators/mapping_based_calibrator/CMakeLists.txt +++ b/calibrators/mapping_based_calibrator/CMakeLists.txt @@ -5,6 +5,8 @@ project(mapping_based_calibrator) # cSpell:ignore DEIGEN #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -DEIGEN_NO_DEBUG -march=native -Wl,--no-as-needed") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") +add_compile_options(-Wno-array-bounds) +add_compile_options(-Wno-stringop-overflow) find_package(autoware_cmake REQUIRED) find_package(OpenMP) diff --git a/calibrators/mapping_based_calibrator/include/mapping_based_calibrator/mapping_based_calibrator.hpp b/calibrators/mapping_based_calibrator/include/mapping_based_calibrator/mapping_based_calibrator.hpp index c51ea5b4..d879d1f7 100644 --- a/calibrators/mapping_based_calibrator/include/mapping_based_calibrator/mapping_based_calibrator.hpp +++ b/calibrators/mapping_based_calibrator/include/mapping_based_calibrator/mapping_based_calibrator.hpp @@ -24,13 +24,13 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include #include diff --git a/calibrators/mapping_based_calibrator/src/camera_calibrator.cpp b/calibrators/mapping_based_calibrator/src/camera_calibrator.cpp index 0496c820..f37d5eb4 100644 --- a/calibrators/mapping_based_calibrator/src/camera_calibrator.cpp +++ b/calibrators/mapping_based_calibrator/src/camera_calibrator.cpp @@ -22,16 +22,22 @@ #include #include -#include #include #include #include +#include #include #include #include #include +#if RCLCPP_VERSION_MAJOR <= 16 +#include +#else +#include +#endif + CameraCalibrator::CameraCalibrator( const std::string & calibration_camera_optical_link_frame, CalibrationParameters::Ptr & parameters, MappingData::Ptr & mapping_data, @@ -65,7 +71,9 @@ CameraCalibrator::CameraCalibrator( configureCalibrators(); } -void CameraCalibrator::configureCalibrators() {} +void CameraCalibrator::configureCalibrators() +{ +} std::tuple CameraCalibrator::calibrate() { diff --git a/calibrators/mapping_based_calibrator/src/filters/best_frames_filter.cpp b/calibrators/mapping_based_calibrator/src/filters/best_frames_filter.cpp index 5f40c6e0..e4048a45 100644 --- a/calibrators/mapping_based_calibrator/src/filters/best_frames_filter.cpp +++ b/calibrators/mapping_based_calibrator/src/filters/best_frames_filter.cpp @@ -21,7 +21,10 @@ #include #include -void BestFramesFilter::setName(const std::string & name) { name_ = name + " (BestFramesFilter)"; } +void BestFramesFilter::setName(const std::string & name) +{ + name_ = name + " (BestFramesFilter)"; +} std::vector BestFramesFilter::filter( const std::vector & input_calibration_frames, diff --git a/calibrators/mapping_based_calibrator/src/filters/dynamics_filter.cpp b/calibrators/mapping_based_calibrator/src/filters/dynamics_filter.cpp index 6c6f5615..c7e2cf13 100644 --- a/calibrators/mapping_based_calibrator/src/filters/dynamics_filter.cpp +++ b/calibrators/mapping_based_calibrator/src/filters/dynamics_filter.cpp @@ -18,7 +18,10 @@ #include #include -void DynamicsFilter::setName(const std::string & name) { name_ = name + " (DynamicsFilter)"; } +void DynamicsFilter::setName(const std::string & name) +{ + name_ = name + " (DynamicsFilter)"; +} std::vector DynamicsFilter::filter( const std::vector & calibration_frames, diff --git a/calibrators/mapping_based_calibrator/src/filters/lost_state_filter.cpp b/calibrators/mapping_based_calibrator/src/filters/lost_state_filter.cpp index 82a1ca0b..bd8582b3 100644 --- a/calibrators/mapping_based_calibrator/src/filters/lost_state_filter.cpp +++ b/calibrators/mapping_based_calibrator/src/filters/lost_state_filter.cpp @@ -19,7 +19,10 @@ #include #include -void LostStateFilter::setName(const std::string & name) { name_ = name + " (LostStateFilter)"; } +void LostStateFilter::setName(const std::string & name) +{ + name_ = name + " (LostStateFilter)"; +} std::vector LostStateFilter::filter( const std::vector & calibration_frames, MappingData::Ptr & data) diff --git a/calibrators/mapping_based_calibrator/src/mapping_based_calibrator.cpp b/calibrators/mapping_based_calibrator/src/mapping_based_calibrator.cpp index 8842fff0..436e0d00 100644 --- a/calibrators/mapping_based_calibrator/src/mapping_based_calibrator.cpp +++ b/calibrators/mapping_based_calibrator/src/mapping_based_calibrator.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -32,6 +33,12 @@ #include #include +#if RCLCPP_VERSION_MAJOR <= 16 +#define SERVICE_QOS rmw_qos_profile_services_default +#else +#define SERVICE_QOS rclcpp::ServicesQoS() +#endif + #define UPDATE_PARAM(PARAM_STRUCT, NAME) update_param(p, #NAME, PARAM_STRUCT.NAME##_) namespace @@ -271,10 +278,10 @@ ExtrinsicMappingBasedCalibrator::ExtrinsicMappingBasedCalibrator( auto keyframe_markers_pub = this->create_publisher("keyframe_markers", 10); - auto rosbag2_pause_client_ = this->create_client( - "/rosbag2_player/pause", rmw_qos_profile_services_default); - auto rosbag2_resume_client_ = this->create_client( - "/rosbag2_player/resume", rmw_qos_profile_services_default); + auto rosbag2_pause_client_ = + this->create_client("/rosbag2_player/pause", SERVICE_QOS); + auto rosbag2_resume_client_ = + this->create_client("/rosbag2_player/resume", SERVICE_QOS); // Set up mapper mapper_ = std::make_shared( @@ -335,7 +342,7 @@ ExtrinsicMappingBasedCalibrator::ExtrinsicMappingBasedCalibrator( std::bind( &ExtrinsicMappingBasedCalibrator::requestReceivedCallback, this, std::placeholders::_1, std::placeholders::_2), - rmw_qos_profile_services_default, srv_callback_group_); + SERVICE_QOS, srv_callback_group_); // Set up sensor callbacks assert( @@ -404,7 +411,7 @@ ExtrinsicMappingBasedCalibrator::ExtrinsicMappingBasedCalibrator( mapper_->stop(); RCLCPP_INFO_STREAM(this->get_logger(), "Mapper stopped through service"); }, - rmw_qos_profile_services_default); + SERVICE_QOS); load_database_server_ = this->create_service( @@ -412,7 +419,7 @@ ExtrinsicMappingBasedCalibrator::ExtrinsicMappingBasedCalibrator( std::bind( &ExtrinsicMappingBasedCalibrator::loadDatabaseCallback, this, std::placeholders::_1, std::placeholders::_2), - rmw_qos_profile_services_default); + SERVICE_QOS); save_database_server_ = this->create_service( @@ -420,7 +427,7 @@ ExtrinsicMappingBasedCalibrator::ExtrinsicMappingBasedCalibrator( std::bind( &ExtrinsicMappingBasedCalibrator::saveDatabaseCallback, this, std::placeholders::_1, std::placeholders::_2), - rmw_qos_profile_services_default); + SERVICE_QOS); publisher_timer_ = rclcpp::create_timer( this, this->get_clock(), 5s, std::bind(&CalibrationMapper::publisherTimerCallback, mapper_)); diff --git a/calibrators/marker_radar_lidar_calibrator/include/marker_radar_lidar_calibrator/marker_radar_lidar_calibrator.hpp b/calibrators/marker_radar_lidar_calibrator/include/marker_radar_lidar_calibrator/marker_radar_lidar_calibrator.hpp index f2aa34b4..ecf44349 100644 --- a/calibrators/marker_radar_lidar_calibrator/include/marker_radar_lidar_calibrator/marker_radar_lidar_calibrator.hpp +++ b/calibrators/marker_radar_lidar_calibrator/include/marker_radar_lidar_calibrator/marker_radar_lidar_calibrator.hpp @@ -21,12 +21,12 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include diff --git a/calibrators/marker_radar_lidar_calibrator/scripts/metrics_plotter_node.py b/calibrators/marker_radar_lidar_calibrator/scripts/metrics_plotter_node.py index eeeb92fb..10330095 100755 --- a/calibrators/marker_radar_lidar_calibrator/scripts/metrics_plotter_node.py +++ b/calibrators/marker_radar_lidar_calibrator/scripts/metrics_plotter_node.py @@ -30,7 +30,7 @@ def __init__(self): self.subplot1 = self.axes[0, 1] self.subplot2 = self.axes[1, 0] self.subplot3 = self.axes[1, 1] - plt.gcf().canvas.set_window_title("Metrics plotter") + plt.gcf().canvas.manager.set_window_title("Metrics plotter") self.color_distance_o = "C0o-" self.color_yaw_o = "C1o-" diff --git a/calibrators/marker_radar_lidar_calibrator/src/marker_radar_lidar_calibrator.cpp b/calibrators/marker_radar_lidar_calibrator/src/marker_radar_lidar_calibrator.cpp index ef867465..9d1d3b63 100644 --- a/calibrators/marker_radar_lidar_calibrator/src/marker_radar_lidar_calibrator.cpp +++ b/calibrators/marker_radar_lidar_calibrator/src/marker_radar_lidar_calibrator.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -42,6 +43,12 @@ #include #include +#if RCLCPP_VERSION_MAJOR <= 16 +#define SERVICE_QOS rmw_qos_profile_services_default +#else +#define SERVICE_QOS rclcpp::ServicesQoS() +#endif + #define UPDATE_PARAM(PARAM_STRUCT, NAME) update_param(parameters, #NAME, PARAM_STRUCT.NAME) namespace @@ -269,14 +276,14 @@ ExtrinsicReflectorBasedCalibrator::ExtrinsicReflectorBasedCalibrator( std::bind( &ExtrinsicReflectorBasedCalibrator::requestReceivedCallback, this, std::placeholders::_1, std::placeholders::_2), - rmw_qos_profile_services_default, calibration_api_srv_callback_group_); + SERVICE_QOS, calibration_api_srv_callback_group_); background_model_service_server_ = this->create_service( "extract_background_model", std::bind( &ExtrinsicReflectorBasedCalibrator::backgroundModelRequestCallback, this, std::placeholders::_1, std::placeholders::_2), - rmw_qos_profile_services_default, calibration_ui_srv_callback_group_); + SERVICE_QOS, calibration_ui_srv_callback_group_); timer_ = rclcpp::create_timer( this, get_clock(), std::chrono::seconds(1), @@ -329,7 +336,7 @@ void ExtrinsicReflectorBasedCalibrator::timerCallback() std::bind( &ExtrinsicReflectorBasedCalibrator::trackingRequestCallback, this, std::placeholders::_1, std::placeholders::_2), - rmw_qos_profile_services_default, calibration_ui_srv_callback_group_); + SERVICE_QOS, calibration_ui_srv_callback_group_); } if (calibration_valid_ && !send_calibration_service_server_) { @@ -338,7 +345,7 @@ void ExtrinsicReflectorBasedCalibrator::timerCallback() std::bind( &ExtrinsicReflectorBasedCalibrator::sendCalibrationCallback, this, std::placeholders::_1, std::placeholders::_2), - rmw_qos_profile_services_default, calibration_ui_srv_callback_group_); + SERVICE_QOS, calibration_ui_srv_callback_group_); } if (converged_tracks_.size() > 0 && !delete_track_service_server_) { @@ -347,7 +354,7 @@ void ExtrinsicReflectorBasedCalibrator::timerCallback() std::bind( &ExtrinsicReflectorBasedCalibrator::deleteTrackRequestCallback, this, std::placeholders::_1, std::placeholders::_2), - rmw_qos_profile_services_default, calibration_ui_srv_callback_group_); + SERVICE_QOS, calibration_ui_srv_callback_group_); } } diff --git a/calibrators/tag_based_pnp_calibrator/CMakeLists.txt b/calibrators/tag_based_pnp_calibrator/CMakeLists.txt index b2502e16..01275fd7 100644 --- a/calibrators/tag_based_pnp_calibrator/CMakeLists.txt +++ b/calibrators/tag_based_pnp_calibrator/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.5) project(tag_based_pnp_calibrator) +add_compile_options(-Wno-array-bounds) +add_compile_options(-Wno-stringop-overflow) + find_package(autoware_cmake REQUIRED) find_package(OpenCV REQUIRED) @@ -21,6 +24,11 @@ ament_auto_add_executable(tag_based_pnp_calibrator src/math.cpp ) +target_include_directories(tag_based_pnp_calibrator PUBLIC + include + ${OpenCV_INCLUDE_DIRS} +) + target_link_libraries(tag_based_pnp_calibrator ${OpenCV_LIBS} ) diff --git a/calibrators/tag_based_pnp_calibrator/include/tag_based_pnp_calibrator/calibration_estimator.hpp b/calibrators/tag_based_pnp_calibrator/include/tag_based_pnp_calibrator/calibration_estimator.hpp index 1bcc7e83..d3859485 100644 --- a/calibrators/tag_based_pnp_calibrator/include/tag_based_pnp_calibrator/calibration_estimator.hpp +++ b/calibrators/tag_based_pnp_calibrator/include/tag_based_pnp_calibrator/calibration_estimator.hpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -34,6 +34,12 @@ #include #include +#if RCLCPP_VERSION_MAJOR <= 16 +#include +#else +#include +#endif + class CalibrationEstimator { public: diff --git a/calibrators/tag_based_pnp_calibrator/include/tag_based_pnp_calibrator/tag_calibrator_visualizer.hpp b/calibrators/tag_based_pnp_calibrator/include/tag_based_pnp_calibrator/tag_calibrator_visualizer.hpp index a97ed4e4..674e64b5 100644 --- a/calibrators/tag_based_pnp_calibrator/include/tag_based_pnp_calibrator/tag_calibrator_visualizer.hpp +++ b/calibrators/tag_based_pnp_calibrator/include/tag_based_pnp_calibrator/tag_calibrator_visualizer.hpp @@ -27,13 +27,19 @@ #include #include -#include +#include #include #include #include #include +#if RCLCPP_VERSION_MAJOR <= 16 +#include +#else +#include +#endif + class TagCalibratorVisualizer { public: diff --git a/calibrators/tag_based_pnp_calibrator/src/calibration_estimator.cpp b/calibrators/tag_based_pnp_calibrator/src/calibration_estimator.cpp index c340ea9e..23b43695 100644 --- a/calibrators/tag_based_pnp_calibrator/src/calibration_estimator.cpp +++ b/calibrators/tag_based_pnp_calibrator/src/calibration_estimator.cpp @@ -617,7 +617,10 @@ bool CalibrationEstimator::converged() const getCalibrationCoveragePercentage() >= convergence_min_area_percentage_; } -bool CalibrationEstimator::valid() const { return valid_; } +bool CalibrationEstimator::valid() const +{ + return valid_; +} std::vector> CalibrationEstimator::getActiveLidartagHypotheses() const @@ -696,14 +699,20 @@ void CalibrationEstimator::setCalibrationConvergenceCriteria( convergence_min_area_percentage_ = min_area_percentage; } -void CalibrationEstimator::setMinPnpPairs(int min_pairs) { min_pnp_pairs_ = min_pairs; } +void CalibrationEstimator::setMinPnpPairs(int min_pairs) +{ + min_pnp_pairs_ = min_pairs; +} void CalibrationEstimator::setMinConvergenceTime(double convergence_time) { min_convergence_time_ = convergence_time; } -void CalibrationEstimator::setMaxNoObservationTime(double time) { max_no_observation_time_ = time; } +void CalibrationEstimator::setMaxNoObservationTime(double time) +{ + max_no_observation_time_ = time; +} void CalibrationEstimator::setNewHypothesisDistance(double distance) { @@ -771,7 +780,10 @@ void CalibrationEstimator::setApriltagProcessNoise(double translation) apriltag_process_noise_translation_ = translation; } -double CalibrationEstimator::getNewHypothesisDistance() const { return new_hypothesis_distance_; } +double CalibrationEstimator::getNewHypothesisDistance() const +{ + return new_hypothesis_distance_; +} double CalibrationEstimator::getCalibrationCoveragePercentage() const { @@ -799,4 +811,7 @@ int CalibrationEstimator::getCurrentCalibrationPairsNumber() const return converged_lidartag_hypotheses_.size(); } -int CalibrationEstimator::getConvergencePairNumber() const { return convergence_min_pairs_; } +int CalibrationEstimator::getConvergencePairNumber() const +{ + return convergence_min_pairs_; +} diff --git a/calibrators/tag_based_pnp_calibrator/src/tag_based_pnp_calibrator.cpp b/calibrators/tag_based_pnp_calibrator/src/tag_based_pnp_calibrator.cpp index 6821b289..0f9b3bf7 100644 --- a/calibrators/tag_based_pnp_calibrator/src/tag_based_pnp_calibrator.cpp +++ b/calibrators/tag_based_pnp_calibrator/src/tag_based_pnp_calibrator.cpp @@ -22,8 +22,7 @@ #include -#include -#include +#include #include #include @@ -31,6 +30,16 @@ #include #include +#if RCLCPP_VERSION_MAJOR <= 16 +#include +#include +#define SERVICE_QOS rmw_qos_profile_services_default +#else +#include +#include +#define SERVICE_QOS rclcpp::ServicesQoS() +#endif + ExtrinsicTagBasedPNPCalibrator::ExtrinsicTagBasedPNPCalibrator(const rclcpp::NodeOptions & options) : Node("tag_based_pnp_calibrator_node", options), tf_broadcaster_(this), @@ -159,7 +168,7 @@ ExtrinsicTagBasedPNPCalibrator::ExtrinsicTagBasedPNPCalibrator(const rclcpp::Nod std::bind( &ExtrinsicTagBasedPNPCalibrator::requestReceivedCallback, this, std::placeholders::_1, std::placeholders::_2), - rmw_qos_profile_services_default, srv_callback_group_); + SERVICE_QOS, srv_callback_group_); visualizer_ = std::make_unique(filtered_projections_markers_pub_); diff --git a/calibrators/tag_based_sfm_calibrator/CMakeLists.txt b/calibrators/tag_based_sfm_calibrator/CMakeLists.txt index 7cf42b59..1c87ee9a 100644 --- a/calibrators/tag_based_sfm_calibrator/CMakeLists.txt +++ b/calibrators/tag_based_sfm_calibrator/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.5) project(tag_based_sfm_calibrator) +add_compile_options(-Wno-array-bounds) +add_compile_options(-Wno-stringop-overflow) + find_package(rclcpp REQUIRED) find_package(rclpy REQUIRED) find_package(apriltag REQUIRED) diff --git a/calibrators/tag_based_sfm_calibrator/include/tag_based_sfm_calibrator/ceres/camera_residual.hpp b/calibrators/tag_based_sfm_calibrator/include/tag_based_sfm_calibrator/ceres/camera_residual.hpp index a1c06abb..0ef53b1f 100644 --- a/calibrators/tag_based_sfm_calibrator/include/tag_based_sfm_calibrator/ceres/camera_residual.hpp +++ b/calibrators/tag_based_sfm_calibrator/include/tag_based_sfm_calibrator/ceres/camera_residual.hpp @@ -382,7 +382,7 @@ struct CameraResidual : public SensorResidual std::array & fixed_camera_pose_inv, bool fix_camera_pose, bool optimize_intrinsics) { - std::array null_tag_rotation_z; + std::array null_tag_rotation_z = {}; auto f = new CameraResidual( camera_uid, intrinsics, detection, fixed_camera_pose_inv, null_tag_rotation_z, diff --git a/calibrators/tag_based_sfm_calibrator/package.xml b/calibrators/tag_based_sfm_calibrator/package.xml index 7559f494..d51ec5cb 100644 --- a/calibrators/tag_based_sfm_calibrator/package.xml +++ b/calibrators/tag_based_sfm_calibrator/package.xml @@ -41,6 +41,7 @@ tier4_tag_utils visualization_msgs + lidartag rclpy diff --git a/calibrators/tag_based_sfm_calibrator/src/apriltag_detection.cpp b/calibrators/tag_based_sfm_calibrator/src/apriltag_detection.cpp index 1e93a74f..99d6eca6 100644 --- a/calibrators/tag_based_sfm_calibrator/src/apriltag_detection.cpp +++ b/calibrators/tag_based_sfm_calibrator/src/apriltag_detection.cpp @@ -81,7 +81,10 @@ void LidartagDetection::computeTemplateCorners(double new_size) {-hsize, hsize, 0.0}, {hsize, hsize, 0.0}, {hsize, -hsize, 0.0}, {-hsize, -hsize, 0.0}}; } -void LidartagDetection::computeTemplateCorners() { computeTemplateCorners(this->size); } +void LidartagDetection::computeTemplateCorners() +{ + computeTemplateCorners(this->size); +} void LidartagDetection::computeObjectCorners() { diff --git a/calibrators/tag_based_sfm_calibrator/src/ceres/calibration_problem.cpp b/calibrators/tag_based_sfm_calibrator/src/ceres/calibration_problem.cpp index 6a5360cb..fefb76c9 100644 --- a/calibrators/tag_based_sfm_calibrator/src/ceres/calibration_problem.cpp +++ b/calibrators/tag_based_sfm_calibrator/src/ceres/calibration_problem.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include @@ -40,6 +40,12 @@ #include #include +#if RCLCPP_VERSION_MAJOR <= 16 +#include +#else +#include +#endif + namespace tag_based_sfm_calibrator { @@ -128,7 +134,10 @@ void CalibrationProblem::setWheelTagUIDs(UID left_wheel_tag_uid, UID right_wheel right_wheel_tag_uid_ = right_wheel_tag_uid; } -void CalibrationProblem::setData(CalibrationData::Ptr & data) { data_ = data; } +void CalibrationProblem::setData(CalibrationData::Ptr & data) +{ + data_ = data; +} void CalibrationProblem::dataToPlaceholders() { diff --git a/calibrators/tag_based_sfm_calibrator/src/tag_based_sfm_calibrator.cpp b/calibrators/tag_based_sfm_calibrator/src/tag_based_sfm_calibrator.cpp index 55d7d851..60b9ce93 100644 --- a/calibrators/tag_based_sfm_calibrator/src/tag_based_sfm_calibrator.cpp +++ b/calibrators/tag_based_sfm_calibrator/src/tag_based_sfm_calibrator.cpp @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -49,6 +50,12 @@ #include #include +#if RCLCPP_VERSION_MAJOR <= 16 +#define SERVICE_QOS rmw_qos_profile_services_default +#else +#define SERVICE_QOS rclcpp::ServicesQoS() +#endif + namespace tag_based_sfm_calibrator { @@ -304,7 +311,7 @@ ExtrinsicTagBasedBaseCalibrator::ExtrinsicTagBasedBaseCalibrator( std::bind( &ExtrinsicTagBasedBaseCalibrator::calibrationRequestCallback, this, std::placeholders::_1, std::placeholders::_2), - rmw_qos_profile_services_default, calibration_api_srv_group_); + SERVICE_QOS, calibration_api_srv_group_); // Scene related services add_external_camera_images_srv_ = diff --git a/common/tier4_calibration_pcl_extensions/include/tier4_calibration_pcl_extensions/joint_icp_extended_impl.hpp b/common/tier4_calibration_pcl_extensions/include/tier4_calibration_pcl_extensions/joint_icp_extended_impl.hpp index 68ac4f83..3599e0a8 100644 --- a/common/tier4_calibration_pcl_extensions/include/tier4_calibration_pcl_extensions/joint_icp_extended_impl.hpp +++ b/common/tier4_calibration_pcl_extensions/include/tier4_calibration_pcl_extensions/joint_icp_extended_impl.hpp @@ -326,7 +326,7 @@ void pcl::JointIterativeClosestPointExtended:: } // Check whether we have enough correspondences - if (static_cast(correspondences_->size()) < min_number_correspondences_) { + if (correspondences_->size() < static_cast(min_number_correspondences_)) { PCL_ERROR( "[pcl::%s::computeTransformation] Not enough correspondences found. " "Relax your threshold parameters.\n", diff --git a/common/tier4_tag_utils/include/tier4_tag_utils/apriltag_hypothesis.hpp b/common/tier4_tag_utils/include/tier4_tag_utils/apriltag_hypothesis.hpp index 4e4fa6b6..dec0f411 100644 --- a/common/tier4_tag_utils/include/tier4_tag_utils/apriltag_hypothesis.hpp +++ b/common/tier4_tag_utils/include/tier4_tag_utils/apriltag_hypothesis.hpp @@ -20,10 +20,16 @@ #include #include -#include +#include #include +#if RCLCPP_VERSION_MAJOR <= 16 +#include +#else +#include +#endif + namespace tier4_tag_utils { diff --git a/common/tier4_tag_utils/src/apriltag_filter.cpp b/common/tier4_tag_utils/src/apriltag_filter.cpp index f13568b9..8929a58f 100644 --- a/common/tier4_tag_utils/src/apriltag_filter.cpp +++ b/common/tier4_tag_utils/src/apriltag_filter.cpp @@ -21,12 +21,18 @@ #include -#include +#include #include #include #include +#if RCLCPP_VERSION_MAJOR <= 16 +#include +#else +#include +#endif + namespace tier4_tag_utils { diff --git a/common/tier4_tag_utils/src/apriltag_hypothesis.cpp b/common/tier4_tag_utils/src/apriltag_hypothesis.cpp index b1cb0360..74eefff3 100644 --- a/common/tier4_tag_utils/src/apriltag_hypothesis.cpp +++ b/common/tier4_tag_utils/src/apriltag_hypothesis.cpp @@ -27,7 +27,9 @@ ApriltagHypothesis::ApriltagHypothesis( { } -ApriltagHypothesis::~ApriltagHypothesis() {} +ApriltagHypothesis::~ApriltagHypothesis() +{ +} bool ApriltagHypothesis::update( const std::vector & corners, const rclcpp::Time & stamp) @@ -77,7 +79,10 @@ bool ApriltagHypothesis::update(const rclcpp::Time & stamp) return since_last_observation < max_no_observation_time_; } -int ApriltagHypothesis::getId() const { return id_; } +int ApriltagHypothesis::getId() const +{ + return id_; +} std::vector ApriltagHypothesis::getLatestPoints2d() const { @@ -154,7 +159,10 @@ std::vector ApriltagHypothesis::getPoints3d( return object_points; } -cv::Point3d ApriltagHypothesis::getCenter3d() const { return getCenter3d(getFilteredPoints3d()); } +cv::Point3d ApriltagHypothesis::getCenter3d() const +{ + return getCenter3d(getFilteredPoints3d()); +} cv::Point3d ApriltagHypothesis::getCenter3d(const std::vector & corners) const { @@ -214,7 +222,10 @@ void ApriltagHypothesis::setNewHypothesisThreshold(double max_translation) new_hypothesis_translation_ = max_translation; } -void ApriltagHypothesis::setMaxNoObservationTime(double time) { max_no_observation_time_ = time; } +void ApriltagHypothesis::setMaxNoObservationTime(double time) +{ + max_no_observation_time_ = time; +} void ApriltagHypothesis::setMeasurementNoise(double translation) { @@ -226,7 +237,10 @@ void ApriltagHypothesis::setProcessNoise(double translation) process_noise_translation_ = translation; } -void ApriltagHypothesis::setTagSize(double size) { tag_size_ = size; } +void ApriltagHypothesis::setTagSize(double size) +{ + tag_size_ = size; +} void ApriltagHypothesis::initKalman(const std::vector & corners) { diff --git a/common/tier4_tag_utils/src/lidartag_hypothesis.cpp b/common/tier4_tag_utils/src/lidartag_hypothesis.cpp index c288b3c5..77232e46 100644 --- a/common/tier4_tag_utils/src/lidartag_hypothesis.cpp +++ b/common/tier4_tag_utils/src/lidartag_hypothesis.cpp @@ -98,7 +98,10 @@ bool LidartagHypothesis::update(const rclcpp::Time & stamp) return since_last_observation < max_no_observation_time_; } -int LidartagHypothesis::getId() const { return id_; } +int LidartagHypothesis::getId() const +{ + return id_; +} std::vector LidartagHypothesis::getLatestPoints() { @@ -124,9 +127,15 @@ std::vector LidartagHypothesis::getLatestPoints() return corners; } -cv::Matx33d LidartagHypothesis::getLatestRotation() const { return latest_rotation_matrix_; } +cv::Matx33d LidartagHypothesis::getLatestRotation() const +{ + return latest_rotation_matrix_; +} -cv::Matx31d LidartagHypothesis::getLatestTranslation() const { return latest_translation_vector_; } +cv::Matx31d LidartagHypothesis::getLatestTranslation() const +{ + return latest_translation_vector_; +} std::vector LidartagHypothesis::getFilteredPoints() { @@ -152,7 +161,10 @@ std::vector LidartagHypothesis::getFilteredPoints() return corners; } -cv::Matx33d LidartagHypothesis::getFilteredRotation() const { return filtered_rotation_matrix_; } +cv::Matx33d LidartagHypothesis::getFilteredRotation() const +{ + return filtered_rotation_matrix_; +} cv::Matx31d LidartagHypothesis::getFilteredTranslation() const { @@ -184,7 +196,10 @@ double LidartagHypothesis::getRotCov() const return std::sqrt(max_rotation_cov); } -double LidartagHypothesis::getSpeed() const { return estimated_speed_; } +double LidartagHypothesis::getSpeed() const +{ + return estimated_speed_; +} bool LidartagHypothesis::converged() const { @@ -248,7 +263,10 @@ void LidartagHypothesis::setNewHypothesisThreshold(double max_translation, doubl new_hypothesis_rotation_ = max_rotation; } -void LidartagHypothesis::setMaxNoObservationTime(double time) { max_no_observation_time_ = time; } +void LidartagHypothesis::setMaxNoObservationTime(double time) +{ + max_no_observation_time_ = time; +} void LidartagHypothesis::setMeasurementNoise(double translation, double rotation) { diff --git a/docker/Dockerfile b/docker/Dockerfile index 60816ba2..a6789a65 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,26 +1,26 @@ - -FROM osrf/ros:humble-desktop-jammy +ARG ROS_DISTRO=jazzy +FROM osrf/ros:${ROS_DISTRO}-desktop SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ENV PIP_BREAK_SYSTEM_PACKAGES=1 + +# hadolint ignore=DL3008 RUN apt-get update && apt-get install --no-install-recommends -y \ python3-pip \ - wget + wget \ + && rm -rf /var/lib/apt/lists/* -RUN echo "source /opt/ros/humble/setup.bash" >> /etc/bash.bashrc +RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /etc/bash.bashrc WORKDIR /workspace -RUN mkdir -p /workspace/src - -RUN wget https://raw.githubusercontent.com/tier4/CalibrationTools/tier4/universe/calibration_tools_standalone.repos --directory-prefix=/workspace +RUN mkdir -p /workspace/src && wget --progress=dot:giga https://raw.githubusercontent.com/tier4/CalibrationTools/tier4/universe/calibration_tools_standalone.repos --directory-prefix=/workspace RUN vcs import src < calibration_tools_standalone.repos -RUN rosdep install -y --from-paths `colcon list --packages-up-to sensor_calibration_tools -p` --ignore-src - -RUN source /opt/ros/humble/setup.bash && colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-up-to sensor_calibration_tools +RUN rosdep install -y --from-paths "$(colcon list --packages-up-to sensor_calibration_tools -p)" --ignore-src -RUN rm -rf /var/lib/apt/lists/* +RUN source /opt/ros/"${ROS_DISTRO}"/setup.bash && colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-up-to sensor_calibration_tools RUN echo "source /workspace/install/setup.bash" >> /etc/bash.bashrc diff --git a/docs/images/mapping_based_calibrator/mapping_based_vis.svg b/docs/images/mapping_based_calibrator/mapping_based_vis.svg index bc4df550..cb9e8a1e 100644 --- a/docs/images/mapping_based_calibrator/mapping_based_vis.svg +++ b/docs/images/mapping_based_calibrator/mapping_based_vis.svg @@ -1,4 +1,408 @@ -
static landmark/object
static landmark/object
static landmark/object
static landmark/object
Mapping lidar
Mapping lidar
Calibration lidar
Calibration lidar
Mapping lidar
Mapping lidar
Calibration lidar
Calibration lidar
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ static landmark/object +
+
+
+
+ static landmark/object +
+
+
+ + + + + + + +
+
+
+ static landmark/object +
+
+
+
+ static landmark/object +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ Mapping lidar +
+
+
+
+ Mapping lidar +
+
+
+ + + + + + + +
+
+
+ + Calibration l + + idar +
+
+
+
+ Calibration lidar +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ Mapping lidar +
+
+
+
+ Mapping lidar +
+
+
+ + + + + + + +
+
+
+ + Calibration l + + idar +
+
+
+
+ Calibration lidar +
+
+
+ + + + +
+
diff --git a/docs/images/marker_radar_lidar_calibrator/background_construction.svg b/docs/images/marker_radar_lidar_calibrator/background_construction.svg index 53431a22..6c2dde54 100644 --- a/docs/images/marker_radar_lidar_calibrator/background_construction.svg +++ b/docs/images/marker_radar_lidar_calibrator/background_construction.svg @@ -1,4 +1,359 @@ -
radar
lidar
Object's from radar
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
radar
+
+
+
+ +
+
+
+ + + + + + + +
+
+
lidar
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
Object's from radar
+
+
+
+ +
+
+
+
+
diff --git a/docs/images/marker_radar_lidar_calibrator/foreground_extraction.svg b/docs/images/marker_radar_lidar_calibrator/foreground_extraction.svg index c0e38115..23a364a1 100644 --- a/docs/images/marker_radar_lidar_calibrator/foreground_extraction.svg +++ b/docs/images/marker_radar_lidar_calibrator/foreground_extraction.svg @@ -1,4 +1,440 @@ -
radar
lidar
Bird's-eye-view of
radar reflector + tripod
Object's from radar
Human
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
radar
+
+
+
+ +
+
+
+ + + + + + + +
+
+
lidar
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ Bird's-eye-view of +
radar reflector + tripod
+
+
+
+
+ +
+
+
+ + + + + + + + + + +
+
+
Object's from radar
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+
Human
+
+
+
+ +
+
+
+
+
diff --git a/docs/images/marker_radar_lidar_calibrator/marker_radar_lidar_vis.svg b/docs/images/marker_radar_lidar_calibrator/marker_radar_lidar_vis.svg index 835192b7..31d6f879 100644 --- a/docs/images/marker_radar_lidar_calibrator/marker_radar_lidar_vis.svg +++ b/docs/images/marker_radar_lidar_calibrator/marker_radar_lidar_vis.svg @@ -1,4 +1,173 @@ -
radar
lidar
Bird's-eye-view of 
radar reflector + tripod
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + +
+
+
radar
+
+
+
+ +
+
+
+ + + + + + + +
+
+
lidar
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + +
+
+
+ Bird's-eye-view of +
radar reflector + tripod
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
diff --git a/docs/images/tag_based_sfm_calibrator/bev_setup.svg b/docs/images/tag_based_sfm_calibrator/bev_setup.svg index e39eea43..e7fbb35b 100644 --- a/docs/images/tag_based_sfm_calibrator/bev_setup.svg +++ b/docs/images/tag_based_sfm_calibrator/bev_setup.svg @@ -1 +1,371 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/tutorials/mapping_based_calibrator.md b/docs/tutorials/mapping_based_calibrator.md index b276c93e..12afe63f 100644 --- a/docs/tutorials/mapping_based_calibrator.md +++ b/docs/tutorials/mapping_based_calibrator.md @@ -130,7 +130,7 @@ In the UI of the rdv project, three different TF trees are displayed: `Initial T - The `Initial TF Tree` presents the initial TF connections between sensors needed for calibration. - The `Calibration Tree` shows the calibrated transformation between sensors, in this tutorial, `pandar_top`, `pandar_front`, `pandar_right`and `pandar_left`. -- The `Final TF Tree` depicts the TF tree after incorporating the updated calibrated transformation. As autoware utilizes the concept of [sensor_kit](https://autowarefoundation.github.io/autoware-documentation/main/how-to-guides/integrating-autoware/creating-vehicle-and-sensor-model/creating-sensor-model/), the final transformations required to comply to the specifications is `sensor_kit_base_link` to `pandar_front_base_link`, `pandar_left_base_link`, and `pandar_right_base_link`. These transformations are performed by the [calibrator interface](../../sensor_calibration_manager/sensor_calibration_manager/calibrators/rdv/mapping_based_lidar_lidar_calibrator.py) related to this project. The red arrows indicate that the final transformations changed after the calibration process. +- The `Final TF Tree` depicts the TF tree after incorporating the updated calibrated transformation. As autoware utilizes the concept of [sensor_kit](https://autowarefoundation.github.io/autoware-documentation/main/tutorials/integrating-autoware/creating-vehicle-and-sensor-model/creating-sensor-model/), the final transformations required to comply to the specifications is `sensor_kit_base_link` to `pandar_front_base_link`, `pandar_left_base_link`, and `pandar_right_base_link`. These transformations are performed by the [calibrator interface](../../sensor_calibration_manager/sensor_calibration_manager/calibrators/rdv/mapping_based_lidar_lidar_calibrator.py) related to this project. The red arrows indicate that the final transformations changed after the calibration process.

menu4 diff --git a/docs/tutorials/marker_radar_lidar_calibrator.md b/docs/tutorials/marker_radar_lidar_calibrator.md index 006b01d9..553ac1a3 100644 --- a/docs/tutorials/marker_radar_lidar_calibrator.md +++ b/docs/tutorials/marker_radar_lidar_calibrator.md @@ -220,7 +220,7 @@ In the UI of the X2 project, three different TF trees are displayed: `Initial TF - The `Initial TF Tree` presents the initial TF connections between sensors needed for calibration. - The `Calibration Tree` shows the calibrated transformation between sensors, in this tutorial, `front_center/radar_link` to `pandar_40p_front`. -- The `Final TF Tree` depicts the TF tree after incorporating the updated calibrated transformation. As autoware utilizes the concept of [sensor_kit](https://autowarefoundation.github.io/autoware-documentation/main/how-to-guides/integrating-autoware/creating-vehicle-and-sensor-model/creating-sensor-model/), the final transformation required to comply to the specifications is `front_unit_base_link` to `front_center/radar_link`. This transformation is performed by the [calibrator interface](../../sensor_calibration_manager/sensor_calibration_manager/calibrators/x2/marker_radar_lidar_calibrator.py) related to this project. The red arrow indicates that the final transformation changed after the calibration process. +- The `Final TF Tree` depicts the TF tree after incorporating the updated calibrated transformation. As autoware utilizes the concept of [sensor_kit](https://autowarefoundation.github.io/autoware-documentation/main/tutorials/integrating-autoware/creating-vehicle-and-sensor-model/creating-sensor-model/), the final transformation required to comply to the specifications is `front_unit_base_link` to `front_center/radar_link`. This transformation is performed by the [calibrator interface](../../sensor_calibration_manager/sensor_calibration_manager/calibrators/x2/marker_radar_lidar_calibrator.py) related to this project. The red arrow indicates that the final transformation changed after the calibration process.

menu4 diff --git a/docs/tutorials/tag_based_pnp_calibrator.md b/docs/tutorials/tag_based_pnp_calibrator.md index 572a01f3..51702eb8 100644 --- a/docs/tutorials/tag_based_pnp_calibrator.md +++ b/docs/tutorials/tag_based_pnp_calibrator.md @@ -103,7 +103,7 @@ In the UI of the X2 project, three different TF trees are displayed: `Initial TF - The `Initial TF Tree` presents the initial TF connections between sensors needed for calibration. - The `Calibration Tree` shows the calibrated transformation between sensors, in this tutorial, `camera6/camera_optical_link` to `pandar_40p_front`. -- The `Final TF Tree` depicts the TF tree after incorporating the updated calibrated transformation. As autoware utilizes the concept of [sensor_kit](https://autowarefoundation.github.io/autoware-documentation/main/how-to-guides/integrating-autoware/creating-vehicle-and-sensor-model/creating-sensor-model/), the final transformation required to comply to the specifications is `front_unit_base_link` to `camera6/camera_link`. This transformation is performed by the [calibrator interface](../../sensor_calibration_manager/sensor_calibration_manager/calibrators/x2/tag_based_pnp_calibrator.py) related to this project. The red arrow indicates that the final transformation changed after the calibration process. +- The `Final TF Tree` depicts the TF tree after incorporating the updated calibrated transformation. As autoware utilizes the concept of [sensor_kit](https://autowarefoundation.github.io/autoware-documentation/main/tutorials/integrating-autoware/creating-vehicle-and-sensor-model/creating-sensor-model/), the final transformation required to comply to the specifications is `front_unit_base_link` to `camera6/camera_link`. This transformation is performed by the [calibrator interface](../../sensor_calibration_manager/sensor_calibration_manager/calibrators/x2/tag_based_pnp_calibrator.py) related to this project. The red arrow indicates that the final transformation changed after the calibration process.

menu4 diff --git a/setup.cfg b/setup.cfg index 5214751c..4d7d5e5b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + [flake8] # Modified from https://github.com/ament/ament_lint/blob/ebd524bb9973d5ec1dc48a670ce54f958a5a0243/ament_flake8/ament_flake8/configuration/ament_flake8.ini extend-ignore = B902,C816,D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404,I202,CNL100,E203,E501,Q000