Skip to content

Commit

Permalink
Merge pull request autowarefoundation#424 from tier4/sync-main-for-de…
Browse files Browse the repository at this point in the history
…velop

sync main for develop
  • Loading branch information
tier4-autoware-private-bot[bot] authored Sep 29, 2021
2 parents 5e8652f + 794813b commit 5853dff
Show file tree
Hide file tree
Showing 10 changed files with 163 additions and 133 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/spell_check_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
--output .github/workflows/.cspell.json \
https://raw.githubusercontent.com/tier4/autoware-spell-check-dict/main/cspell/.cspell.json
- uses: streetsidesoftware/cspell-action@v1.3.1
- uses: streetsidesoftware/cspell-action@v1.3.2
with:
config: ".github/workflows/.cspell.json"
90 changes: 0 additions & 90 deletions .github/workflows/sync-rc-develop.yml

This file was deleted.

38 changes: 30 additions & 8 deletions .github/workflows/sync-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ on:
description: "Target RC branch(e.g. rc/v1.0.0)"
required: true

env:
BASE_BRANCH: main

jobs:
sync-rc:
runs-on: ubuntu-20.04
Expand All @@ -23,7 +20,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ env.BASE_BRANCH }}
fetch-depth: 0

- name: Generate token
Expand All @@ -48,6 +44,31 @@ jobs:
echo ${SYNC_TARGET_BRANCH} | grep -e "^rc/v.*"
echo "SYNC_BRANCH=sync-rc/${SYNC_TARGET_BRANCH#refs/heads/}" >> $GITHUB_ENV
- name: Judge BASE_BRANCH
run: |
function is_main_base() {
target_branch="$1"
main_base=$(git merge-base "${target_branch}" origin/main)
develop_base=$(git merge-base "${target_branch}" origin/develop)
return $(test "${main_base}" = "${develop_base}")
}
if is_main_base "origin/${{ env.SYNC_TARGET_BRANCH }}"; then
base_branch=main
else
base_branch=develop
fi
echo "BASE_BRANCH=${base_branch}" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ env.BASE_BRANCH }}
fetch-depth: 0

# To keep the base branch in "create-pull-request", checkout with "BASE_BRANCH" and reset to "SYNC_TARGET_BRANCH"
- name: Reset to sync target branch
run: |
Expand All @@ -60,8 +81,9 @@ jobs:
- name: Rebase on the base branch
run: |
for commit in $(git rev-list --left-only origin/${{ env.BASE_BRANCH }}...HEAD | tac); do
git rebase $commit || git rebase --abort
for commit in $(git rev-list --left-only "origin/${{ env.BASE_BRANCH }}"...HEAD | tac); do
merge_base=$(git merge-base HEAD "origin/${{ env.BASE_BRANCH }}")
git rebase --onto "$commit" "$merge_base" "${{ env.BASE_BRANCH }}" || git rebase --abort
done
- name: Create PR
Expand All @@ -76,9 +98,9 @@ jobs:
base: ${{ env.BASE_BRANCH }}
branch: ${{ env.SYNC_BRANCH }}
delete-branch: true
title: sync rc
title: sync rc ${{ env.SYNC_TARGET_BRANCH }}
body: |
sync rc
sync rc ${{ env.SYNC_TARGET_BRANCH }}
labels: |
sync-rc
draft: false
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/update-pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Update pre-commit

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

jobs:
update-pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Generate token
uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit autoupdate
run: pre-commit autoupdate

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ steps.generate-token.outputs.token }}
base: main
branch: update/pre-commit-autoupdate
title: Auto-update pre-commit hooks
commit-message: Auto-update pre-commit hooks
body: |
Update versions of tools in pre-commit configs to latest version
labels: dependencies
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ repos:
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.27.1
rev: v0.28.1
hooks:
- id: markdownlint
args: ["-c", ".markdownlint.yaml", "--fix"]

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

- repo: https://github.com/tier4/pre-commit-hooks-ros
rev: v0.1.2
rev: v0.2.0
hooks:
- id: prettier-xml
- id: prettier-package-xml
- id: sort-package-xml

- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.12
rev: v0.1.15
hooks:
- id: shellcheck

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**:
ros__parameters:
input_frame: "base_link"
output_frame: "base_link"
min_x: -60.0
max_x: 60.0
min_y: -60.0
max_y: 60.0
min_z: -30.0
max_z: 50.0
negative: False
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**:
ros__parameters:
sample_num: 1500
5 changes: 5 additions & 0 deletions localization_launch/config/voxel_grid_filter.param.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**:
ros__parameters:
voxel_size_x: 3.0
voxel_size_y: 3.0
voxel_size_z: 3.0
92 changes: 66 additions & 26 deletions localization_launch/launch/util/util.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ def load_composable_node_param(param_path):
('output',
LaunchConfiguration('output_measurement_range_sensor_points_topic')),
],
parameters=[{
'input_frame': LaunchConfiguration('base_frame'),
'output_frame': LaunchConfiguration('base_frame'),
},
parameters=[
load_composable_node_param('crop_box_filter_measurement_range_param_path'),
],
extra_arguments=[{
Expand Down Expand Up @@ -73,9 +70,9 @@ def load_composable_node_param(param_path):
('output',
LaunchConfiguration('output_downsample_sensor_points_topic')),
],
parameters=[{
'sample_num': 1500,
}],
parameters=[
load_composable_node_param('random_downsample_filter_param_path')
],
extra_arguments=[{
'use_intra_process_comms': LaunchConfiguration('use_intra_process')
}],
Expand All @@ -95,23 +92,66 @@ def load_composable_node_param(param_path):


def generate_launch_description():
def add_launch_arg(name: str, default_value=None):
return DeclareLaunchArgument(name, default_value=default_value)
launch_arguments = []

def add_launch_arg(name: str, default_value=None, description=None):
arg = DeclareLaunchArgument(name, default_value=default_value, description=description)
launch_arguments.append(arg)

add_launch_arg(
'crop_box_filter_measurement_range_param_path',
[
FindPackageShare('localization_launch'),
'/config/crop_box_filter_measurement_range.param.yaml'
],
'path to the parameter file of crop_box_filter_measurement_range'
)
add_launch_arg(
'voxel_grid_downsample_filter_param_path',
[
FindPackageShare('localization_launch'),
'/config/voxel_grid_filter.param.yaml'
],
'path to the parameter file of voxel_grid_downsample_filter'
)
add_launch_arg(
'random_downsample_filter_param_path',
[
FindPackageShare('localization_launch'),
'/config/random_downsample_filter.param.yaml'
],
'path to the parameter file of random_downsample_filter'
)
add_launch_arg('use_intra_process', 'true', 'use ROS2 component container communication')
add_launch_arg(
'container',
'/sensing/lidar/top/pointcloud_preprocessor/velodyne_node_container',
'container name'
)
add_launch_arg(
'input_sensor_points_topic',
'/sensing/lidar/top/rectified/pointcloud',
'input topic name for raw pointcloud'
)
add_launch_arg(
'output_measurement_range_sensor_points_topic',
'measurement_range/pointcloud',
'output topic name for crop box filter'
)
add_launch_arg(
'output_voxel_grid_downsample_sensor_points_topic',
'voxel_grid_downsample/pointcloud',
'output topic name for voxel grid downsample filter'
)
add_launch_arg(
'output_downsample_sensor_points_topic',
'downsample/pointcloud',
'output topic name for downsample filter. this is final output'
)

return launch.LaunchDescription([
add_launch_arg('crop_box_filter_measurement_range_param_path',
[
FindPackageShare('localization_launch'),
'/config/',
LaunchConfiguration('environment_name'),
'/crop_box_filter_measurement_range.param.yaml'
]),
add_launch_arg('voxel_grid_downsample_filter_param_path',
[
FindPackageShare('localization_launch'),
'/config/',
LaunchConfiguration('environment_name'),
'/voxel_grid_filter.param.yaml'
]),
OpaqueFunction(function=launch_setup),
])
return launch.LaunchDescription(
launch_arguments +
[
OpaqueFunction(function=launch_setup)
]
)
3 changes: 0 additions & 3 deletions localization_launch/launch/util/util.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
<arg name="output_voxel_grid_downsample_sensor_points_topic" default="voxel_grid_downsample/pointcloud" description="output topic name for voxel grid downsample filter"/>
<arg name="output_downsample_sensor_points_topic" default="downsample/pointcloud" description="output topic name for downsample filter. this is final output"/>

<!-- frame_ids -->
<arg name="base_frame" default="base_link" description="Vehicle reference frame, for processing crop_box" />

<!-- container -->
<arg name="container" default="/sensing/lidar/top/pointcloud_preprocessor/velodyne_node_container" description="container name"/>

Expand Down

0 comments on commit 5853dff

Please sign in to comment.