Skip to content

Commit

Permalink
Merge pull request tier4#23 from tier4/sync-upstream
Browse files Browse the repository at this point in the history
sync upstream
  • Loading branch information
tier4-autoware-private-bot[bot] authored Sep 14, 2021
2 parents 4c8f5e3 + 3602134 commit e3bbdf9
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 69 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/sync-rc-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: sync rc develop

on:
pull_request:
branches:
- "rc/*"
types:
- closed
workflow_dispatch:
inputs:
rc_branch:
description: "Target RC branch(e.g. rc/v1.0.0)"
required: true

env:
BASE_BRANCH: develop

jobs:
sync-rc:
runs-on: ubuntu-20.04

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ env.BASE_BRANCH }}
fetch-depth: 0

- 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: Set SYNC_TARGET_BRANCH for pull_request event
if: github.event_name == 'pull_request'
run: |
echo "SYNC_TARGET_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV
- name: Set SYNC_TARGET_BRANCH for workflow_dispatch event
if: github.event_name == 'workflow_dispatch'
run: |
echo "SYNC_TARGET_BRANCH=${{ github.event.inputs.rc_branch }}" >> $GITHUB_ENV
- name: Set SYNC_BRANCH
run: |
echo ${SYNC_TARGET_BRANCH} | grep -e "^rc/v.*"
echo "SYNC_BRANCH=sync-rc/${SYNC_TARGET_BRANCH#refs/heads/}" >> $GITHUB_ENV
# 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: |
git reset --hard origin/${{ env.SYNC_TARGET_BRANCH }}
- name: Set git config
run: |
git config --local user.email "actions@example.com"
git config --local user.name "Github Actions"
- 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
done
- name: Create PR
id: create_pr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ steps.generate-token.outputs.token }}
commit-message: sync rc develop
committer: GitHub <noreply@github.com>
author: GitHub <noreply@github.com>
signoff: false
base: ${{ env.BASE_BRANCH }}
branch: ${{ env.SYNC_BRANCH }}
delete-branch: true
title: sync rc develop
body: |
sync rc develop
labels: |
sync-rc-develop
draft: false

- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.create_pr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.create_pr.outputs.pull-request-url }}"
- name: Enable Auto-merge
if: steps.create_pr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v1
with:
token: ${{ steps.generate-token.outputs.token }}
pull-request-number: ${{ steps.create_pr.outputs.pull-request-number }}
merge-method: squash
33 changes: 29 additions & 4 deletions .github/workflows/sync-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ on:
types:
- closed
workflow_dispatch:
inputs:
rc_branch:
description: "Target RC branch(e.g. rc/v1.0.0)"
required: true

env:
BASE_BRANCH: main
SYNC_BRANCH: sync-rc

jobs:
sync-rc:
Expand All @@ -30,15 +33,37 @@ jobs:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Set SYNC_TARGET_BRANCH
- name: Set SYNC_TARGET_BRANCH for pull_request event
if: github.event_name == 'pull_request'
run: |
echo "SYNC_TARGET_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
echo "SYNC_TARGET_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV
- name: Set SYNC_TARGET_BRANCH for workflow_dispatch event
if: github.event_name == 'workflow_dispatch'
run: |
echo "SYNC_TARGET_BRANCH=${{ github.event.inputs.rc_branch }}" >> $GITHUB_ENV
- name: Set SYNC_BRANCH
run: |
echo ${SYNC_TARGET_BRANCH} | grep -e "^rc/v.*"
echo "SYNC_BRANCH=sync-rc/${SYNC_TARGET_BRANCH#refs/heads/}" >> $GITHUB_ENV
# 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: |
git reset --hard origin/${{ env.SYNC_TARGET_BRANCH }}
- name: Set git config
run: |
git config --local user.email "actions@example.com"
git config --local user.name "Github Actions"
- 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
done
- name: Create PR
id: create_pr
uses: peter-evans/create-pull-request@v3
Expand Down Expand Up @@ -69,4 +94,4 @@ jobs:
with:
token: ${{ steps.generate-token.outputs.token }}
pull-request-number: ${{ steps.create_pr.outputs.pull-request-number }}
merge-method: merge
merge-method: squash
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<param name="type" value="autoware_api_msgs/msg/CrosswalkStatus"/>
</node>
<!-- TODO(Takagi, Isamu): workaround for topic check -->
<node pkg="topic_tools" exec="relay" name="initialpose">
<node pkg="topic_tools" exec="relay" name="initial_pose_2d">
<param name="input_topic" value="/initialpose"/>
<param name="output_topic" value="/initialpose2d"/>
<param name="type" value="geometry_msgs/msg/PoseWithCovarianceStamped"/>
Expand Down
18 changes: 10 additions & 8 deletions autoware_launch/rviz/autoware.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ Visualization Manager:
Channel Name: intensity
Class: rviz_default_plugins/PointCloud2
Color: 255; 255; 255
Color Transformer: Intensity
Color Transformer: FlatColor
Decay Time: 0
Enabled: true
Invert Rainbow: false
Expand All @@ -344,7 +344,7 @@ Visualization Manager:
Selectable: true
Size (Pixels): 1
Size (m): 0.02
Style: Squares
Style: Points
Topic:
Depth: 5
Durability Policy: Transient Local
Expand All @@ -365,11 +365,13 @@ Visualization Manager:
left_lane_bound: true
parking_lots: true
parking_space: true
pedestrian_marking: true
right_lane_bound: true
road_lanelets: false
stop_lines: true
traffic_light: true
traffic_light_triangle: true
walkway_lanelets: true
Topic:
Depth: 5
Durability Policy: Transient Local
Expand All @@ -383,7 +385,7 @@ Visualization Manager:
Displays:
- Class: rviz_common/Group
Displays:
- Alpha: 0.999
- Alpha: 0.4
Autocompute Intensity Bounds: true
Autocompute Value Bounds:
Max Value: 5
Expand All @@ -404,9 +406,9 @@ Visualization Manager:
Name: ConcatenatePointCloud
Position Transformer: XYZ
Selectable: true
Size (Pixels): 2
Size (Pixels): 1
Size (m): 0.02
Style: Squares
Style: Points
Topic:
Depth: 5
Durability Policy: Volatile
Expand All @@ -425,7 +427,7 @@ Visualization Manager:
Axis: Z
Channel Name: z
Class: rviz_default_plugins/PointCloud2
Color: 255; 255; 255
Color: 200; 200; 200
Color Transformer: FlatColor
Decay Time: 0
Enabled: true
Expand All @@ -437,9 +439,9 @@ Visualization Manager:
Name: NoGroundPointCloud
Position Transformer: XYZ
Selectable: true
Size (Pixels): 5
Size (Pixels): 3
Size (m): 0.02
Style: Squares
Style: Points
Topic:
Depth: 5
Durability Policy: Volatile
Expand Down
64 changes: 11 additions & 53 deletions control_launch/launch/control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ def launch_setup(context, *args, **kwargs):
plugin='VehicleCmdGate',
name='vehicle_cmd_gate',
remappings=[
('input/system_emergency', '/system/emergency/is_emergency'),
('input/emergency', '/system/emergency/is_emergency'),
('input/emergency_state', '/system/emergency/emergency_state'),
('input/steering', '/vehicle/status/steering'),

('input/auto/control_cmd', 'trajectory_follower/control_cmd'),
Expand All @@ -185,7 +184,7 @@ def launch_setup(context, *args, **kwargs):
('input/external/control_cmd', '/external/selected/control_cmd'),
('input/external/turn_signal_cmd', '/external/selected/turn_signal_cmd'),
('input/external/shift_cmd', '/external/selected/shift_cmd'),
('input/external_emergency_stop', '/external/selected/heartbeat'),
('input/external_emergency_stop_heartbeat', '/external/selected/heartbeat'),
('input/gate_mode', '/control/gate_mode_cmd'),

('input/emergency/control_cmd', '/system/emergency/control_cmd'),
Expand Down Expand Up @@ -233,33 +232,14 @@ def launch_setup(context, *args, **kwargs):
)

# external cmd converter
external_cmd_converter_component = ComposableNode(
package='external_cmd_converter',
plugin='external_cmd_converter::ExternalCmdConverterNode',
name='external_cmd_converter',
remappings=[
('in/external_control_cmd', '/external/selected/external_control_cmd'),
('in/shift_cmd', '/external/selected/shift_cmd'),
('in/emergency_stop', '/remote/emergency_stop'),
('in/current_gate_mode', '/control/current_gate_mode'),
('in/twist', '/localization/twist'),
('out/control_cmd', '/external/selected/control_cmd'),
('out/latest_external_control_cmd', '/external/selected/latest_external_control_cmd'),
],
parameters=[
{
'csv_path_accel_map': LaunchConfiguration('csv_path_accel_map'),
'csv_path_brake_map': LaunchConfiguration('csv_path_brake_map'),

'ref_vel_gain': LaunchConfiguration('ref_vel_gain'),
'wait_for_first_topic': LaunchConfiguration('wait_for_first_topic'),
'control_command_timeout': LaunchConfiguration('control_command_timeout'),
'emergency_stop_timeout': LaunchConfiguration('emergency_stop_timeout'),
}
external_cmd_converter_loader = IncludeLaunchDescription(
PythonLaunchDescriptionSource([
FindPackageShare('external_cmd_converter'), '/launch/external_cmd_converter.launch.py'
]),
launch_arguments=[
('use_intra_process', LaunchConfiguration('use_intra_process')),
('target_container', '/control/control_container'),
],
extra_arguments=[{
'use_intra_process_comms': LaunchConfiguration('use_intra_process')
}],
)

# set container to run all required components in the same process
Expand All @@ -274,7 +254,6 @@ def launch_setup(context, *args, **kwargs):
lane_departure_component,
shift_decider_component,
vehicle_cmd_gate_component,
external_cmd_converter_component,
],
)

Expand All @@ -298,6 +277,7 @@ def launch_setup(context, *args, **kwargs):
PushRosNamespace('control'),
container,
external_cmd_selector_loader,
external_cmd_converter_loader,
mpc_follower_loader,
pure_pursuit_loader
])
Expand Down Expand Up @@ -368,29 +348,7 @@ def add_launch_arg(name: str, default_value=None, description=None):
# external cmd selector
add_launch_arg('initial_selector_mode', 'remote', 'local or remote')

# remote cmd converter
add_launch_arg(
'csv_path_accel_map',
[
FindPackageShare('raw_vehicle_cmd_converter'),
'/data/default/accel_map.csv'
],
'csv file path for accel map'
)
add_launch_arg(
'csv_path_brake_map',
[
FindPackageShare('raw_vehicle_cmd_converter'),
'/data/default/brake_map.csv'
],
'csv file path for brake map'
)
add_launch_arg('ref_vel_gain', '3.0', 'gain for remote command accel')
add_launch_arg('wait_for_first_topic', 'true',
'disable topic disruption detection until subscribing first topics')
add_launch_arg('control_command_timeout', '1.0', 'remote control command timeout')
add_launch_arg('emergency_stop_timeout', '3.0', 'emergency stop timeout for remote heartbeat')

# component
add_launch_arg('use_intra_process', 'false', 'use ROS2 component container communication')
add_launch_arg('use_multithread', 'false', 'use multithread')
set_container_executable = SetLaunchConfiguration(
Expand Down
3 changes: 0 additions & 3 deletions control_launch/launch/control.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@

<!-- external_cmd_converter -->
<include file="$(find-pkg-share external_cmd_converter)/launch/external_cmd_converter.launch.xml">
<arg name="in/external_control_cmd" value="/external/selected/external_control_cmd" />
<arg name="in/shift_cmd" value="/external/selected/shift_cmd" />
<arg name="out/control_cmd" value="/external/selected/control_cmd" />
</include>
</group>
</launch>

0 comments on commit e3bbdf9

Please sign in to comment.