Skip to content

Commit 16baa6c

Browse files
authored
Merge branch 'main' into add-gtest-of-global-parameter-loader
2 parents 8e1b703 + 0dee512 commit 16baa6c

File tree

932 files changed

+46575
-20131
lines changed

Some content is hidden

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

932 files changed

+46575
-20131
lines changed

.github/CODEOWNERS

+39-29
Large diffs are not rendered by default.

.github/dependabot.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ updates:
66
interval: daily
77
open-pull-requests-limit: 1
88
labels:
9-
- bot
10-
- github-actions
9+
- tag:bot
10+
- type:github-actions

.github/labeler.yaml

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
ci:
1+
"type:ci":
22
- .github/**/*
33
- "*.json"
44
- "*.yaml"
55
- "*.cfg"
66
- .clang-format
77
- .gitignore
88
- .prettierignore
9-
documentation:
9+
"type:documentation":
1010
- docs/**/*
1111
- "**/*.md"
1212
- "**/*.rst"
1313
- "**/*.jpg"
1414
- "**/*.png"
1515
- "**/*.svg"
16-
common:
16+
"component:common":
1717
- common/**/*
18-
control:
18+
"component:control":
1919
- control/**/*
20-
evaluator:
20+
"component:evaluator":
2121
- evaluator/**/*
22-
launch:
22+
"component:launch":
2323
- launch/**/*
24-
localization:
24+
"component:localization":
2525
- localization/**/*
26-
map:
26+
"component:map":
2727
- map/**/*
28-
perception:
28+
"component:perception":
2929
- perception/**/*
30-
planning:
30+
"component:planning":
3131
- planning/**/*
32-
sensing:
32+
"component:sensing":
3333
- sensing/**/*
34-
simulator:
34+
"component:simulation":
3535
- simulator/**/*
36-
system:
36+
"component:system":
3737
- system/**/*
38-
tools:
38+
"component:tools":
3939
- tools/**/*
40-
vehicle:
40+
"component:vehicle":
4141
- vehicle/**/*

.github/stale.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
daysUntilClose: false
55

66
# Label to use when marking as stale
7-
staleLabel: stale
7+
staleLabel: status:stale
88

99
# Comment to post when marking as stale
1010
markComment: >

.github/sync-files.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,8 @@
8484
sd "/edit/main/docs/" "/edit/main/" {source}
8585
sd "docs_dir: .*" "docs_dir: ." {source}
8686
sd "assets/(\w+)" "docs/assets/\$1" {source}
87+
sd -- \
88+
" - macros" \
89+
" - macros:
90+
module_name: mkdocs_macros" {source}
8791
- source: docs/assets/js/mathjax.js

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
prevent-no-label-execution:
1212
uses: autowarefoundation/autoware-github-actions/.github/workflows/prevent-no-label-execution.yaml@v1
1313
with:
14-
label: run-build-and-test-differential
14+
label: tag:run-build-and-test-differential
1515

1616
build-and-test-differential:
1717
needs: prevent-no-label-execution

.github/workflows/cancel-previous-workflows.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Cancel previous runs
11-
uses: styfle/cancel-workflow-action@0.11.0
11+
uses: styfle/cancel-workflow-action@0.12.0
1212
with:
1313
workflow_id: all
1414
all_but_latest: true

.github/workflows/deploy-docs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
prevent-no-label-execution:
2323
uses: autowarefoundation/autoware-github-actions/.github/workflows/prevent-no-label-execution.yaml@v1
2424
with:
25-
label: deploy-docs
25+
label: tag:deploy-docs
2626

2727
deploy-docs:
2828
needs: prevent-no-label-execution

.github/workflows/github-release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
echo "tag-name=${REF_NAME#beta/}" >> $GITHUB_OUTPUT
3131
3232
- name: Check out repository
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434
with:
3535
fetch-depth: 0
3636
ref: ${{ steps.set-tag-name.outputs.ref-name }}

.github/workflows/openai-pr-reviewer.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
prevent-no-label-execution:
2222
uses: autowarefoundation/autoware-github-actions/.github/workflows/prevent-no-label-execution.yaml@v1
2323
with:
24-
label: openai-pr-reviewer
24+
label: tag:openai-pr-reviewer
2525
review:
2626
needs: prevent-no-label-execution
2727
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}

.github/workflows/pre-commit-optional.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Check out repository
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212
with:
1313
fetch-depth: 0
1414

.github/workflows/pre-commit.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
private_key: ${{ secrets.PRIVATE_KEY }}
1717

1818
- name: Check out repository
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
with:
2121
ref: ${{ github.event.pull_request.head.ref }}
2222

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

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: spell-check-all
22

33
on:
44
workflow_dispatch:
5+
schedule:
6+
- cron: 0 0 * * *
57

68
jobs:
79
spell-check-all:

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Check out repository
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212

1313
- name: Run spell-check
1414
uses: autowarefoundation/autoware-github-actions/spell-check@v1

.github/workflows/sync-files.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ jobs:
2828
with:
2929
token: ${{ steps.generate-token.outputs.token }}
3030
pr-labels: |
31-
bot
32-
sync-files
31+
tag:bot
32+
tag:sync-files
3333
auto-merge-method: squash

.github/workflows/update-codeowners-from-packages.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ jobs:
2828
with:
2929
token: ${{ steps.generate-token.outputs.token }}
3030
pr-labels: |
31-
bot
32-
update-codeowners-from-packages
31+
tag:bot
32+
tag:update-codeowners-from-packages
3333
auto-merge-method: squash

common/autoware_auto_perception_rviz_plugin/include/object_detection/predicted_objects_display.hpp

+33
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@
2424

2525
#include <condition_variable>
2626
#include <list>
27+
#include <queue>
2728
#include <set>
2829
#include <string>
2930
#include <unordered_map>
31+
#include <utility>
3032
#include <vector>
3133

3234
namespace autoware
@@ -45,10 +47,31 @@ class AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC PredictedObjectsDisplay
4547
using PredictedObjects = autoware_auto_perception_msgs::msg::PredictedObjects;
4648

4749
PredictedObjectsDisplay();
50+
~PredictedObjectsDisplay()
51+
{
52+
{
53+
std::unique_lock<std::mutex> lock(queue_mutex);
54+
should_terminate = true;
55+
}
56+
condition.notify_all();
57+
for (std::thread & active_thread : threads) {
58+
active_thread.join();
59+
}
60+
threads.clear();
61+
}
4862

4963
private:
5064
void processMessage(PredictedObjects::ConstSharedPtr msg) override;
5165

66+
void queueJob(std::function<void()> job)
67+
{
68+
{
69+
std::unique_lock<std::mutex> lock(queue_mutex);
70+
jobs.push(std::move(job));
71+
}
72+
condition.notify_one();
73+
}
74+
5275
boost::uuids::uuid to_boost_uuid(const unique_identifier_msgs::msg::UUID & uuid_msg)
5376
{
5477
const std::string uuid_str = uuid_to_string(uuid_msg);
@@ -100,6 +123,8 @@ class AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC PredictedObjectsDisplay
100123
PredictedObjects::ConstSharedPtr msg);
101124
void workerThread();
102125

126+
void messageProcessorThreadJob();
127+
103128
void update(float wall_dt, float ros_dt) override;
104129

105130
std::unordered_map<boost::uuids::uuid, int32_t, boost::hash<boost::uuids::uuid>> id_map;
@@ -108,6 +133,14 @@ class AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC PredictedObjectsDisplay
108133
int32_t marker_id = 0;
109134
const int32_t PATH_ID_CONSTANT = 1e3;
110135

136+
// max_num_threads: number of threads created in the thread pool, hard-coded to be 1;
137+
int max_num_threads;
138+
139+
bool should_terminate{false};
140+
std::mutex queue_mutex;
141+
std::vector<std::thread> threads;
142+
std::queue<std::function<void()>> jobs;
143+
111144
PredictedObjects::ConstSharedPtr msg;
112145
bool consumed{false};
113146
std::mutex mutex;

common/autoware_auto_perception_rviz_plugin/src/object_detection/predicted_objects_display.cpp

+31-14
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,44 @@ namespace object_detection
2525
{
2626
PredictedObjectsDisplay::PredictedObjectsDisplay() : ObjectPolygonDisplayBase("tracks")
2727
{
28-
std::thread worker(&PredictedObjectsDisplay::workerThread, this);
29-
worker.detach();
28+
max_num_threads = 1; // hard code the number of threads to be created
29+
30+
for (int ii = 0; ii < max_num_threads; ++ii) {
31+
threads.emplace_back(std::thread(&PredictedObjectsDisplay::workerThread, this));
32+
}
3033
}
3134

3235
void PredictedObjectsDisplay::workerThread()
33-
{
36+
{ // A standard working thread that waiting for jobs
3437
while (true) {
35-
std::unique_lock<std::mutex> lock(mutex);
36-
condition.wait(lock, [this] { return this->msg; });
38+
std::function<void()> job;
39+
{
40+
std::unique_lock<std::mutex> lock(queue_mutex);
41+
condition.wait(lock, [this] { return !jobs.empty() || should_terminate; });
42+
if (should_terminate) {
43+
return;
44+
}
45+
job = jobs.front();
46+
jobs.pop();
47+
}
48+
job();
49+
}
50+
}
3751

38-
auto tmp_msg = this->msg;
39-
this->msg.reset();
52+
void PredictedObjectsDisplay::messageProcessorThreadJob()
53+
{
54+
// Receiving
55+
std::unique_lock<std::mutex> lock(mutex);
56+
auto tmp_msg = this->msg;
57+
this->msg.reset();
58+
lock.unlock();
4059

41-
lock.unlock();
60+
auto tmp_markers = createMarkers(tmp_msg);
4261

43-
auto tmp_markers = createMarkers(tmp_msg);
44-
lock.lock();
45-
markers = tmp_markers;
62+
lock.lock();
63+
markers = tmp_markers;
4664

47-
consumed = true;
48-
}
65+
consumed = true;
4966
}
5067

5168
std::vector<visualization_msgs::msg::Marker::SharedPtr> PredictedObjectsDisplay::createMarkers(
@@ -188,7 +205,7 @@ void PredictedObjectsDisplay::processMessage(PredictedObjects::ConstSharedPtr ms
188205
std::unique_lock<std::mutex> lock(mutex);
189206

190207
this->msg = msg;
191-
condition.notify_one();
208+
queueJob(std::bind(&PredictedObjectsDisplay::messageProcessorThreadJob, this));
192209
}
193210

194211
void PredictedObjectsDisplay::update(float wall_dt, float ros_dt)
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/**:
22
ros__parameters:
33
update_rate: 10.0
4+
oneshot: false
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<launch>
2-
<arg name="oneshot" default="false"/>
32
<arg name="config_file" default="$(find-pkg-share goal_distance_calculator)/config/goal_distance_calculator.param.yaml"/>
43
<node pkg="goal_distance_calculator" exec="goal_distance_calculator_node" name="goal_distance_calculator" output="screen">
54
<param from="$(var config_file)"/>
6-
<param name="oneshot" value="$(var oneshot)"/>
75
</node>
86
</launch>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Parameters for Goal Distance Calculator Node",
4+
"type": "object",
5+
"definitions": {
6+
"goal_distance_calculator": {
7+
"type": "object",
8+
"properties": {
9+
"update_rate": {
10+
"type": "number",
11+
"default": "10.0",
12+
"exclusiveMinimum": 0,
13+
"description": "Timer callback period. [Hz]"
14+
},
15+
"oneshot": {
16+
"type": "boolean",
17+
"default": "false",
18+
"description": "Publish deviations just once or repeatedly."
19+
}
20+
},
21+
"required": ["update_rate", "oneshot"]
22+
}
23+
},
24+
"properties": {
25+
"/**": {
26+
"type": "object",
27+
"properties": {
28+
"ros__parameters": {
29+
"$ref": "#/definitions/goal_distance_calculator"
30+
}
31+
},
32+
"required": ["ros__parameters"]
33+
}
34+
},
35+
"required": ["/**"]
36+
}

common/goal_distance_calculator/src/goal_distance_calculator_node.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ GoalDistanceCalculatorNode::GoalDistanceCalculatorNode(const rclcpp::NodeOptions
4040
durable_qos.transient_local();
4141

4242
// Node Parameter
43-
node_param_.update_rate = declare_parameter("update_rate", 10.0);
44-
node_param_.oneshot = declare_parameter("oneshot", true);
43+
node_param_.update_rate = declare_parameter<double>("update_rate");
44+
node_param_.oneshot = declare_parameter<bool>("oneshot");
4545

4646
// Core
4747
goal_distance_calculator_ = std::make_unique<GoalDistanceCalculator>();

common/interpolation/package.xml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<description>The spline interpolation package</description>
77
<maintainer email="fumiya.watanabe@tier4.jp">Fumiya Watanabe</maintainer>
88
<maintainer email="takayuki.murooka@tier4.jp">Takayuki Murooka</maintainer>
9-
<maintainer email="yutaka.shimizu@tier4.jp">Yutaka Shimizu</maintainer>
109
<license>Apache License 2.0</license>
1110

1211
<buildtool_depend>ament_cmake_auto</buildtool_depend>

0 commit comments

Comments
 (0)