Skip to content

Commit 0b32b8c

Browse files
authored
Merge branch 'main' into main
2 parents d47faeb + 56ad4b4 commit 0b32b8c

File tree

77 files changed

+3181
-367
lines changed

Some content is hidden

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

77 files changed

+3181
-367
lines changed

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

-35
Original file line numberDiff line numberDiff line change
@@ -73,38 +73,3 @@ jobs:
7373

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

.github/workflows/json-schema-check.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: json-schema-check
22

33
on:
44
pull_request:
5-
paths:
6-
- "**/schema/*.schema.json"
7-
- "**/config/*.param.yaml"
85
workflow_dispatch:
96

107
jobs:

README.md

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
# autoware.universe
1+
# Autoware Universe
22

3-
For Autoware's general documentation, see [Autoware Documentation](https://autowarefoundation.github.io/autoware-documentation/).
3+
## Welcome to Autoware Universe
44

5-
For detailed documents of Autoware Universe components, see [Autoware Universe Documentation](https://autowarefoundation.github.io/autoware.universe/).
5+
Autoware Universe serves as a foundational pillar within the Autoware ecosystem, playing a critical role in enhancing the core functionalities of autonomous driving technologies.
6+
This repository is a pivotal element of the Autoware Core/Universe concept, managing a wide array of packages that significantly extend the capabilities of autonomous vehicles.
67

7-
---
8+
![autoware_universe_front](docs/assets/images/autoware_universe_front.png)
9+
10+
## Getting Started
11+
12+
To dive into the vast world of Autoware and understand how Autoware Universe fits into the bigger picture, we recommend starting with the [Autoware Documentation](https://autowarefoundation.github.io/autoware-documentation/). This resource provides a thorough overview of the Autoware ecosystem, guiding you through its components, functionalities, and how to get started with development.
13+
14+
### Explore Autoware Universe documentation
15+
16+
For those looking to explore the specifics of Autoware Universe components, the [Autoware Universe Documentation](https://autowarefoundation.github.io/autoware.universe/), deployed with MKDocs, offers detailed insights.

common/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<test_depend>ament_lint_auto</test_depend>
2424
<test_depend>autoware_lint_common</test_depend>
2525

26-
<buildtool_depend>ament_cmake</buildtool_depend>
26+
<buildtool_depend>ament_cmake_auto</buildtool_depend>
2727

2828
<export>
2929
<build_type>ament_cmake</build_type>

common/tensorrt_common/package.xml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
<author email="taichi.higashide@tier4.jp">Taichi Higashide</author>
88
<author email="daisuke.nishimatsu@tier4.jp">Daisuke Nishimatsu</author>
9-
<maintainer email="daisuke.nishimatsu@tier4.jp">Daisuke Nishimatsu</maintainer>
109
<maintainer email="dan.umeda@tier4.jp">Dan Umeda</maintainer>
1110
<maintainer email="manato.hirabayashi@tier4.jp">Manato Hirabayashi</maintainer>
1211

common/tier4_autoware_utils/include/tier4_autoware_utils/geometry/boost_geometry.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <boost/geometry/core/cs.hpp>
1919
#include <boost/geometry/geometries/geometries.hpp>
2020
#include <boost/geometry/geometries/register/point.hpp>
21+
#include <boost/geometry/geometries/register/ring.hpp>
2122

2223
#define EIGEN_MPL2_ONLY
2324
#include <Eigen/Core>
@@ -98,5 +99,6 @@ BOOST_GEOMETRY_REGISTER_POINT_2D( // NOLIN
9899
tier4_autoware_utils::Point2d, double, cs::cartesian, x(), y()) // NOLINT
99100
BOOST_GEOMETRY_REGISTER_POINT_3D( // NOLINT
100101
tier4_autoware_utils::Point3d, double, cs::cartesian, x(), y(), z()) // NOLINT
102+
BOOST_GEOMETRY_REGISTER_RING(tier4_autoware_utils::LinearRing2d) // NOLINT
101103

102104
#endif // TIER4_AUTOWARE_UTILS__GEOMETRY__BOOST_GEOMETRY_HPP_

common/traffic_light_utils/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<name>traffic_light_utils</name>
55
<version>0.1.0</version>
66
<description>The traffic_light_utils package</description>
7-
<maintainer email="mingyu.li@tier4.jp">Mingyu Li</maintainer>
7+
<maintainer email="kotaro.uetake@tier4.jp">Kotaro Uetake</maintainer>
88
<maintainer email="shunsuke.miura@tier4.jp">Shunsuke Miura</maintainer>
99
<maintainer email="satoshi.ota@tier4.jp">Satoshi Ota</maintainer>
1010
<license>Apache License 2.0</license>

control/lane_departure_checker/include/lane_departure_checker/lane_departure_checker.hpp

+20-1
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,20 @@
2929
#include <geometry_msgs/msg/twist_stamped.hpp>
3030
#include <nav_msgs/msg/odometry.hpp>
3131

32+
#include <boost/geometry/algorithms/envelope.hpp>
33+
#include <boost/geometry/algorithms/union.hpp>
3234
#include <boost/geometry/index/rtree.hpp>
33-
#include <boost/optional.hpp>
3435

3536
#include <lanelet2_core/LaneletMap.h>
37+
#include <lanelet2_core/geometry/BoundingBox.h>
38+
#include <lanelet2_core/geometry/LaneletMap.h>
39+
#include <lanelet2_core/geometry/LineString.h>
40+
#include <lanelet2_core/geometry/Polygon.h>
3641

3742
#include <map>
3843
#include <memory>
3944
#include <string>
45+
#include <utility>
4046
#include <vector>
4147

4248
namespace lane_departure_checker
@@ -112,6 +118,19 @@ class LaneDepartureChecker
112118
bool checkPathWillLeaveLane(
113119
const lanelet::ConstLanelets & lanelets, const PathWithLaneId & path) const;
114120

121+
std::vector<std::pair<double, lanelet::Lanelet>> getLaneletsFromPath(
122+
const lanelet::LaneletMapPtr lanelet_map_ptr, const PathWithLaneId & path) const;
123+
124+
std::optional<lanelet::BasicPolygon2d> getFusedLaneletPolygonForPath(
125+
const lanelet::LaneletMapPtr lanelet_map_ptr, const PathWithLaneId & path) const;
126+
127+
bool checkPathWillLeaveLane(
128+
const lanelet::LaneletMapPtr lanelet_map_ptr, const PathWithLaneId & path) const;
129+
130+
PathWithLaneId cropPointsOutsideOfLanes(
131+
const lanelet::LaneletMapPtr lanelet_map_ptr, const PathWithLaneId & path,
132+
const size_t end_index);
133+
115134
static bool isOutOfLane(
116135
const lanelet::ConstLanelets & candidate_lanelets, const LinearRing2d & vehicle_footprint);
117136

control/lane_departure_checker/src/lane_departure_checker_node/lane_departure_checker.cpp

+89
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ using motion_utils::calcArcLength;
3434
using tier4_autoware_utils::LinearRing2d;
3535
using tier4_autoware_utils::LineString2d;
3636
using tier4_autoware_utils::MultiPoint2d;
37+
using tier4_autoware_utils::MultiPolygon2d;
3738
using tier4_autoware_utils::Point2d;
3839

3940
namespace
@@ -92,6 +93,7 @@ lanelet::ConstLanelets getCandidateLanelets(
9293

9394
return candidate_lanelets;
9495
}
96+
9597
} // namespace
9698

9799
namespace lane_departure_checker
@@ -298,6 +300,92 @@ bool LaneDepartureChecker::willLeaveLane(
298300
return false;
299301
}
300302

303+
std::vector<std::pair<double, lanelet::Lanelet>> LaneDepartureChecker::getLaneletsFromPath(
304+
const lanelet::LaneletMapPtr lanelet_map_ptr, const PathWithLaneId & path) const
305+
{
306+
// Get Footprint Hull basic polygon
307+
std::vector<LinearRing2d> vehicle_footprints = createVehicleFootprints(path);
308+
LinearRing2d footprint_hull = createHullFromFootprints(vehicle_footprints);
309+
auto to_basic_polygon = [](const LinearRing2d & footprint_hull) -> lanelet::BasicPolygon2d {
310+
lanelet::BasicPolygon2d basic_polygon;
311+
for (const auto & point : footprint_hull) {
312+
Eigen::Vector2d p(point.x(), point.y());
313+
basic_polygon.push_back(p);
314+
}
315+
return basic_polygon;
316+
};
317+
lanelet::BasicPolygon2d footprint_hull_basic_polygon = to_basic_polygon(footprint_hull);
318+
319+
// Find all lanelets that intersect the footprint hull
320+
return lanelet::geometry::findWithin2d(
321+
lanelet_map_ptr->laneletLayer, footprint_hull_basic_polygon, 0.0);
322+
}
323+
324+
std::optional<lanelet::BasicPolygon2d> LaneDepartureChecker::getFusedLaneletPolygonForPath(
325+
const lanelet::LaneletMapPtr lanelet_map_ptr, const PathWithLaneId & path) const
326+
{
327+
const auto lanelets_distance_pair = getLaneletsFromPath(lanelet_map_ptr, path);
328+
// Fuse lanelets into a single BasicPolygon2d
329+
auto fused_lanelets = [&lanelets_distance_pair]() -> std::optional<lanelet::BasicPolygon2d> {
330+
if (lanelets_distance_pair.empty()) return std::nullopt;
331+
if (lanelets_distance_pair.size() == 1)
332+
return lanelets_distance_pair.at(0).second.polygon2d().basicPolygon();
333+
334+
lanelet::BasicPolygon2d merged_polygon =
335+
lanelets_distance_pair.at(0).second.polygon2d().basicPolygon();
336+
for (size_t i = 1; i < lanelets_distance_pair.size(); ++i) {
337+
const auto & route_lanelet = lanelets_distance_pair.at(i).second;
338+
const auto & poly = route_lanelet.polygon2d().basicPolygon();
339+
340+
std::vector<lanelet::BasicPolygon2d> lanelet_union_temp;
341+
boost::geometry::union_(poly, merged_polygon, lanelet_union_temp);
342+
343+
// Update merged_polygon by accumulating all merged results
344+
merged_polygon.clear();
345+
for (const auto & temp_poly : lanelet_union_temp) {
346+
merged_polygon.insert(merged_polygon.end(), temp_poly.begin(), temp_poly.end());
347+
}
348+
}
349+
if (merged_polygon.empty()) return std::nullopt;
350+
return merged_polygon;
351+
}();
352+
353+
return fused_lanelets;
354+
}
355+
356+
bool LaneDepartureChecker::checkPathWillLeaveLane(
357+
const lanelet::LaneletMapPtr lanelet_map_ptr, const PathWithLaneId & path) const
358+
{
359+
// check if the footprint is not fully contained within the fused lanelets polygon
360+
const std::vector<LinearRing2d> vehicle_footprints = createVehicleFootprints(path);
361+
const auto fused_lanelets_polygon = getFusedLaneletPolygonForPath(lanelet_map_ptr, path);
362+
if (!fused_lanelets_polygon) return true;
363+
return !std::all_of(
364+
vehicle_footprints.begin(), vehicle_footprints.end(),
365+
[&fused_lanelets_polygon](const auto & footprint) {
366+
return boost::geometry::within(footprint, fused_lanelets_polygon.value());
367+
});
368+
}
369+
370+
PathWithLaneId LaneDepartureChecker::cropPointsOutsideOfLanes(
371+
const lanelet::LaneletMapPtr lanelet_map_ptr, const PathWithLaneId & path, const size_t end_index)
372+
{
373+
PathWithLaneId temp_path;
374+
const auto fused_lanelets_polygon = getFusedLaneletPolygonForPath(lanelet_map_ptr, path);
375+
if (path.points.empty() || !fused_lanelets_polygon) return temp_path;
376+
const auto vehicle_footprints = createVehicleFootprints(path);
377+
size_t idx = 0;
378+
std::for_each(vehicle_footprints.begin(), vehicle_footprints.end(), [&](const auto & footprint) {
379+
if (idx > end_index || boost::geometry::within(footprint, fused_lanelets_polygon.value())) {
380+
temp_path.points.push_back(path.points.at(idx));
381+
}
382+
++idx;
383+
});
384+
PathWithLaneId cropped_path = path;
385+
cropped_path.points = temp_path.points;
386+
return cropped_path;
387+
}
388+
301389
bool LaneDepartureChecker::isOutOfLane(
302390
const lanelet::ConstLanelets & candidate_lanelets, const LinearRing2d & vehicle_footprint)
303391
{
@@ -364,4 +452,5 @@ bool LaneDepartureChecker::willCrossBoundary(
364452
}
365453
return false;
366454
}
455+
367456
} // namespace lane_departure_checker
2.07 MB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
project(perception_online_evaluator)
3+
4+
find_package(autoware_cmake REQUIRED)
5+
autoware_package()
6+
7+
find_package(pluginlib REQUIRED)
8+
9+
find_package(glog REQUIRED)
10+
11+
ament_auto_add_library(${PROJECT_NAME}_node SHARED
12+
src/metrics_calculator.cpp
13+
src/${PROJECT_NAME}_node.cpp
14+
src/metrics/deviation_metrics.cpp
15+
src/utils/marker_utils.cpp
16+
src/utils/objects_filtering.cpp
17+
)
18+
19+
rclcpp_components_register_node(${PROJECT_NAME}_node
20+
PLUGIN "perception_diagnostics::PerceptionOnlineEvaluatorNode"
21+
EXECUTABLE ${PROJECT_NAME}
22+
)
23+
24+
rclcpp_components_register_node(${PROJECT_NAME}_node
25+
PLUGIN "perception_diagnostics::MotionEvaluatorNode"
26+
EXECUTABLE motion_evaluator
27+
)
28+
29+
target_link_libraries(${PROJECT_NAME}_node glog::glog)
30+
31+
if(BUILD_TESTING)
32+
ament_add_ros_isolated_gtest(test_${PROJECT_NAME}
33+
test/test_perception_online_evaluator_node.cpp
34+
)
35+
target_link_libraries(test_${PROJECT_NAME}
36+
${PROJECT_NAME}_node
37+
)
38+
endif()
39+
40+
ament_auto_package(
41+
INSTALL_TO_SHARE
42+
param
43+
launch
44+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Perception Evaluator
2+
3+
A node for evaluating the output of perception systems.
4+
5+
## Purpose
6+
7+
This module allows for the evaluation of how accurately perception results are generated without the need for annotations. It is capable of confirming performance and can evaluate results from a few seconds prior, enabling online execution.
8+
9+
## Inner-workings / Algorithms
10+
11+
- Calculates lateral deviation between the predicted path and the actual traveled trajectory.
12+
- Calculates lateral deviation between the smoothed traveled trajectory and the perceived position to evaluate the stability of lateral position recognition.
13+
- Calculates yaw deviation between the smoothed traveled trajectory and the perceived position to evaluate the stability of yaw recognition.
14+
15+
## Inputs / Outputs
16+
17+
| Name | Type | Description |
18+
| ----------------- | ------------------------------------------------------ | ------------------------------------------------- |
19+
| `~/input/objects` | `autoware_auto_perception_msgs::msg::PredictedObjects` | The predicted objects to evaluate. |
20+
| `~/metrics` | `diagnostic_msgs::msg::DiagnosticArray` | Diagnostic information about perception accuracy. |
21+
| `~/markers` | `visualization_msgs::msg::MarkerArray` | Visual markers for debugging and visualization. |
22+
23+
## Parameters
24+
25+
| Name | Type | Description |
26+
| --------------------------------- | ------------ | ------------------------------------------------------------------------------------------------ |
27+
| `selected_metrics` | List | Metrics to be evaluated, such as lateral deviation, yaw deviation, and predicted path deviation. |
28+
| `smoothing_window_size` | Integer | Determines the window size for smoothing path, should be an odd number. |
29+
| `prediction_time_horizons` | list[double] | Time horizons for prediction evaluation in seconds. |
30+
| `target_object.*.check_deviation` | bool | Whether to check deviation for specific object types (car, truck, etc.). |
31+
| `debug_marker.*` | bool | Debugging parameters for marker visualization (history path, predicted path, etc.). |
32+
33+
## Assumptions / Known limits
34+
35+
It is assumed that the current positions of PredictedObjects are reasonably accurate.
36+
37+
## Future extensions / Unimplemented parts
38+
39+
- Increase rate in recognition per class
40+
- Metrics for objects with strange physical behavior (e.g., going through a fence)
41+
- Metrics for splitting objects
42+
- Metrics for problems with objects that are normally stationary but move
43+
- Disappearing object metrics

0 commit comments

Comments
 (0)