Skip to content

Commit

Permalink
Merge pull request #5 from tier4/sync-upstream
Browse files Browse the repository at this point in the history
chore: sync upstream
  • Loading branch information
tier4-autoware-public-bot[bot] authored Feb 8, 2022
2 parents 33549de + 59f0f77 commit 355609b
Show file tree
Hide file tree
Showing 131 changed files with 1,846 additions and 1,410 deletions.
33 changes: 33 additions & 0 deletions .github/sync-files.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
- repository: autowarefoundation/autoware
files:
- source: CODE_OF_CONDUCT.md
- source: CONTRIBUTING.md
- source: DISCLAIMER.md
- source: LICENSE
- source: .github/dependabot.yaml
- source: .github/workflows/pre-commit-optional.yaml
- source: .github/workflows/semantic-pull-request.yaml
- source: .github/workflows/spell-check-differential.yaml
- source: .clang-format
- source: .markdown-link-check.json
- source: .markdownlint.yaml
- source: .pre-commit-config-optional.yaml
- source: .prettierignore
- source: .prettierrc.yaml
- source: .yamllint.yaml
- source: CPPLINT.cfg
- 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/build-and-test-differential-self-hosted.yaml
- source: .github/workflows/build-and-test-self-hosted.yaml
- source: .github/workflows/check-build-depends.yaml
- source: .github/workflows/pre-commit.yaml

- repository: autowarefoundation/autoware-documentation
files:
- source: .github/workflows/deploy-docs.yaml
- source: .github/workflows/delete-closed-pr-docs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build-and-test-arm-pr
name: build-and-test-differential-self-hosted

on:
pull_request:
Expand All @@ -14,13 +14,13 @@ jobs:
with:
label: ARM64

build-and-test-arm:
build-and-test-differential-self-hosted:
needs: prevent-no-label-execution
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}
runs-on: [self-hosted, linux, ARM64]
container: ros:galactic
container: ghcr.io/autowarefoundation/autoware-universe:latest
steps:
- name: Checkout repository
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: build-and-test-pr
name: build-and-test-differential

on:
pull_request:

jobs:
build-and-test:
build-and-test-differential:
runs-on: ubuntu-latest
container: ros:galactic
container: ghcr.io/autowarefoundation/autoware-universe:latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1

- name: Checkout repository
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
Expand All @@ -36,12 +36,29 @@ jobs:
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
build-depends-repos: build_depends.repos

clang-tidy:
- name: Check the existence of coverage files
id: check-file-existence
uses: autowarefoundation/autoware-github-actions/check-file-existence@tier4/proposal
with:
files: |
lcov/total_coverage.info
coveragepy/.coverage
condition: or

- name: Upload coverage to CodeCov
if: ${{ steps.check-file-existence.outputs.exists == 'true' }}
uses: codecov/codecov-action@v2
with:
files: lcov/total_coverage.info,coveragepy/.coverage
fail_ci_if_error: false
verbose: true

clang-tidy-differential:
runs-on: ubuntu-latest
container: ros:galactic
needs: build-and-test
needs: build-and-test-differential
steps:
- name: Checkout repository
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
name: build-and-test-scheduled
name: build-and-test-self-hosted

on:
schedule:
- cron: 0 19 * * * # run at 4 AM JST
workflow_dispatch:

jobs:
build-and-test-scheduled:
runs-on: ${{ matrix.os }}
container: ros:galactic
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ARM64]
build-and-test-self-hosted:
runs-on: [self-hosted, linux, ARM64]
container: ghcr.io/autowarefoundation/autoware-universe:latest
steps:
- name: Checkout repository
- name: Check out repository
uses: actions/checkout@v2

- name: Remove exec_depend
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: build-and-test

on:
push:
schedule:
- cron: 0 19 * * * # run at 4 AM JST
workflow_dispatch:

jobs:
build-and-test:
if: ${{ github.event_name != 'push' || github.ref_name == github.event.repository.default_branch }}
runs-on: ubuntu-latest
container: ghcr.io/autowarefoundation/autoware-universe:latest
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Remove exec_depend
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@tier4/proposal

- name: Register AutonomouStuff repository
uses: autowarefoundation/autoware-github-actions/register-autonomoustuff-repository@tier4/proposal
with:
rosdistro: galactic

- name: Get self packages
id: get-self-packages
uses: autowarefoundation/autoware-github-actions/get-self-packages@tier4/proposal

- name: Build and test
uses: autowarefoundation/autoware-github-actions/colcon-build-and-test@tier4/proposal
with:
rosdistro: galactic
target-packages: ${{ steps.get-self-packages.outputs.self-packages }}
build-depends-repos: build_depends.repos

- name: Check the existence of coverage files
id: check-file-existence
uses: autowarefoundation/autoware-github-actions/check-file-existence@tier4/proposal
with:
files: |
lcov/total_coverage.info
coveragepy/.coverage
condition: or

- name: Upload coverage to CodeCov
if: ${{ steps.check-file-existence.outputs.exists == 'true' }}
uses: codecov/codecov-action@v2
with:
files: lcov/total_coverage.info,coveragepy/.coverage
fail_ci_if_error: false
verbose: true
4 changes: 2 additions & 2 deletions .github/workflows/check-build-depends.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
jobs:
check-build-depends:
runs-on: ubuntu-latest
container: ros:galactic
container: ghcr.io/autowarefoundation/autoware-universe:latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1

- name: Checkout repository
- name: Check out repository
uses: actions/checkout@v2

- name: Remove exec_depend
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delete-closed-pr-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
delete-closed-pr-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/pre-commit-optional.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: pre-commit-optional

on:
pull_request:

jobs:
pre-commit-optional:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Run pre-commit
uses: autowarefoundation/autoware-github-actions/pre-commit@tier4/proposal
with:
pre-commit-config: .pre-commit-config-optional.yaml
16 changes: 16 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: pre-commit

on:
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Run pre-commit
uses: autowarefoundation/autoware-github-actions/pre-commit@tier4/proposal
with:
pre-commit-config: .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: spell-check
name: spell-check-differential

on:
pull_request:

jobs:
spell-check:
spell-check-differential:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- name: Check out repository
uses: actions/checkout@v2

- name: Run spell-check
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/sync-files.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: sync-files

on:
schedule:
- cron: 0 19 * * * # run at 4 AM JST
workflow_dispatch:

jobs:
sync-files:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

- name: Run sync-files
uses: autowarefoundation/autoware-github-actions/sync-files@tier4/proposal
with:
token: ${{ steps.generate-token.outputs.token }}
6 changes: 5 additions & 1 deletion .markdown-link-check.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"aliveStatusCodes": [200, 206, 403],
"ignorePatterns": [],
"ignorePatterns": [
{
"pattern": "^http://localhost"
}
],
"retryOn429": true,
"retryCount": 10
}
6 changes: 6 additions & 0 deletions .pre-commit-config-optional.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/tcort/markdown-link-check
rev: v3.9.3
hooks:
- id: markdown-link-check
args: [--config=.markdown-link-check.json]
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: check-json
- id: check-merge-conflict
Expand All @@ -24,7 +24,7 @@ repos:
args: [-c, .markdownlint.yaml, --fix]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.0
rev: v2.5.1
hooks:
- id: prettier

Expand All @@ -40,12 +40,12 @@ repos:
- id: sort-package-xml

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.1
rev: v0.8.0.3
hooks:
- id: shellcheck

- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.4.1-1
rev: v3.4.2-1
hooks:
- id: shfmt
args: [-w, -s, -i=4]
Expand All @@ -56,7 +56,7 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 21.11b1
rev: 22.1.0
hooks:
- id: black
args: [--line-length=100]
Expand All @@ -78,7 +78,7 @@ repos:
]

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v12.0.1
rev: v13.0.0
hooks:
- id: clang-format

Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.param.yaml
*.rviz
3 changes: 3 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ ignore: |
*.param.yaml
rules:
braces:
level: error
max-spaces-inside: 1 # To format with Prettier
comments:
level: error
min-spaces-from-content: 1 # To be compatible with C++ and Python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,9 @@ GoalDistanceCalculatorNode::GoalDistanceCalculatorNode(const rclcpp::NodeOptions
self_pose_listener_.waitForFirstPose();

// Timer
double delta_time = 1.0 / static_cast<double>(node_param_.update_rate);
auto timer_callback_ = std::bind(&GoalDistanceCalculatorNode::onTimer, this);
const auto period_ns =
std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::duration<double>(delta_time));
timer_ = std::make_shared<rclcpp::GenericTimer<decltype(timer_callback_)>>(
this->get_clock(), period_ns, std::move(timer_callback_),
this->get_node_base_interface()->get_context());
this->get_node_timers_interface()->add_timer(timer_, nullptr);
const auto period_ns = rclcpp::Rate(node_param_.update_rate).period();
timer_ = rclcpp::create_timer(
this, get_clock(), period_ns, std::bind(&GoalDistanceCalculatorNode::onTimer, this));
goal_distance_calculator_ = std::make_unique<GoalDistanceCalculator>();
}

Expand Down
Loading

0 comments on commit 355609b

Please sign in to comment.