Skip to content

Commit 574e55f

Browse files
author
suchang
committed
Merge branch 'universe2core/autoware_motion_velocity_planner_node' of github.com:storrrrrrrrm/autoware.universe into universe2core/autoware_motion_velocity_planner_node
2 parents f8407fc + 00b742a commit 574e55f

File tree

122 files changed

+4781
-7896
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+4781
-7896
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: build-and-test-packages-above-differential
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
container:
7+
required: true
8+
type: string
9+
runner:
10+
default: ubuntu-24.04
11+
required: false
12+
type: string
13+
rosdistro:
14+
default: humble
15+
required: false
16+
type: string
17+
run-condition:
18+
default: true
19+
required: false
20+
type: boolean
21+
container-suffix:
22+
required: false
23+
default: ""
24+
type: string
25+
build-pre-command:
26+
required: false
27+
default: ""
28+
type: string
29+
secrets:
30+
codecov-token:
31+
required: true
32+
33+
env:
34+
CC: /usr/lib/ccache/gcc
35+
CXX: /usr/lib/ccache/g++
36+
37+
jobs:
38+
build-and-test-packages-above-differential:
39+
if: ${{ inputs.run-condition }}
40+
runs-on: ${{ inputs.runner }}
41+
container: ${{ inputs.container }}${{ inputs.container-suffix }}
42+
steps:
43+
- name: Set PR fetch depth
44+
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
45+
shell: bash
46+
47+
- name: Checkout PR branch and all PR commits
48+
uses: actions/checkout@v4
49+
with:
50+
ref: ${{ github.event.pull_request.head.sha }}
51+
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
52+
53+
- name: Show disk space before the tasks
54+
run: df -h
55+
shell: bash
56+
57+
- name: Show machine specs
58+
run: lscpu && free -h
59+
shell: bash
60+
61+
- name: Remove exec_depend
62+
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
63+
64+
- name: Get modified packages
65+
id: get-modified-packages
66+
uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1
67+
68+
- name: Create ccache directory
69+
run: |
70+
mkdir -p ${CCACHE_DIR}
71+
du -sh ${CCACHE_DIR} && ccache -s
72+
shell: bash
73+
74+
- name: Attempt to restore ccache
75+
uses: actions/cache/restore@v4
76+
with:
77+
path: |
78+
/root/.ccache
79+
key: ccache-main-${{ runner.arch }}-${{ inputs.rosdistro }}-${{ github.event.pull_request.base.sha }}
80+
restore-keys: |
81+
ccache-main-${{ runner.arch }}-${{ inputs.rosdistro }}-
82+
83+
- name: Show ccache stats before build and reset stats
84+
run: |
85+
du -sh ${CCACHE_DIR} && ccache -s
86+
ccache --zero-stats
87+
shell: bash
88+
89+
- name: Export CUDA state as a variable for adding to cache key
90+
run: |
91+
build_type_cuda_state=nocuda
92+
if [[ "${{ inputs.container-suffix }}" == "-cuda" ]]; then
93+
build_type_cuda_state=cuda
94+
fi
95+
echo "BUILD_TYPE_CUDA_STATE=$build_type_cuda_state" >> "${GITHUB_ENV}"
96+
echo "::notice::BUILD_TYPE_CUDA_STATE=$build_type_cuda_state"
97+
shell: bash
98+
99+
- name: Prepare build_depends.repos file (main branch)
100+
if: ${{ github.event.pull_request.base.ref == 'main' }}
101+
uses: ./.github/actions/combine-repos-action
102+
with:
103+
base_file: build_depends_humble.repos
104+
overlay_file: build_depends_nightly.repos
105+
output_file: build_depends.repos
106+
107+
- name: Prepare build_depends.repos file (humble branch)
108+
if: ${{ github.event.pull_request.base.ref == 'humble' }}
109+
run: cp build_depends_humble.repos build_depends.repos
110+
shell: bash
111+
112+
- name: Build
113+
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
114+
uses: autowarefoundation/autoware-github-actions/colcon-build@v1
115+
with:
116+
rosdistro: ${{ inputs.rosdistro }}
117+
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
118+
build-depends-repos: build_depends.repos
119+
packages-above-repos: packages_above.repos
120+
cache-key-element: ${{ env.BUILD_TYPE_CUDA_STATE }}
121+
build-pre-command: ${{ inputs.build-pre-command }}
122+
123+
- name: Show ccache stats after build
124+
run: du -sh ${CCACHE_DIR} && ccache -s
125+
shell: bash
126+
127+
- name: Test
128+
id: test
129+
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
130+
uses: autowarefoundation/autoware-github-actions/colcon-test@v1
131+
with:
132+
rosdistro: ${{ inputs.rosdistro }}
133+
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
134+
build-depends-repos: build_depends.repos
135+
packages-above-repos: packages_above.repos
136+
137+
- name: Upload coverage to CodeCov
138+
if: ${{ steps.test.outputs.coverage-report-files != '' }}
139+
uses: codecov/codecov-action@v4
140+
with:
141+
files: ${{ steps.test.outputs.coverage-report-files }}
142+
fail_ci_if_error: false
143+
verbose: true
144+
flags: differential${{ inputs.container-suffix }}
145+
token: ${{ secrets.codecov-token }}
146+
147+
- name: Show disk space after the tasks
148+
run: df -h
149+
shell: bash

.github/workflows/build-test-tidy-pr.yaml

+12-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
- name: Check if relevant files changed
3030
id: check
31-
uses: tj-actions/changed-files@v45
31+
uses: step-security/changed-files@v45
3232
with:
3333
files: |
3434
perception/**
@@ -50,6 +50,17 @@ jobs:
5050
secrets:
5151
codecov-token: ${{ secrets.CODECOV_TOKEN }}
5252

53+
build-and-test-packages-above-differential:
54+
if: ${{ always() }}
55+
needs:
56+
- require-label
57+
uses: ./.github/workflows/build-and-test-packages-above-differential.yaml
58+
with:
59+
container: ghcr.io/autowarefoundation/autoware:universe-devel
60+
run-condition: ${{ needs.require-label.outputs.result == 'true' }}
61+
secrets:
62+
codecov-token: ${{ secrets.CODECOV_TOKEN }}
63+
5364
build-and-test-differential-cuda:
5465
if: ${{ always() }}
5566
needs: check-if-cuda-job-is-needed

common/autoware_universe_utils/src/geometry/alt_geometry.cpp

+34-30
Original file line numberDiff line numberDiff line change
@@ -263,28 +263,30 @@ bool covered_by(const alt::Point2d & point, const alt::ConvexPolygon2d & poly)
263263
return false;
264264
}
265265

266-
double cross;
267266
for (auto it = vertices.cbegin(); it != std::prev(vertices.cend()); ++it) {
268267
const auto & p1 = *it;
269268
const auto & p2 = *std::next(it);
270269

271-
if (p1.y() <= point.y() && p2.y() >= point.y()) { // upward edge
272-
cross = (p2 - p1).cross(point - p1);
273-
if (cross > 0) { // point is to the left of edge
274-
winding_number++;
275-
continue;
276-
}
277-
} else if (p1.y() >= point.y() && p2.y() <= point.y()) { // downward edge
278-
cross = (p2 - p1).cross(point - p1);
279-
if (cross < 0) { // point is to the left of edge
280-
winding_number--;
281-
continue;
282-
}
283-
} else {
270+
const auto is_upward_edge = p1.y() <= point.y() && p2.y() >= point.y();
271+
const auto is_downward_edge = p1.y() >= point.y() && p2.y() <= point.y();
272+
273+
if (!is_upward_edge && !is_downward_edge) {
274+
continue;
275+
}
276+
277+
const auto start_vec = point - p1;
278+
const auto end_vec = point - p2;
279+
const auto cross = start_vec.cross(end_vec);
280+
281+
if (is_upward_edge && cross > 0) { // point is to the left of edge
282+
winding_number++;
283+
continue;
284+
} else if (is_downward_edge && cross < 0) { // point is to the left of edge
285+
winding_number--;
284286
continue;
285287
}
286288

287-
if (std::abs(cross) < epsilon) { // point is on edge
289+
if (std::abs(cross) < epsilon && start_vec.dot(end_vec) <= 0.) { // point is on edge
288290
return true;
289291
}
290292
}
@@ -600,28 +602,30 @@ bool within(const alt::Point2d & point, const alt::ConvexPolygon2d & poly)
600602
return false;
601603
}
602604

603-
double cross;
604605
for (auto it = vertices.cbegin(); it != std::prev(vertices.cend()); ++it) {
605606
const auto & p1 = *it;
606607
const auto & p2 = *std::next(it);
607608

608-
if (p1.y() < point.y() && p2.y() > point.y()) { // upward edge
609-
cross = (p2 - p1).cross(point - p1);
610-
if (cross > 0) { // point is to the left of edge
611-
winding_number++;
612-
continue;
613-
}
614-
} else if (p1.y() > point.y() && p2.y() < point.y()) { // downward edge
615-
cross = (p2 - p1).cross(point - p1);
616-
if (cross < 0) { // point is to the left of edge
617-
winding_number--;
618-
continue;
619-
}
620-
} else {
609+
const auto is_upward_edge = p1.y() < point.y() && p2.y() > point.y();
610+
const auto is_downward_edge = p1.y() > point.y() && p2.y() < point.y();
611+
612+
if (!is_upward_edge && !is_downward_edge) {
613+
continue;
614+
}
615+
616+
const auto start_vec = point - p1;
617+
const auto end_vec = point - p2;
618+
const auto cross = start_vec.cross(end_vec);
619+
620+
if (is_upward_edge && cross > 0) { // point is to the left of edge
621+
winding_number++;
622+
continue;
623+
} else if (is_downward_edge && cross < 0) { // point is to the left of edge
624+
winding_number--;
621625
continue;
622626
}
623627

624-
if (std::abs(cross) < epsilon) { // point is on edge
628+
if (std::abs(cross) < epsilon && start_vec.dot(end_vec) <= 0.) { // point is on edge
625629
return false;
626630
}
627631
}

common/autoware_universe_utils/test/src/geometry/test_alt_geometry.cpp

+22
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,17 @@ TEST(alt_geometry, coveredBy)
164164

165165
EXPECT_TRUE(result);
166166
}
167+
168+
{ // The point is on the extended line of an edge of the polygon
169+
const Point2d point = {0.0, 0.0};
170+
const Point2d p1 = {3.0, 0.0};
171+
const Point2d p2 = {3.0, 1.0};
172+
const Point2d p3 = {4.0, 1.0};
173+
const Point2d p4 = {4.0, 0.0};
174+
const auto result = covered_by(point, ConvexPolygon2d::create({p1, p2, p3, p4}).value());
175+
176+
EXPECT_FALSE(result);
177+
}
167178
}
168179

169180
TEST(alt_geometry, disjoint)
@@ -674,6 +685,17 @@ TEST(alt_geometry, within)
674685
EXPECT_FALSE(result);
675686
}
676687

688+
{ // The point is on the extended line of an edge of the polygon
689+
const Point2d point = {0.0, 0.0};
690+
const Point2d p1 = {3.0, 0.0};
691+
const Point2d p2 = {3.0, 1.0};
692+
const Point2d p3 = {4.0, 1.0};
693+
const Point2d p4 = {4.0, 0.0};
694+
const auto result = within(point, ConvexPolygon2d::create({p1, p2, p3, p4}).value());
695+
696+
EXPECT_FALSE(result);
697+
}
698+
677699
{ // One polygon is within the other
678700
const Point2d p1 = {1.0, 1.0};
679701
const Point2d p2 = {1.0, -1.0};

localization/autoware_ndt_scan_matcher/src/ndt_omp/multi_voxel_grid_covariance_omp_impl.hpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,7 @@ void pclomp::MultiVoxelGridCovariance<PointT>::computeLeafParams(
434434
Leaf & leaf) const
435435
{
436436
// Single pass covariance calculation
437-
leaf.cov_ = (leaf.cov_ - 2 * (pt_sum * leaf.mean_.transpose())) / leaf.nr_points_ +
438-
leaf.mean_ * leaf.mean_.transpose();
439-
leaf.cov_ *= (leaf.nr_points_ - 1.0) / leaf.nr_points_;
437+
leaf.cov_ = (leaf.cov_ - pt_sum * leaf.mean_.transpose()) / (leaf.nr_points_ - 1);
440438

441439
// Normalize Eigen Val such that max no more than 100x min.
442440
eigensolver.compute(leaf.cov_);

map/autoware_map_loader/launch/lanelet2_map_loader.launch.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<param from="$(var lanelet2_map_loader_param_path)" allow_substs="true"/>
99
</node>
1010

11-
<node pkg="autoware_map_loader" exec="lanelet2_map_loader" name="lanelet2_map_loader" output="both">
11+
<node pkg="autoware_map_loader" exec="autoware_lanelet2_map_loader" name="lanelet2_map_loader" output="both">
1212
<remap from="output/lanelet2_map" to="$(var lanelet2_map_topic)"/>
1313
<param from="$(var lanelet2_map_loader_param_path)" allow_substs="true"/>
1414
</node>

mkdocs_macros.py

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import urllib
23

34
from tabulate import tabulate
45

@@ -70,3 +71,8 @@ def json_to_markdown(json_schema_file_path):
7071
with open(json_schema_file_path) as f:
7172
data = json.load(f)
7273
return format_json(data)
74+
75+
@env.macro
76+
def drawio(image_path):
77+
image_url = urllib.parse.quote(f"{env.conf['site_url']}{image_path}", "")
78+
return f"https://app.diagrams.net/?lightbox=1#U{image_url}"

packages_above.repos

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repositories:
2+
tools/autoware_tools:
3+
type: git
4+
url: https://github.com/autowarefoundation/autoware_tools.git
5+
version: main

perception/autoware_image_projection_based_fusion/launch/segmentation_pointcloud_fusion.launch.xml

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
<arg name="input/mask0" default="/perception/object_recognition/detection/mask0"/>
44
<arg name="input/camera_info0" default="/sensing/camera/camera0/camera_info"/>
55
<arg name="input/mask1" default="/perception/object_recognition/detection/mask1"/>
6-
<arg name="input/camera_info1" default="/sensing/camera/camera0/camera_info"/>
6+
<arg name="input/camera_info1" default="/sensing/camera/camera1/camera_info"/>
77
<arg name="input/mask2" default="/perception/object_recognition/detection/mask2"/>
8-
<arg name="input/camera_info2" default="/sensing/camera/camera0/camera_info"/>
8+
<arg name="input/camera_info2" default="/sensing/camera/camera2/camera_info"/>
99
<arg name="input/mask3" default="/perception/object_recognition/detection/mask3"/>
10-
<arg name="input/camera_info3" default="/sensing/camera/camera0/camera_info"/>
10+
<arg name="input/camera_info3" default="/sensing/camera/camera3/camera_info"/>
1111
<arg name="input/mask4" default="/perception/object_recognition/detection/mask4"/>
12-
<arg name="input/camera_info4" default="/sensing/camera/camera0/camera_info"/>
12+
<arg name="input/camera_info4" default="/sensing/camera/camera4/camera_info"/>
1313
<arg name="input/mask5" default="/perception/object_recognition/detection/mask5"/>
14-
<arg name="input/camera_info5" default="/sensing/camera/camera0/camera_info"/>
14+
<arg name="input/camera_info5" default="/sensing/camera/camera5/camera_info"/>
1515
<arg name="input/mask6" default="/perception/object_recognition/detection/mask6"/>
16-
<arg name="input/camera_info6" default="/sensing/camera/camera0/camera_info"/>
16+
<arg name="input/camera_info6" default="/sensing/camera/camera6/camera_info"/>
1717
<arg name="input/mask7" default="/perception/object_recognition/detection/mask7"/>
18-
<arg name="input/camera_info7" default="/sensing/camera/camera0/camera_info"/>
18+
<arg name="input/camera_info7" default="/sensing/camera/camera7/camera_info"/>
1919
<arg name="input/pointcloud" default="/sensing/lidar/top/outlier_filtered/pointcloud"/>
2020
<arg name="output/pointcloud" default="output/pointcloud"/>
2121
<arg name="sync_param_path" default="$(find-pkg-share autoware_image_projection_based_fusion)/config/fusion_common.param.yaml"/>

0 commit comments

Comments
 (0)