Skip to content

Commit e595630

Browse files
authored
Merge branch 'main' into feat/sigma_loss
2 parents 62274ea + 9f3633d commit e595630

File tree

160 files changed

+6287
-2319
lines changed

Some content is hidden

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

160 files changed

+6287
-2319
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ planning/sampling_based_planner/frenet_planner/** maxime.clement@tier4.jp
205205
planning/sampling_based_planner/path_sampler/** maxime.clement@tier4.jp
206206
planning/sampling_based_planner/sampler_common/** maxime.clement@tier4.jp
207207
planning/scenario_selector/** fumiya.watanabe@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp taiki.tanaka@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp
208-
planning/static_centerline_optimizer/** kosuke.takeuchi@tier4.jp takayuki.murooka@tier4.jp
208+
planning/static_centerline_generator/** kosuke.takeuchi@tier4.jp takayuki.murooka@tier4.jp
209209
planning/surround_obstacle_checker/** satoshi.ota@tier4.jp
210210
sensing/gnss_poser/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp koji.minoda@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
211211
sensing/image_diagnostics/** dai.nguyen@tier4.jp

build_depends.repos

+5
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,8 @@ repositories:
4141
type: git
4242
url: https://github.com/MORAI-Autonomous/MORAI-ROS2_morai_msgs.git
4343
version: main
44+
#vehicle
45+
vehicle/sample_vehicle_launch:
46+
type: git
47+
url: https://github.com/autowarefoundation/sample_vehicle_launch.git
48+
version: main

common/global_parameter_loader/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ project(global_parameter_loader)
44
find_package(autoware_cmake REQUIRED)
55
autoware_package()
66

7+
if(BUILD_TESTING)
8+
file(GLOB_RECURSE test_files test/*.cpp)
9+
ament_add_ros_isolated_gtest(test_global_params_launch ${test_files})
10+
endif()
11+
712
ament_auto_package(
813
INSTALL_TO_SHARE
914
launch

common/global_parameter_loader/package.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
<buildtool_depend>ament_cmake_auto</buildtool_depend>
1111
<buildtool_depend>autoware_cmake</buildtool_depend>
1212

13-
<exec_depend>vehicle_info_util</exec_depend>
13+
<depend>sample_vehicle_description</depend>
14+
<depend>vehicle_info_util</depend>
1415

16+
<test_depend>ament_cmake_ros</test_depend>
1517
<test_depend>ament_lint_auto</test_depend>
1618
<test_depend>autoware_lint_common</test_depend>
1719

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright 2023 The Autoware Foundation
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+
#include <gtest/gtest.h>
16+
17+
#include <cstdlib>
18+
#include <iostream>
19+
#include <string>
20+
21+
TEST(TestLaunchFile, test_launch_file)
22+
{
23+
// Define the path of Python launch file
24+
std::string global_params_launch_path = "global_params.launch.py";
25+
26+
// Define the parameters you want to pass to the launch file
27+
std::string use_sim_time_param = "false";
28+
std::string vehicle_model_param = "sample_vehicle";
29+
// Construct the command to run the Python launch script with parameters
30+
std::string command = "ros2 launch global_parameter_loader " + global_params_launch_path +
31+
" use_sim_time:=" + use_sim_time_param +
32+
" vehicle_model:=" + vehicle_model_param;
33+
34+
// Use the system() function to execute the command
35+
int result = std::system(command.c_str());
36+
// Check the result of running the launch file
37+
EXPECT_EQ(result, 0);
38+
}
39+
40+
int main(int argc, char * argv[])
41+
{
42+
testing::InitGoogleTest(&argc, argv);
43+
return RUN_ALL_TESTS();
44+
}

common/object_recognition_utils/include/object_recognition_utils/matching.hpp

+15-5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
namespace object_recognition_utils
3030
{
3131
using tier4_autoware_utils::Polygon2d;
32+
// minimum area to avoid division by zero
33+
static const double MIN_AREA = 1e-6;
3234

3335
inline double getConvexShapeArea(const Polygon2d & source_polygon, const Polygon2d & target_polygon)
3436
{
@@ -66,10 +68,12 @@ template <class T1, class T2>
6668
double get2dIoU(const T1 source_object, const T2 target_object, const double min_union_area = 0.01)
6769
{
6870
const auto source_polygon = tier4_autoware_utils::toPolygon2d(source_object);
71+
if (boost::geometry::area(source_polygon) < MIN_AREA) return 0.0;
6972
const auto target_polygon = tier4_autoware_utils::toPolygon2d(target_object);
73+
if (boost::geometry::area(target_polygon) < MIN_AREA) return 0.0;
7074

7175
const double intersection_area = getIntersectionArea(source_polygon, target_polygon);
72-
if (intersection_area == 0.0) return 0.0;
76+
if (intersection_area < MIN_AREA) return 0.0;
7377
const double union_area = getUnionArea(source_polygon, target_polygon);
7478

7579
const double iou =
@@ -81,7 +85,9 @@ template <class T1, class T2>
8185
double get2dGeneralizedIoU(const T1 & source_object, const T2 & target_object)
8286
{
8387
const auto source_polygon = tier4_autoware_utils::toPolygon2d(source_object);
88+
if (boost::geometry::area(source_polygon) < MIN_AREA) return 0.0;
8489
const auto target_polygon = tier4_autoware_utils::toPolygon2d(target_object);
90+
if (boost::geometry::area(target_polygon) < MIN_AREA) return 0.0;
8591

8692
const double intersection_area = getIntersectionArea(source_polygon, target_polygon);
8793
const double union_area = getUnionArea(source_polygon, target_polygon);
@@ -95,11 +101,13 @@ template <class T1, class T2>
95101
double get2dPrecision(const T1 source_object, const T2 target_object)
96102
{
97103
const auto source_polygon = tier4_autoware_utils::toPolygon2d(source_object);
104+
const double source_area = boost::geometry::area(source_polygon);
105+
if (source_area < MIN_AREA) return 0.0;
98106
const auto target_polygon = tier4_autoware_utils::toPolygon2d(target_object);
107+
if (boost::geometry::area(target_polygon) < MIN_AREA) return 0.0;
99108

100109
const double intersection_area = getIntersectionArea(source_polygon, target_polygon);
101-
if (intersection_area == 0.0) return 0.0;
102-
const double source_area = boost::geometry::area(source_polygon);
110+
if (intersection_area < MIN_AREA) return 0.0;
103111

104112
return std::min(1.0, intersection_area / source_area);
105113
}
@@ -108,11 +116,13 @@ template <class T1, class T2>
108116
double get2dRecall(const T1 source_object, const T2 target_object)
109117
{
110118
const auto source_polygon = tier4_autoware_utils::toPolygon2d(source_object);
119+
if (boost::geometry::area(source_polygon) < MIN_AREA) return 0.0;
111120
const auto target_polygon = tier4_autoware_utils::toPolygon2d(target_object);
121+
const double target_area = boost::geometry::area(target_polygon);
122+
if (target_area < MIN_AREA) return 0.0;
112123

113124
const double intersection_area = getIntersectionArea(source_polygon, target_polygon);
114-
if (intersection_area == 0.0) return 0.0;
115-
const double target_area = boost::geometry::area(target_polygon);
125+
if (intersection_area < MIN_AREA) return 0.0;
116126

117127
return std::min(1.0, intersection_area / target_area);
118128
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// Copyright 2024 TIER IV, Inc.
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__POLLING_SUBSCRIBER_HPP_
16+
#define TIER4_AUTOWARE_UTILS__ROS__POLLING_SUBSCRIBER_HPP_
17+
18+
#include <rclcpp/rclcpp.hpp>
19+
20+
#include <string>
21+
22+
namespace tier4_autoware_utils
23+
{
24+
25+
template <typename T>
26+
class InterProcessPollingSubscriber
27+
{
28+
private:
29+
typename rclcpp::Subscription<T>::SharedPtr subscriber_;
30+
std::optional<T> data_;
31+
32+
public:
33+
explicit InterProcessPollingSubscriber(rclcpp::Node * node, const std::string & topic_name)
34+
{
35+
auto noexec_callback_group =
36+
node->create_callback_group(rclcpp::CallbackGroupType::MutuallyExclusive, false);
37+
auto noexec_subscription_options = rclcpp::SubscriptionOptions();
38+
noexec_subscription_options.callback_group = noexec_callback_group;
39+
40+
subscriber_ = node->create_subscription<T>(
41+
topic_name, rclcpp::QoS{1},
42+
[node]([[maybe_unused]] const typename T::ConstSharedPtr msg) { assert(false); },
43+
noexec_subscription_options);
44+
};
45+
bool updateLatestData()
46+
{
47+
rclcpp::MessageInfo message_info;
48+
T tmp;
49+
// The queue size (QoS) must be 1 to get the last message data.
50+
if (subscriber_->take(tmp, message_info)) {
51+
data_ = tmp;
52+
}
53+
return data_.has_value();
54+
};
55+
const T & getData() const
56+
{
57+
if (!data_.has_value()) {
58+
throw std::runtime_error("Bad_optional_access in class InterProcessPollingSubscriber");
59+
}
60+
return data_.value();
61+
};
62+
};
63+
64+
} // namespace tier4_autoware_utils
65+
66+
#endif // TIER4_AUTOWARE_UTILS__ROS__POLLING_SUBSCRIBER_HPP_

control/predicted_path_checker/src/predicted_path_checker_node/predicted_path_checker_node.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,10 @@ void PredictedPathCheckerNode::filterObstacles(
537537
const Pose & ego_pose, const TrajectoryPoints & traj, const double dist_threshold,
538538
const bool use_prediction, PredictedObjects & filtered_objects)
539539
{
540+
if (traj.size() < 2) {
541+
RCLCPP_ERROR(rclcpp::get_logger("predicted_path_checker"), "Trajectory size is less than 2.");
542+
return;
543+
}
540544
filtered_objects.header.frame_id = object_ptr_.get()->header.frame_id;
541545
filtered_objects.header.stamp = this->now();
542546

evaluator/perception_online_evaluator/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This module allows for the evaluation of how accurately perception results are g
1111
- Calculates lateral deviation between the predicted path and the actual traveled trajectory.
1212
- Calculates lateral deviation between the smoothed traveled trajectory and the perceived position to evaluate the stability of lateral position recognition.
1313
- Calculates yaw deviation between the smoothed traveled trajectory and the perceived position to evaluate the stability of yaw recognition.
14+
- Calculates yaw rate based on the yaw of the object received in the previous cycle to evaluate the stability of the yaw rate recognition.
1415

1516
## Inputs / Outputs
1617

evaluator/perception_online_evaluator/include/perception_online_evaluator/utils/marker_utils.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ MarkerArray createPoseMarkerArray(
6363
const float & b);
6464

6565
MarkerArray createPosesMarkerArray(
66-
const std::vector<Pose> poses, std::string && ns, const float & r, const float & g,
67-
const float & b, const float & x_scale = 0.5, const float & y_scale = 0.2,
66+
const std::vector<Pose> poses, std::string && ns, const int32_t & first_id, const float & r,
67+
const float & g, const float & b, const float & x_scale = 0.5, const float & y_scale = 0.2,
6868
const float & z_scale = 0.2);
6969

7070
std_msgs::msg::ColorRGBA createColorFromString(const std::string & str);
@@ -75,7 +75,7 @@ MarkerArray createObjectPolygonMarkerArray(
7575

7676
MarkerArray createDeviationLines(
7777
const std::vector<Pose> poses1, const std::vector<Pose> poses2, const std::string & ns,
78-
const float r, const float g, const float b);
78+
const int32_t & first_id, const float r, const float g, const float b);
7979

8080
} // namespace marker_utils
8181

evaluator/perception_online_evaluator/param/perception_online_evaluator.defaults.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
prediction_time_horizons: [1.0, 2.0, 3.0, 5.0]
1313

14-
stopped_velocity_threshold: 0.3
14+
stopped_velocity_threshold: 1.0
1515

1616
target_object:
1717
car:

0 commit comments

Comments
 (0)