Skip to content

Commit 82803cc

Browse files
committed
Merge branch 'main' into feature/simulator_py_model
2 parents 83d146c + 46ac827 commit 82803cc

File tree

226 files changed

+6026
-4259
lines changed

Some content is hidden

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

226 files changed

+6026
-4259
lines changed

.cspell-partial.json

-9
This file was deleted.

.cspell.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"ignorePaths": ["perception/bytetrack/lib/**"],
3+
"ignoreRegExpList": [],
4+
"words": ["dltype", "tvmgen"]
5+
}

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

+37
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,40 @@ jobs:
7474

7575
- name: Show disk space after the tasks
7676
run: df -h
77+
78+
clang-tidy-differential:
79+
runs-on: ubuntu-latest
80+
container: ghcr.io/autowarefoundation/autoware-openadk:latest-prebuilt-cuda
81+
steps:
82+
- name: Check out repository
83+
uses: actions/checkout@v3
84+
with:
85+
fetch-depth: 0
86+
87+
- name: Show disk space before the tasks
88+
run: df -h
89+
90+
- name: Remove exec_depend
91+
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
92+
93+
- name: Get modified packages
94+
id: get-modified-packages
95+
uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1
96+
97+
- name: Get modified files
98+
id: get-modified-files
99+
uses: tj-actions/changed-files@v35
100+
with:
101+
files: |
102+
**/*.cpp
103+
**/*.hpp
104+
105+
- name: Run clang-tidy
106+
if: ${{ steps.get-modified-files.outputs.all_changed_files != '' }}
107+
uses: autowarefoundation/autoware-github-actions/clang-tidy@v1
108+
with:
109+
rosdistro: humble
110+
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
111+
target-files: ${{ steps.get-modified-files.outputs.all_changed_files }}
112+
clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy
113+
build-depends-repos: build_depends.repos

.github/workflows/pr-agent.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PR-Agent
2+
3+
on:
4+
pull_request:
5+
types: [opened, labeled, unlabeled, synchronize]
6+
issue_comment:
7+
8+
jobs:
9+
prevent-no-label-execution-pr-agent:
10+
uses: autowarefoundation/autoware-github-actions/.github/workflows/prevent-no-label-execution.yaml@v1
11+
with:
12+
label: tag:pr-agent
13+
pr_agent_job:
14+
needs: prevent-no-label-execution-pr-agent
15+
if: ${{ needs.prevent-no-label-execution-pr-agent.outputs.run == 'true' }}
16+
runs-on: ubuntu-latest
17+
permissions:
18+
issues: write
19+
pull-requests: write
20+
contents: write
21+
name: Run pr agent on every pull request, respond to user comments
22+
steps:
23+
- name: PR Agent action step
24+
id: pragent
25+
uses: Codium-ai/pr-agent@main
26+
env:
27+
OPENAI_KEY: ${{ secrets.OPENAI_KEY_PR_AGENT }}
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
github_action_config.auto_review: "false"
30+
github_action_config.auto_describe: "false"
31+
github_action_config.auto_improve: "false"

.github/workflows/spell-check-all.yaml

-19
This file was deleted.

.github/workflows/spell-check-partial.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@ name: spell-check-partial
22

33
on:
44
pull_request:
5+
schedule:
6+
- cron: 0 0 * * *
7+
workflow_dispatch:
58

69
jobs:
710
spell-check-partial:
811
runs-on: ubuntu-latest
912
steps:
1013
- name: Check out repository
11-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1215

1316
- name: Run spell-check
1417
uses: autowarefoundation/autoware-github-actions/spell-check@v1
1518
with:
1619
cspell-json-url: https://raw.githubusercontent.com/tier4/autoware-spell-check-dict/main/.cspell.json
17-
local-cspell-json: .cspell-partial.json
20+
local-cspell-json: .cspell.json
1821
incremental-files-only: false

build_depends.repos

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ repositories:
1616
type: git
1717
url: https://github.com/autowarefoundation/autoware_adapi_msgs.git
1818
version: main
19+
core/autoware_internal_msgs:
20+
type: git
21+
url: https://github.com/autowarefoundation/autoware_internal_msgs.git
22+
version: main
1923
core/external/autoware_auto_msgs:
2024
type: git
2125
url: https://github.com/tier4/autoware_auto_msgs.git
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// Copyright 2024 The Autoware Contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef TIER4_AUTOWARE_UTILS__ROS__PUBLISHED_TIME_PUBLISHER_HPP_
16+
#define TIER4_AUTOWARE_UTILS__ROS__PUBLISHED_TIME_PUBLISHER_HPP_
17+
18+
#include <rclcpp/rclcpp.hpp>
19+
20+
#include <autoware_internal_msgs/msg/published_time.hpp>
21+
#include <std_msgs/msg/header.hpp>
22+
23+
#include <cstring>
24+
#include <functional>
25+
#include <map>
26+
#include <string>
27+
#include <utility>
28+
29+
namespace tier4_autoware_utils
30+
{
31+
32+
class PublishedTimePublisher
33+
{
34+
public:
35+
explicit PublishedTimePublisher(
36+
rclcpp::Node * node, std::string publisher_topic_suffix = "/debug/published_time",
37+
const rclcpp::QoS & qos = rclcpp::QoS(1))
38+
: node_(node), publisher_topic_suffix_(std::move(publisher_topic_suffix)), qos_(qos)
39+
{
40+
}
41+
42+
void publish_if_subscribed(
43+
const rclcpp::PublisherBase::ConstSharedPtr & publisher, const rclcpp::Time & stamp)
44+
{
45+
const auto & gid_key = publisher->get_gid();
46+
47+
// if the publisher is not in the map, create a new publisher for published time
48+
ensure_publisher_exists(gid_key, publisher->get_topic_name());
49+
50+
const auto & pub_published_time = publishers_[gid_key];
51+
52+
// Check if there are any subscribers, otherwise don't do anything
53+
if (pub_published_time->get_subscription_count() > 0) {
54+
PublishedTime published_time;
55+
56+
published_time.header.stamp = stamp;
57+
published_time.published_stamp = rclcpp::Clock().now();
58+
59+
pub_published_time->publish(published_time);
60+
}
61+
}
62+
63+
void publish_if_subscribed(
64+
const rclcpp::PublisherBase::ConstSharedPtr & publisher, const std_msgs::msg::Header & header)
65+
{
66+
const auto & gid_key = publisher->get_gid();
67+
68+
// if the publisher is not in the map, create a new publisher for published time
69+
ensure_publisher_exists(gid_key, publisher->get_topic_name());
70+
71+
const auto & pub_published_time = publishers_[gid_key];
72+
73+
// Check if there are any subscribers, otherwise don't do anything
74+
if (pub_published_time->get_subscription_count() > 0) {
75+
PublishedTime published_time;
76+
77+
published_time.header = header;
78+
published_time.published_stamp = rclcpp::Clock().now();
79+
80+
pub_published_time->publish(published_time);
81+
}
82+
}
83+
84+
private:
85+
rclcpp::Node * node_;
86+
std::string publisher_topic_suffix_;
87+
rclcpp::QoS qos_;
88+
89+
using PublishedTime = autoware_internal_msgs::msg::PublishedTime;
90+
91+
// Custom comparison struct for rmw_gid_t
92+
struct GidCompare
93+
{
94+
bool operator()(const rmw_gid_t & lhs, const rmw_gid_t & rhs) const
95+
{
96+
return std::memcmp(lhs.data, rhs.data, RMW_GID_STORAGE_SIZE) < 0;
97+
}
98+
};
99+
100+
// ensure that the publisher exists in publisher_ map, if not, create a new one
101+
void ensure_publisher_exists(const rmw_gid_t & gid_key, const std::string & topic_name)
102+
{
103+
if (publishers_.find(gid_key) == publishers_.end()) {
104+
publishers_[gid_key] =
105+
node_->create_publisher<PublishedTime>(topic_name + publisher_topic_suffix_, qos_);
106+
}
107+
}
108+
109+
// store them for each different publisher of the node
110+
std::map<rmw_gid_t, rclcpp::Publisher<PublishedTime>::SharedPtr, GidCompare> publishers_;
111+
};
112+
} // namespace tier4_autoware_utils
113+
114+
#endif // TIER4_AUTOWARE_UTILS__ROS__PUBLISHED_TIME_PUBLISHER_HPP_

common/tier4_autoware_utils/package.xml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<depend>autoware_auto_perception_msgs</depend>
1616
<depend>autoware_auto_planning_msgs</depend>
1717
<depend>autoware_auto_vehicle_msgs</depend>
18+
<depend>autoware_internal_msgs</depend>
1819
<depend>builtin_interfaces</depend>
1920
<depend>diagnostic_msgs</depend>
2021
<depend>geometry_msgs</depend>

0 commit comments

Comments
 (0)