Skip to content

Commit 1d2827f

Browse files
authored
Merge branch 'main' into fix/shape_estimation
2 parents e77d669 + 47d1212 commit 1d2827f

File tree

48 files changed

+3301
-2169
lines changed

Some content is hidden

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

48 files changed

+3301
-2169
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/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,111 @@
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 <functional>
24+
#include <map>
25+
#include <string>
26+
27+
namespace tier4_autoware_utils
28+
{
29+
30+
class PublishedTimePublisher
31+
{
32+
public:
33+
explicit PublishedTimePublisher(
34+
rclcpp::Node * node, const std::string & publisher_topic_suffix = "/debug/published_time",
35+
const rclcpp::QoS & qos = rclcpp::QoS(1))
36+
: node_(node), publisher_topic_suffix_(publisher_topic_suffix), qos_(qos)
37+
{
38+
}
39+
40+
void publish(const rclcpp::PublisherBase::ConstSharedPtr & publisher, const rclcpp::Time & stamp)
41+
{
42+
const auto & gid_key = publisher->get_gid();
43+
44+
// if the publisher is not in the map, create a new publisher for published time
45+
ensure_publisher_exists(gid_key, publisher->get_topic_name());
46+
47+
const auto & pub_published_time_ = publishers_[gid_key];
48+
49+
// Check if there are any subscribers, otherwise don't do anything
50+
if (pub_published_time_->get_subscription_count() > 0) {
51+
PublishedTime published_time;
52+
53+
published_time.header.stamp = stamp;
54+
published_time.published_stamp = rclcpp::Clock().now();
55+
56+
pub_published_time_->publish(published_time);
57+
}
58+
}
59+
60+
void publish(
61+
const rclcpp::PublisherBase::ConstSharedPtr & publisher, const std_msgs::msg::Header & header)
62+
{
63+
const auto & gid_key = publisher->get_gid();
64+
65+
// if the publisher is not in the map, create a new publisher for published time
66+
ensure_publisher_exists(gid_key, publisher->get_topic_name());
67+
68+
const auto & pub_published_time_ = publishers_[gid_key];
69+
70+
// Check if there are any subscribers, otherwise don't do anything
71+
if (pub_published_time_->get_subscription_count() > 0) {
72+
PublishedTime published_time;
73+
74+
published_time.header = header;
75+
published_time.published_stamp = rclcpp::Clock().now();
76+
77+
pub_published_time_->publish(published_time);
78+
}
79+
}
80+
81+
private:
82+
rclcpp::Node * node_;
83+
std::string publisher_topic_suffix_;
84+
rclcpp::QoS qos_;
85+
86+
using PublishedTime = autoware_internal_msgs::msg::PublishedTime;
87+
88+
// Custom comparison struct for rmw_gid_t
89+
struct GidCompare
90+
{
91+
bool operator()(const rmw_gid_t & lhs, const rmw_gid_t & rhs) const
92+
{
93+
return std::memcmp(lhs.data, rhs.data, RMW_GID_STORAGE_SIZE) < 0;
94+
}
95+
};
96+
97+
// ensure that the publisher exists in publisher_ map, if not, create a new one
98+
void ensure_publisher_exists(const rmw_gid_t & gid_key, const std::string & topic_name)
99+
{
100+
if (publishers_.find(gid_key) == publishers_.end()) {
101+
publishers_[gid_key] =
102+
node_->create_publisher<PublishedTime>(topic_name + publisher_topic_suffix_, qos_);
103+
}
104+
}
105+
106+
// store them for each different publisher of the node
107+
std::map<rmw_gid_t, rclcpp::Publisher<PublishedTime>::SharedPtr, GidCompare> publishers_;
108+
};
109+
} // namespace tier4_autoware_utils
110+
111+
#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>

launch/tier4_perception_launch/launch/occupancy_grid_map/probabilistic_occupancy_grid_map.launch.xml

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
<!--multi lidar pointclouds based method-->
5252
<group if="$(eval &quot;'$(var occupancy_grid_map_method)'=='multi_lidar_pointcloud_based_occupancy_grid_map'&quot;)">
5353
<include file="$(find-pkg-share probabilistic_occupancy_grid_map)/launch/multi_lidar_pointcloud_based_occupancy_grid_map.launch.py">
54+
<arg name="input/obstacle_pointcloud" value="$(var input/obstacle_pointcloud)"/>
5455
<arg name="output" value="/perception/occupancy_grid_map/map"/>
5556
<arg name="use_intra_process" value="true"/>
5657
<arg name="use_multithread" value="true"/>

localization/ndt_scan_matcher/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ One optional function is regularization. Please see the regularization chapter i
6060

6161
{{ json_to_markdown("localization/ndt_scan_matcher/schema/sub/frame.json") }}
6262

63+
#### Sensor Points
64+
65+
{{ json_to_markdown("localization/ndt_scan_matcher/schema/sub/sensor_points.json") }}
66+
6367
#### Ndt
6468

6569
{{ json_to_markdown("localization/ndt_scan_matcher/schema/sub/ndt.json") }}

localization/ndt_scan_matcher/config/ndt_scan_matcher.param.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
map_frame: "map"
1212

1313

14+
sensor_points:
15+
# Required distance of input sensor points. [m]
16+
# If the max distance of input sensor points is lower than this value, the scan matching will not be performed.
17+
required_distance: 10.0
18+
19+
1420
ndt:
1521
# The maximum difference between two consecutive
1622
# transformations in order to consider convergence

localization/ndt_scan_matcher/include/ndt_scan_matcher/hyper_parameters.hpp

+8
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ struct HyperParameters
3737
std::string map_frame;
3838
} frame;
3939

40+
struct SensorPoints
41+
{
42+
double required_distance;
43+
} sensor_points;
44+
4045
pclomp::NdtParams ndt;
4146
bool ndt_regularization_enable;
4247

@@ -91,6 +96,9 @@ struct HyperParameters
9196
frame.ndt_base_frame = node->declare_parameter<std::string>("frame.ndt_base_frame");
9297
frame.map_frame = node->declare_parameter<std::string>("frame.map_frame");
9398

99+
sensor_points.required_distance =
100+
node->declare_parameter<double>("sensor_points.required_distance");
101+
94102
ndt.trans_epsilon = node->declare_parameter<double>("ndt.trans_epsilon");
95103
ndt.step_size = node->declare_parameter<double>("ndt.step_size");
96104
ndt.resolution = node->declare_parameter<double>("ndt.resolution");

localization/ndt_scan_matcher/schema/ndt_scan_matcher.schema.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
"covariance": { "$ref": "sub/covariance.json#/definitions/covariance" },
2222
"dynamic_map_loading": {
2323
"$ref": "sub/dynamic_map_loading.json#/definitions/dynamic_map_loading"
24+
},
25+
"sensor_points": {
26+
"$ref": "sub/sensor_points.json#/definitions/sensor_points"
2427
}
2528
},
2629
"required": [
@@ -30,7 +33,8 @@
3033
"validation",
3134
"score_estimation",
3235
"covariance",
33-
"dynamic_map_loading"
36+
"dynamic_map_loading",
37+
"sensor_points"
3438
],
3539
"additionalProperties": false
3640
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Parameters for Ndt Scan Matcher Node",
4+
"definitions": {
5+
"sensor_points": {
6+
"type": "object",
7+
"properties": {
8+
"required_distance": {
9+
"type": "number",
10+
"description": "Required distance of input sensor points [m]. If the max distance of input sensor points is lower than this value, the scan matching will not be performed.",
11+
"default": "10.0"
12+
}
13+
},
14+
"required": ["required_distance"],
15+
"additionalProperties": false
16+
}
17+
}
18+
}

localization/ndt_scan_matcher/src/ndt_scan_matcher_core.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,21 @@ void NDTScanMatcher::callback_sensor_points(
346346
transform_sensor_measurement(
347347
sensor_frame, param_.frame.base_frame, sensor_points_in_sensor_frame,
348348
sensor_points_in_baselink_frame);
349+
350+
// check max distance of sensor points
351+
double max_distance = 0.0;
352+
for (const auto & point : sensor_points_in_baselink_frame->points) {
353+
const double distance = std::hypot(point.x, point.y, point.z);
354+
max_distance = std::max(max_distance, distance);
355+
}
356+
if (max_distance < param_.sensor_points.required_distance) {
357+
RCLCPP_WARN_STREAM(
358+
this->get_logger(), "Max distance of sensor points = "
359+
<< std::fixed << std::setprecision(3) << max_distance << " [m] < "
360+
<< param_.sensor_points.required_distance << " [m]");
361+
return;
362+
}
363+
349364
ndt_ptr_->setInputSource(sensor_points_in_baselink_frame);
350365
if (!is_activated_) return;
351366

perception/bytetrack/package.xml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<version>0.0.1</version>
66
<description>ByteTrack implementation ported toward Autoware</description>
77
<maintainer email="manato.hirabayashi@tier4.jp">Manato HIRABAYASHI</maintainer>
8+
<maintainer email="yoshi.ri@tier4.jp">Yoshi RI</maintainer>
89
<license>Apache License 2.0</license>
910

1011
<buildtool_depend>ament_cmake_auto</buildtool_depend>

perception/bytetrack/src/bytetrack.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ bool ByteTrack::do_inference(ObjectArray & objects)
3838
bytetrack_objects.emplace_back(bytetrack_obj);
3939
}
4040

41+
// cspell: ignore stracks tlwh
4142
// Update tracker
4243
std::vector<STrack> output_stracks = tracker_->update(bytetrack_objects);
4344

perception/detected_object_validation/package.xml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<maintainer email="shunsuke.miura@tier4.jp">Shunsuke Miura</maintainer>
99
<maintainer email="dai.nguyen@tier4.jp">Dai Nguyen</maintainer>
1010
<maintainer email="shintaro.tomie@tier4.jp">Shintaro Tomie</maintainer>
11+
<maintainer email="yoshi.ri@tier4.jp">Yoshi RI</maintainer>
1112
<license>Apache License 2.0</license>
1213

1314
<buildtool_depend>ament_cmake_auto</buildtool_depend>

perception/multi_object_tracker/CMakeLists.txt

+7-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ include_directories(
2222
# Generate exe file
2323
set(MULTI_OBJECT_TRACKER_SRC
2424
src/multi_object_tracker_core.cpp
25+
src/data_association/data_association.cpp
26+
src/data_association/mu_successive_shortest_path/mu_successive_shortest_path_wrapper.cpp
27+
src/tracker/motion_model/motion_model_base.cpp
28+
src/tracker/motion_model/bicycle_motion_model.cpp
29+
# cspell: ignore ctrv
30+
src/tracker/motion_model/ctrv_motion_model.cpp
31+
src/tracker/motion_model/cv_motion_model.cpp
2532
src/tracker/model/tracker_base.cpp
2633
src/tracker/model/big_vehicle_tracker.cpp
2734
src/tracker/model/normal_vehicle_tracker.cpp
@@ -31,8 +38,6 @@ set(MULTI_OBJECT_TRACKER_SRC
3138
src/tracker/model/pedestrian_and_bicycle_tracker.cpp
3239
src/tracker/model/unknown_tracker.cpp
3340
src/tracker/model/pass_through_tracker.cpp
34-
src/data_association/data_association.cpp
35-
src/data_association/mu_successive_shortest_path/mu_successive_shortest_path_wrapper.cpp
3641
)
3742

3843
ament_auto_add_library(multi_object_tracker_node SHARED

0 commit comments

Comments
 (0)