Skip to content

Commit ee1a443

Browse files
authored
Merge branch 'main' into clang-tidy-b66
2 parents e703a18 + a32cae1 commit ee1a443

File tree

23 files changed

+170
-249
lines changed

23 files changed

+170
-249
lines changed

.github/actions/evaluate-job-result/action.yaml

-45
This file was deleted.

.github/workflows/build-and-test-differential.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ on:
1414
default: humble
1515
required: false
1616
type: string
17+
run-condition:
18+
default: true
19+
required: false
20+
type: boolean
1721
container-suffix:
1822
required: false
1923
default: ""
@@ -28,6 +32,7 @@ env:
2832

2933
jobs:
3034
build-and-test-differential:
35+
if: ${{ inputs.run-condition }}
3136
runs-on: ${{ inputs.runner }}
3237
container: ${{ inputs.container }}${{ inputs.container-suffix }}
3338
steps:

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

+9-63
Original file line numberDiff line numberDiff line change
@@ -40,98 +40,44 @@ jobs:
4040
shell: bash
4141

4242
build-and-test-differential:
43+
if: ${{ always() }}
4344
needs:
4445
- require-label
4546
uses: ./.github/workflows/build-and-test-differential.yaml
4647
with:
4748
container: ghcr.io/autowarefoundation/autoware:universe-devel
49+
run-condition: ${{ needs.require-label.outputs.result == 'true' }}
4850
secrets:
4951
codecov-token: ${{ secrets.CODECOV_TOKEN }}
5052

5153
build-and-test-differential-cuda:
54+
if: ${{ always() }}
5255
needs: check-if-cuda-job-is-needed
53-
if: ${{ needs.check-if-cuda-job-is-needed.outputs.cuda_job_is_needed == 'true' }}
5456
uses: ./.github/workflows/build-and-test-differential.yaml
5557
with:
5658
container: ghcr.io/autowarefoundation/autoware:universe-devel
5759
container-suffix: -cuda
60+
run-condition: ${{ needs.check-if-cuda-job-is-needed.outputs.cuda_job_is_needed == 'true' }}
5861
secrets:
5962
codecov-token: ${{ secrets.CODECOV_TOKEN }}
6063

61-
build-test-pr:
62-
needs:
63-
- build-and-test-differential
64-
- build-and-test-differential-cuda
65-
if: ${{ always() }}
66-
runs-on: ubuntu-latest
67-
steps:
68-
- uses: actions/checkout@v4
69-
70-
- name: Initialize Summary
71-
run: echo "### Build Test PR Results" > $GITHUB_STEP_SUMMARY
72-
shell: bash
73-
74-
- name: Evaluate build-and-test-differential
75-
uses: ./.github/actions/evaluate-job-result
76-
with:
77-
job_result: ${{ needs.build-and-test-differential.result }}
78-
job_name: build-and-test-differential
79-
expected_results: success
80-
81-
- name: Evaluate build-and-test-differential-cuda
82-
if: ${{ always() }}
83-
uses: ./.github/actions/evaluate-job-result
84-
with:
85-
job_result: ${{ needs.build-and-test-differential-cuda.result }}
86-
job_name: build-and-test-differential-cuda
87-
expected_results: success,skipped
88-
8964
clang-tidy-differential:
65+
if: ${{ always() }} # always run to provide report for status check
9066
needs:
9167
- check-if-cuda-job-is-needed
9268
- build-and-test-differential
93-
if: ${{ needs.check-if-cuda-job-is-needed.outputs.cuda_job_is_needed == 'false' }}
9469
uses: ./.github/workflows/clang-tidy-differential.yaml
9570
with:
9671
container: ghcr.io/autowarefoundation/autoware:universe-devel
72+
run-condition: ${{ needs.check-if-cuda-job-is-needed.outputs.cuda_job_is_needed == 'false' && needs.build-and-test-differential.result == 'success' }}
9773

9874
clang-tidy-differential-cuda:
75+
if: ${{ always() }} # always run to provide report for status check
9976
needs:
77+
- check-if-cuda-job-is-needed
10078
- build-and-test-differential-cuda
10179
uses: ./.github/workflows/clang-tidy-differential.yaml
10280
with:
10381
container: ghcr.io/autowarefoundation/autoware:universe-devel
10482
container-suffix: -cuda
105-
106-
clang-tidy-pr:
107-
needs:
108-
- clang-tidy-differential
109-
- clang-tidy-differential-cuda
110-
if: ${{ always() }}
111-
runs-on: ubuntu-latest
112-
steps:
113-
- name: Initialize Summary
114-
run: echo "### Clang Tidy PR Results" > $GITHUB_STEP_SUMMARY
115-
shell: bash
116-
117-
- name: Check clang-tidy success
118-
if: ${{ needs.clang-tidy-differential.result == 'success' || needs.clang-tidy-differential-cuda.result == 'success' }}
119-
run: |
120-
echo "✅ Either one of the following has succeeded:" >> $GITHUB_STEP_SUMMARY
121-
122-
- name: Fail if conditions not met
123-
if: ${{ !(needs.clang-tidy-differential.result == 'success' || needs.clang-tidy-differential-cuda.result == 'success') }}
124-
run: |
125-
echo "::error::❌ Either one of the following should have succeeded:"
126-
echo "::error::clang-tidy-differential: ${{ needs.clang-tidy-differential.result }}"
127-
echo "::error::clang-tidy-differential-cuda: ${{ needs.clang-tidy-differential-cuda.result }}"
128-
129-
echo "❌ Either one of the following should have succeeded:" >> $GITHUB_STEP_SUMMARY
130-
131-
exit 1
132-
133-
- name: Print the results
134-
if: ${{ always() }}
135-
run: |
136-
echo "- **clang-tidy-differential:** ${{ needs.clang-tidy-differential.result }}" >> $GITHUB_STEP_SUMMARY
137-
echo "- **clang-tidy-differential-cuda:** ${{ needs.clang-tidy-differential-cuda.result }}" >> $GITHUB_STEP_SUMMARY
83+
run-condition: ${{ needs.check-if-cuda-job-is-needed.outputs.cuda_job_is_needed == 'true' && needs.build-and-test-differential-cuda.result == 'success' }}

.github/workflows/clang-tidy-differential.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@ on:
1414
default: ubuntu-24.04
1515
required: false
1616
type: string
17+
run-condition:
18+
default: true
19+
required: false
20+
type: boolean
1721

1822
jobs:
1923
clang-tidy-differential:
24+
if: ${{ inputs.run-condition }}
2025
runs-on: ${{ inputs.runner }}
2126
container: ${{ inputs.container }}${{ inputs.container-suffix }}
2227
steps:

.pre-commit-config-optional.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
# https://github.com/autowarefoundation/sync-file-templates
33
# To make changes, update the source repository and follow the guidelines in its README.
44

5+
# https://pre-commit.ci/#configuration
6+
ci:
7+
autofix_commit_msg: "style(pre-commit-optional): autofix"
8+
# we already have our own daily update mechanism, we set this to quarterly
9+
autoupdate_schedule: quarterly
10+
autoupdate_commit_msg: "ci(pre-commit-optional): quarterly autoupdate"
11+
512
repos:
613
- repo: https://github.com/tcort/markdown-link-check
714
rev: v3.12.2

perception/autoware_image_projection_based_fusion/src/pointpainting_fusion/node.cpp

+48-42
Original file line numberDiff line numberDiff line change
@@ -316,54 +316,56 @@ dc | dc dc dc dc ||zc|
316316
// iterate points
317317
// Requires 'OMP_NUM_THREADS=N'
318318
omp_set_num_threads(omp_num_threads_);
319-
#pragma omp parallel for
320-
for (int i = 0; i < iterations; i++) {
321-
int stride = p_step * i;
322-
unsigned char * data = &painted_pointcloud_msg.data[0];
323-
unsigned char * output = &painted_pointcloud_msg.data[0];
324-
// cppcheck-suppress-begin invalidPointerCast
325-
float p_x = *reinterpret_cast<const float *>(&data[stride + x_offset]);
326-
float p_y = *reinterpret_cast<const float *>(&data[stride + y_offset]);
327-
float p_z = *reinterpret_cast<const float *>(&data[stride + z_offset]);
328-
// cppcheck-suppress-end invalidPointerCast
329-
point_lidar << p_x, p_y, p_z;
330-
point_camera = lidar2cam_affine * point_lidar;
331-
p_x = point_camera.x();
332-
p_y = point_camera.y();
333-
p_z = point_camera.z();
334-
335-
if (camera_projectors_[image_id].isOutsideHorizontalView(p_x, p_z)) {
336-
continue;
337-
}
319+
std::vector<std::vector<Eigen::Vector2d>> local_vectors(omp_num_threads_);
320+
#pragma omp parallel
321+
{
322+
#pragma omp for
323+
for (int i = 0; i < iterations; i++) {
324+
int stride = p_step * i;
325+
unsigned char * data = &painted_pointcloud_msg.data[0];
326+
unsigned char * output = &painted_pointcloud_msg.data[0];
327+
// cppcheck-suppress-begin invalidPointerCast
328+
float p_x = *reinterpret_cast<const float *>(&data[stride + x_offset]);
329+
float p_y = *reinterpret_cast<const float *>(&data[stride + y_offset]);
330+
float p_z = *reinterpret_cast<const float *>(&data[stride + z_offset]);
331+
// cppcheck-suppress-end invalidPointerCast
332+
point_lidar << p_x, p_y, p_z;
333+
point_camera = lidar2cam_affine * point_lidar;
334+
p_x = point_camera.x();
335+
p_y = point_camera.y();
336+
p_z = point_camera.z();
337+
338+
if (camera_projectors_[image_id].isOutsideHorizontalView(p_x, p_z)) {
339+
continue;
340+
}
338341

339-
// project
340-
Eigen::Vector2d projected_point;
341-
if (camera_projectors_[image_id].calcImageProjectedPoint(
342-
cv::Point3d(p_x, p_y, p_z), projected_point)) {
343-
// iterate 2d bbox
344-
for (const auto & feature_object : objects) {
345-
sensor_msgs::msg::RegionOfInterest roi = feature_object.feature.roi;
346-
// paint current point if it is inside bbox
347-
int label2d = feature_object.object.classification.front().label;
348-
if (
349-
!isUnknown(label2d) && isInsideBbox(projected_point.x(), projected_point.y(), roi, 1.0)) {
350-
// cppcheck-suppress invalidPointerCast
351-
auto p_class = reinterpret_cast<float *>(&output[stride + class_offset]);
352-
for (const auto & cls : isClassTable_) {
353-
// add up the class values if the point belongs to multiple classes
354-
*p_class = cls.second(label2d) ? (class_index_[cls.first] + *p_class) : *p_class;
342+
// project
343+
Eigen::Vector2d projected_point;
344+
if (camera_projectors_[image_id].calcImageProjectedPoint(
345+
cv::Point3d(p_x, p_y, p_z), projected_point)) {
346+
// iterate 2d bbox
347+
for (const auto & feature_object : objects) {
348+
sensor_msgs::msg::RegionOfInterest roi = feature_object.feature.roi;
349+
// paint current point if it is inside bbox
350+
int label2d = feature_object.object.classification.front().label;
351+
if (
352+
!isUnknown(label2d) &&
353+
isInsideBbox(projected_point.x(), projected_point.y(), roi, 1.0)) {
354+
// cppcheck-suppress invalidPointerCast
355+
auto p_class = reinterpret_cast<float *>(&output[stride + class_offset]);
356+
for (const auto & cls : isClassTable_) {
357+
// add up the class values if the point belongs to multiple classes
358+
*p_class = cls.second(label2d) ? (class_index_[cls.first] + *p_class) : *p_class;
359+
}
355360
}
356361
}
362+
if (debugger_) {
363+
int thread_id = omp_get_thread_num();
364+
local_vectors[thread_id].push_back(projected_point);
365+
}
357366
}
358-
#if 0
359-
// Parallelizing loop don't support push_back
360-
if (debugger_) {
361-
debug_image_points.push_back(projected_point);
362-
}
363-
#endif
364367
}
365368
}
366-
367369
if (debugger_) {
368370
std::unique_ptr<ScopedTimeTrack> inner_st_ptr;
369371
if (time_keeper_)
@@ -373,6 +375,10 @@ dc | dc dc dc dc ||zc|
373375
debug_image_rois.push_back(feature_object.feature.roi);
374376
}
375377

378+
for (const auto & local_vec : local_vectors) {
379+
debug_image_points.insert(debug_image_points.end(), local_vec.begin(), local_vec.end());
380+
}
381+
376382
debugger_->image_rois_ = debug_image_rois;
377383
debugger_->obstacle_points_ = debug_image_points;
378384
debugger_->publishImage(image_id, input_roi_msg.header.stamp);

planning/README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Enabling and disabling modules involves managing settings in key configuration a
1818

1919
### Key Files for Configuration
2020

21-
The `default_preset.yaml` file acts as the primary configuration file, where planning modules can be disable or enabled. Furthermore, users can also set the type of motion planner across various motion planners. For example:
21+
The `default_preset.yaml` file acts as the primary configuration file, where planning modules can be disabled or enabled. Furthermore, users can also set the type of motion planner across various motion planners. For example:
2222

2323
- `launch_avoidance_module`: Set to `true` to enable the avoidance module, or `false` to disable it.
2424
- `motion_stop_planner_type`: Set `default` to either `obstacle_stop_planner` or `obstacle_cruise_planner`.
@@ -35,23 +35,23 @@ The [launch files](https://github.com/autowarefoundation/autoware.universe/tree/
3535

3636
corresponds to launch_avoidance_module from `default_preset.yaml`.
3737

38-
### Parameters configuration
38+
### Parameter Configuration
3939

4040
There are multiple parameters available for configuration, and users have the option to modify them in [here](https://github.com/autowarefoundation/autoware_launch/tree/main/autoware_launch/config/planning). It's important to note that not all parameters are adjustable via `rqt_reconfigure`. To ensure the changes are effective, modify the parameters and then restart Autoware. Additionally, detailed information about each parameter is available in the corresponding documents under the planning tab.
4141

4242
### Integrating a Custom Module into Autoware: A Step-by-Step Guide
4343

4444
This guide outlines the steps for integrating your custom module into Autoware:
4545

46-
- Add your modules to the `default_preset.yaml` file. For example
46+
- Add your modules to the `default_preset.yaml` file. For example:
4747

4848
```yaml
4949
- arg:
5050
name: launch_intersection_module
5151
default: "true"
5252
```
5353
54-
- Incorporate your modules into the [launcher](https://github.com/autowarefoundation/autoware.universe/tree/main/launch/tier4_planning_launch/launch/scenario_planning). For example in [behavior_planning.launch.xml](https://github.com/autowarefoundation/autoware.universe/blob/main/launch/tier4_planning_launch/launch/scenario_planning/lane_driving/behavior_planning/behavior_planning.launch.xml):
54+
- Incorporate your modules into the [launcher](https://github.com/autowarefoundation/autoware.universe/tree/main/launch/tier4_planning_launch/launch/scenario_planning). For example, in [behavior_planning.launch.xml](https://github.com/autowarefoundation/autoware.universe/blob/main/launch/tier4_planning_launch/launch/scenario_planning/lane_driving/behavior_planning/behavior_planning.launch.xml):
5555
5656
```xml
5757
<arg name="launch_intersection_module" default="true"/>
@@ -63,14 +63,14 @@ This guide outlines the steps for integrating your custom module into Autoware:
6363
/>
6464
```
6565

66-
- If applicable, place your parameter folder within the appropriate existing parameter folder. For example [intersection_module's parameters](https://github.com/autowarefoundation/autoware_launch/blob/main/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/intersection.param.yaml) is in [behavior_velocity_planner](https://github.com/autowarefoundation/autoware_launch/tree/main/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner).
67-
- Insert the path of your parameters in the [tier4_planning_component.launch.xml](https://github.com/autowarefoundation/autoware_launch/blob/main/autoware_launch/launch/components/tier4_planning_component.launch.xml). For example `behavior_velocity_planner_intersection_module_param_path` is used.
66+
- If applicable, place your parameter folder within the appropriate existing parameter folder. For example, [intersection_module's parameters](https://github.com/autowarefoundation/autoware_launch/blob/main/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/intersection.param.yaml) are in [behavior_velocity_planner](https://github.com/autowarefoundation/autoware_launch/tree/main/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner).
67+
- Insert the path of your parameters in the [tier4_planning_component.launch.xml](https://github.com/autowarefoundation/autoware_launch/blob/main/autoware_launch/launch/components/tier4_planning_component.launch.xml). For example, `behavior_velocity_planner_intersection_module_param_path` is used.
6868

6969
```xml
7070
<arg name="behavior_velocity_planner_intersection_module_param_path" value="$(var behavior_velocity_config_path)/intersection.param.yaml"/>
7171
```
7272

73-
- Define your parameter path variable within the corresponding launcher. For example in [behavior_planning.launch.xml](https://github.com/autowarefoundation/autoware.universe/blob/04aa54bf5fb0c88e70198ca74b9ac343cc3457bf/launch/tier4_planning_launch/launch/scenario_planning/lane_driving/behavior_planning/behavior_planning.launch.xml#L191)
73+
- Define your parameter path variable within the corresponding launcher. For example, in [behavior_planning.launch.xml](https://github.com/autowarefoundation/autoware.universe/blob/04aa54bf5fb0c88e70198ca74b9ac343cc3457bf/launch/tier4_planning_launch/launch/scenario_planning/lane_driving/behavior_planning/behavior_planning.launch.xml#L191)
7474

7575
```xml
7676
<param from="$(var behavior_velocity_planner_intersection_module_param_path)"/>
@@ -82,7 +82,7 @@ This guide outlines the steps for integrating your custom module into Autoware:
8282

8383
## Join Our Community-Driven Effort
8484

85-
Autoware thrives on community collaboration. Every contribution, big or small, is invaluable to us. Whether it's reporting bugs, suggesting improvements, offering new ideas, or anything else you can think of – we welcome it all with open arms.
85+
Autoware thrives on community collaboration. Every contribution, big or small, is invaluable to us. Whether it's reporting bugs, suggesting improvements, offering new ideas, or anything else you can think of – we welcome all contributions with open arms.
8686

8787
### How to Contribute?
8888

@@ -105,7 +105,7 @@ Interested in joining our meetings? We’d love to have you! For more informatio
105105

106106
Occasionally, we publish papers specific to the Planning Component in Autoware. We encourage you to explore these publications and find valuable insights for your work. If you find them useful and incorporate any of our methodologies or algorithms in your projects, citing our papers would be immensely helpful. This support allows us to reach a broader audience and continue contributing to the field.
107107

108-
If you use the Jerk Constrained Velocity Planning algorithm in [Motion Velocity Smoother](./autoware_velocity_smoother/README.md) module in the Planning Component, we kindly request you to cite the relevant paper.
108+
If you use the Jerk Constrained Velocity Planning algorithm in the [Motion Velocity Smoother](./autoware_velocity_smoother/README.md) module in the Planning Component, we kindly request you cite the relevant paper.
109109

110110
<!-- cspell:ignore Shimizu, Horibe, Watanabe, Kato -->
111111

0 commit comments

Comments
 (0)