Skip to content

Commit

Permalink
Merge branch 'main' into refactor/namespace-tracking_object_merger
Browse files Browse the repository at this point in the history
  • Loading branch information
technolojin authored Jun 27, 2024
2 parents 52581c9 + fcfa6d0 commit 2858871
Show file tree
Hide file tree
Showing 213 changed files with 2,905 additions and 1,261 deletions.
6 changes: 2 additions & 4 deletions .cppcheck_suppressions
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
*:*/test/*

arrayIndexThenCheck
checkersReport
constParameterPointer
constParameterReference
constVariable
constVariableReference
containerOutOfBounds
// cspell: ignore cstyle
cstyleCast
duplicateBranch
duplicateBreak
Expand All @@ -23,11 +22,10 @@ noValidConfiguration
passedByValue
preprocessorErrorDirective
redundantInitialization
returnByReference
shadowArgument
shadowFunction
shadowVariable
syntaxError
// cspell: ignore uninit
uninitMemberVar
unknownMacro
unmatchedSuppression
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ planning/behavior_velocity_planner/autoware_behavior_velocity_occlusion_spot_mod
planning/behavior_velocity_planner/autoware_behavior_velocity_planner/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_velocity_planner/autoware_behavior_velocity_planner_common/** [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_velocity_planner/autoware_behavior_velocity_run_out_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_velocity_planner/autoware_behavior_velocity_speed_bump_module/** [email protected] [email protected] [email protected]
planning/behavior_velocity_planner/autoware_behavior_velocity_stop_line_module/** [email protected] [email protected] [email protected] [email protected]
planning/behavior_velocity_planner/autoware_behavior_velocity_template_module/** [email protected]
planning/behavior_velocity_planner/autoware_behavior_velocity_traffic_light_module/** [email protected] [email protected] [email protected] [email protected]
planning/behavior_velocity_planner/autoware_behavior_velocity_virtual_traffic_light_module/** [email protected] [email protected] [email protected]
planning/behavior_velocity_planner/autoware_behavior_velocity_walkway_module/** [email protected] [email protected] [email protected] [email protected]
planning/behavior_velocity_planner/behavior_velocity_speed_bump_module/** [email protected] [email protected] [email protected]
planning/motion_velocity_planner/autoware_motion_velocity_dynamic_obstacle_stop_module/** [email protected] [email protected]
planning/motion_velocity_planner/autoware_motion_velocity_obstacle_velocity_limiter_module/** [email protected]
planning/motion_velocity_planner/autoware_motion_velocity_out_of_lane_module/** [email protected] [email protected] [email protected] [email protected]
Expand Down
8 changes: 0 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

44 changes: 0 additions & 44 deletions .github/PULL_REQUEST_TEMPLATE/small-change.md

This file was deleted.

63 changes: 0 additions & 63 deletions .github/PULL_REQUEST_TEMPLATE/standard-change.md

This file was deleted.

61 changes: 61 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
## Description

## Related links

**Parent Issue:**

- Link

<!-- ⬇️🟢
**Private Links:**
- [CompanyName internal link]()
⬆️🟢 -->

## How was this PR tested?

## Notes for reviewers

None.

## Interface changes

None.

<!-- ⬇️🔴
### Topic changes
#### Additions and removals
| Change type | Topic Type | Topic Name | Message Type | Description |
|:--------------|:----------------|:--------------|:--------------------|:------------------|
| Added/Removed | Pub/Sub/Srv/Cli | `/topic_name` | `std_msgs/String` | Topic description |
#### Modifications
| Version | Topic Type | Topic Name | Message Type | Description |
|:--------|:----------------|:------------------|:--------------------|:------------------|
| Old | Pub/Sub/Srv/Cli | `/old_topic_name` | `sensor_msgs/Image` | Topic description |
| New | Pub/Sub/Srv/Cli | `/new_topic_name` | `sensor_msgs/Image` | Topic description |
### ROS Parameter Changes
#### Additions and removals
| Change type | Parameter Name | Type | Default Value | Description |
|:--------------|:---------------|:---------|:--------------|:------------------|
| Added/Removed | `param_name` | `double` | `1.0` | Param description |
#### Modifications
| Version | Parameter Name | Type | Default Value | Description |
|:--------|:-----------------|:---------|:--------------|:------------------|
| Old | `old_param_name` | `double` | `1.0` | Param description |
| New | `new_param_name` | `double` | `1.0` | Param description |
🔴⬆️ -->

## Effects on system behavior

None.
3 changes: 0 additions & 3 deletions .github/sync-files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
- source: .github/ISSUE_TEMPLATE/bug.yaml
- source: .github/ISSUE_TEMPLATE/config.yml
- source: .github/ISSUE_TEMPLATE/task.yaml
- source: .github/PULL_REQUEST_TEMPLATE.md
- source: .github/PULL_REQUEST_TEMPLATE/small-change.md
- source: .github/PULL_REQUEST_TEMPLATE/standard-change.md
- source: .github/dependabot.yaml
- source: .github/stale.yml
- source: .github/workflows/cancel-previous-workflows.yaml
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/clang-tidy-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@ jobs:
runs-on: ubuntu-latest
container: ghcr.io/autowarefoundation/autoware:latest-prebuilt-cuda
steps:
- name: Set PR fetch depth
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"

- name: Checkout PR branch and all PR commits
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
fetch-depth: 0

- name: Show disk space before the tasks
run: df -h
Expand All @@ -41,19 +37,17 @@ jobs:

- name: Get modified files
id: get-modified-files
uses: tj-actions/changed-files@v42
with:
files: |
**/*.cpp
**/*.hpp
run: |
echo "changed_files=$(git diff --name-only "origin/${{ github.base_ref }}"...HEAD | grep -E '\.(cpp|hpp)$' | tr '\n' ' ' || true)" >> $GITHUB_OUTPUT
shell: bash

- name: Run clang-tidy
if: ${{ steps.get-modified-files.outputs.all_changed_files != '' }}
if: ${{ steps.get-modified-files.outputs.changed_files != '' }}
uses: autowarefoundation/autoware-github-actions/clang-tidy@v1
with:
rosdistro: humble
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
target-files: ${{ steps.get-modified-files.outputs.all_changed_files }}
target-files: ${{ steps.get-modified-files.outputs.changed_files }}
clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy
build-depends-repos: build_depends.repos

Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/comment-on-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: comment-on-pr
on:
pull_request_target:

jobs:
comment-on-pr:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Initial PR comment
uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
Thank you for contributing to the Autoware project!
🚧 If your pull request is in progress, [switch it to draft mode](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#converting-a-pull-request-to-a-draft).
Please ensure:
- You've checked our [contribution guidelines](https://autowarefoundation.github.io/autoware-documentation/main/contributing/).
- Your PR follows our [pull request guidelines](https://autowarefoundation.github.io/autoware-documentation/main/contributing/pull-request-guidelines/).
- All required CI checks pass before [marking the PR ready for review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#marking-a-pull-request-as-ready-for-review).
2 changes: 1 addition & 1 deletion .github/workflows/cppcheck-daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
continue-on-error: true
id: cppcheck
run: |
cppcheck --enable=all --inconclusive --check-level=exhaustive --error-exitcode=1 --xml . 2> cppcheck-report.xml
cppcheck --enable=all --inconclusive --check-level=exhaustive --suppress=*:*/test/* --error-exitcode=1 --xml . 2> cppcheck-report.xml
shell: bash

- name: Count errors by error ID and severity
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/cppcheck-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,33 @@ jobs:
run: git fetch origin ${{ github.base_ref }}
shell: bash

- name: Get changed files
id: changed-files
- name: Get changed files (existing files only)
id: get-changed-files
run: |
git diff --name-only "origin/${{ github.base_ref }}"...HEAD > changed_files.txt
cat changed_files.txt
echo "changed-files=$(git diff --name-only "origin/${{ github.base_ref }}"...HEAD | grep -E '\.(cpp|hpp)$' | while read -r file; do [ -e "$file" ] && echo -n "$file "; done)" >> $GITHUB_OUTPUT
shell: bash

- name: Run Cppcheck on changed files
if: ${{ steps.get-changed-files.outputs.changed-files != '' }}
continue-on-error: true
id: cppcheck
run: |
files=$(cat changed_files.txt | grep -E '\.(cpp|hpp)$' || true)
if [ -n "$files" ]; then
echo "Running Cppcheck on changed files: $files"
cppcheck --enable=all --inconclusive --check-level=exhaustive --error-exitcode=1 --suppressions-list=.cppcheck_suppressions $files 2> cppcheck-report.txt
else
echo "No C++ files changed."
touch cppcheck-report.txt
fi
echo "Running Cppcheck on changed files: ${{ steps.get-changed-files.outputs.changed-files }}"
cppcheck --enable=all --inconclusive --check-level=exhaustive --error-exitcode=1 --suppressions-list=.cppcheck_suppressions ${{ steps.get-changed-files.outputs.changed-files }} 2> cppcheck-report.txt
shell: bash

- name: Show cppcheck-report result
if: ${{ steps.get-changed-files.outputs.changed-files != '' }}
run: |
cat cppcheck-report.txt
- name: Upload Cppcheck report
if: ${{ steps.get-changed-files.outputs.changed-files != '' }}
uses: actions/upload-artifact@v2
with:
name: cppcheck-report
path: cppcheck-report.txt

- name: Fail the job if Cppcheck failed
if: steps.cppcheck.outcome == 'failure'
if: ${{ steps.get-changed-files.outputs.changed-files != '' && steps.cppcheck.outcome == 'failure' }}
run: exit 1
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <geometry_msgs/msg/pose_stamped.hpp>
#include <nav_msgs/msg/occupancy_grid.hpp>
#include <nav_msgs/msg/odometry.hpp>
#include <rosgraph_msgs/msg/clock.hpp>
#include <sensor_msgs/msg/point_cloud2.hpp>
#include <std_msgs/msg/bool.hpp>
#include <tf2_msgs/msg/tf_message.hpp>
Expand Down Expand Up @@ -527,6 +528,7 @@ class AutowareTestManager
AutowareTestManager()
{
test_node_ = std::make_shared<rclcpp::Node>("autoware_test_manager_node");
pub_clock_ = test_node_->create_publisher<rosgraph_msgs::msg::Clock>("/clock", 1);
}

template <typename MessageType>
Expand Down Expand Up @@ -560,10 +562,28 @@ class AutowareTestManager
}
}

/**
* @brief Publishes a ROS Clock message with the specified time.
*
* This function publishes a ROS Clock message with the specified time.
* Be careful when using this function, as it can affect the behavior of
* the system under test. Consider using ament_add_ros_isolated_gtest to
* isolate the system under test from the ROS clock.
*
* @param time The time to publish.
*/
void jump_clock(const rclcpp::Time & time)
{
rosgraph_msgs::msg::Clock clock;
clock.clock = time;
pub_clock_->publish(clock);
}

protected:
// Publisher
std::unordered_map<std::string, std::shared_ptr<rclcpp::PublisherBase>> publishers_;
std::unordered_map<std::string, std::shared_ptr<rclcpp::SubscriptionBase>> subscribers_;
rclcpp::Publisher<rosgraph_msgs::msg::Clock>::SharedPtr pub_clock_;

// Node
rclcpp::Node::SharedPtr test_node_;
Expand Down
Loading

0 comments on commit 2858871

Please sign in to comment.