Skip to content

Commit 77ada35

Browse files
Merge pull request #1416 from tier4/sync-upstream
chore: sync tier4/autoware.universe:awf-latest
2 parents 0c4479f + 2ee831e commit 77ada35

File tree

691 files changed

+10887
-4305
lines changed

Some content is hidden

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

691 files changed

+10887
-4305
lines changed

.cppcheck_suppressions

-7
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,15 @@
33
checkersReport
44
constParameterReference
55
constVariableReference
6-
// cspell: ignore cstyle
7-
cstyleCast
86
funcArgNamesDifferent
97
functionConst
108
functionStatic
11-
invalidPointerCast
129
knownConditionTrueFalse
1310
missingInclude
1411
missingIncludeSystem
1512
noConstructor
16-
noExplicitConstructor
17-
noValidConfiguration
1813
passedByValue
19-
preprocessorErrorDirective
2014
redundantInitialization
21-
shadowFunction
2215
shadowVariable
2316
// cspell: ignore uninit
2417
uninitMemberVar

.github/CODEOWNERS

+31-30
Large diffs are not rendered by default.

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

+8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ jobs:
7070
restore-keys: |
7171
ccache-main-${{ runner.arch }}-${{ matrix.rosdistro }}-
7272
73+
# Limit ccache size only for CUDA builds to avoid running out of disk space
74+
- name: Limit ccache size
75+
if: ${{ matrix.container-suffix == '-cuda' }}
76+
run: |
77+
rm -f "${CCACHE_DIR}/ccache.conf"
78+
echo -e "# Set maximum cache size\nmax_size = 1MB" >> "${CCACHE_DIR}/ccache.conf"
79+
shell: bash
80+
7381
- name: Show ccache stats before build
7482
run: du -sh ${CCACHE_DIR} && ccache -s
7583
shell: bash

.github/workflows/cppcheck-differential.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
run: |
5959
filtered_paths=""
6060
for dir in ${{ steps.get-full-paths.outputs.full-paths }}; do
61-
if [ -d "$dir" ] && find "$dir" -name "*.cpp" -o -name "*.hpp" | grep -q .; then
61+
if [ -d "$dir" ] && find "$dir" -name "*.cpp" | grep -q .; then
6262
filtered_paths="$filtered_paths $dir"
6363
fi
6464
done

common/autoware_ad_api_specs/include/autoware_ad_api_specs/vehicle.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct VehicleKinematics
3232
using Message = autoware_adapi_v1_msgs::msg::VehicleKinematics;
3333
static constexpr char name[] = "/api/vehicle/kinematics";
3434
static constexpr size_t depth = 1;
35-
static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE;
35+
static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT;
3636
static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_VOLATILE;
3737
};
3838

common/autoware_motion_utils/include/autoware/motion_utils/trajectory/trajectory.hpp

+33-16
Original file line numberDiff line numberDiff line change
@@ -991,34 +991,51 @@ calcCurvature<std::vector<autoware_planning_msgs::msg::TrajectoryPoint>>(
991991
* curvature calculation
992992
*/
993993
template <class T>
994-
std::vector<std::pair<double, double>> calcCurvatureAndArcLength(const T & points)
994+
std::vector<std::pair<double, std::pair<double, double>>> calcCurvatureAndSegmentLength(
995+
const T & points)
995996
{
996-
// Note that arclength is for the segment, not the sum.
997-
std::vector<std::pair<double, double>> curvature_arc_length_vec;
998-
curvature_arc_length_vec.emplace_back(0.0, 0.0);
997+
// segment length is pair of segment length between {p1, p2} and {p2, p3}
998+
std::vector<std::pair<double, std::pair<double, double>>> curvature_and_segment_length_vec;
999+
curvature_and_segment_length_vec.reserve(points.size());
1000+
curvature_and_segment_length_vec.emplace_back(0.0, std::make_pair(0.0, 0.0));
9991001
for (size_t i = 1; i < points.size() - 1; ++i) {
10001002
const auto p1 = autoware::universe_utils::getPoint(points.at(i - 1));
10011003
const auto p2 = autoware::universe_utils::getPoint(points.at(i));
10021004
const auto p3 = autoware::universe_utils::getPoint(points.at(i + 1));
10031005
const double curvature = autoware::universe_utils::calcCurvature(p1, p2, p3);
1004-
const double arc_length =
1005-
autoware::universe_utils::calcDistance2d(points.at(i - 1), points.at(i)) +
1006-
autoware::universe_utils::calcDistance2d(points.at(i), points.at(i + 1));
1007-
curvature_arc_length_vec.emplace_back(curvature, arc_length);
1006+
1007+
// The first point has only the next point, so put the distance to that point.
1008+
// In other words, assign the first segment length at the second point to the
1009+
// second_segment_length at the first point.
1010+
if (i == 1) {
1011+
curvature_and_segment_length_vec.at(0).second.second =
1012+
autoware::universe_utils::calcDistance2d(p1, p2);
1013+
}
1014+
1015+
// The second_segment_length of the previous point and the first segment length of the current
1016+
// point are equal.
1017+
const std::pair<double, double> arc_length{
1018+
curvature_and_segment_length_vec.back().second.second,
1019+
autoware::universe_utils::calcDistance2d(p2, p3)};
1020+
1021+
curvature_and_segment_length_vec.emplace_back(curvature, arc_length);
10081022
}
1009-
curvature_arc_length_vec.emplace_back(0.0, 0.0);
10101023

1011-
return curvature_arc_length_vec;
1024+
// set to the last point
1025+
curvature_and_segment_length_vec.emplace_back(
1026+
0.0, std::make_pair(curvature_and_segment_length_vec.back().second.second, 0.0));
1027+
1028+
return curvature_and_segment_length_vec;
10121029
}
10131030

1014-
extern template std::vector<std::pair<double, double>>
1015-
calcCurvatureAndArcLength<std::vector<autoware_planning_msgs::msg::PathPoint>>(
1031+
extern template std::vector<std::pair<double, std::pair<double, double>>>
1032+
calcCurvatureAndSegmentLength<std::vector<autoware_planning_msgs::msg::PathPoint>>(
10161033
const std::vector<autoware_planning_msgs::msg::PathPoint> & points);
1017-
extern template std::vector<std::pair<double, double>>
1018-
calcCurvatureAndArcLength<std::vector<tier4_planning_msgs::msg::PathPointWithLaneId>>(
1034+
extern template std::vector<std::pair<double, std::pair<double, double>>>
1035+
calcCurvatureAndSegmentLength<std::vector<tier4_planning_msgs::msg::PathPointWithLaneId>>(
10191036
const std::vector<tier4_planning_msgs::msg::PathPointWithLaneId> & points);
1020-
extern template std::vector<std::pair<double, double>>
1021-
calcCurvatureAndArcLength<std::vector<autoware_planning_msgs::msg::TrajectoryPoint>>(
1037+
extern template std::vector<std::pair<double, std::pair<double, double>>>
1038+
calcCurvatureAndSegmentLength<std::vector<autoware_planning_msgs::msg::TrajectoryPoint>>(
10221039
const std::vector<autoware_planning_msgs::msg::TrajectoryPoint> & points);
10231040

10241041
/**

common/autoware_motion_utils/src/trajectory/trajectory.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,14 @@ calcCurvature<std::vector<autoware_planning_msgs::msg::TrajectoryPoint>>(
238238
const std::vector<autoware_planning_msgs::msg::TrajectoryPoint> & points);
239239

240240
//
241-
template std::vector<std::pair<double, double>>
242-
calcCurvatureAndArcLength<std::vector<autoware_planning_msgs::msg::PathPoint>>(
241+
template std::vector<std::pair<double, std::pair<double, double>>>
242+
calcCurvatureAndSegmentLength<std::vector<autoware_planning_msgs::msg::PathPoint>>(
243243
const std::vector<autoware_planning_msgs::msg::PathPoint> & points);
244-
template std::vector<std::pair<double, double>>
245-
calcCurvatureAndArcLength<std::vector<tier4_planning_msgs::msg::PathPointWithLaneId>>(
244+
template std::vector<std::pair<double, std::pair<double, double>>>
245+
calcCurvatureAndSegmentLength<std::vector<tier4_planning_msgs::msg::PathPointWithLaneId>>(
246246
const std::vector<tier4_planning_msgs::msg::PathPointWithLaneId> & points);
247-
template std::vector<std::pair<double, double>>
248-
calcCurvatureAndArcLength<std::vector<autoware_planning_msgs::msg::TrajectoryPoint>>(
247+
template std::vector<std::pair<double, std::pair<double, double>>>
248+
calcCurvatureAndSegmentLength<std::vector<autoware_planning_msgs::msg::TrajectoryPoint>>(
249249
const std::vector<autoware_planning_msgs::msg::TrajectoryPoint> & points);
250250

251251
//

common/autoware_point_types/include/autoware_point_types/types.hpp

+90-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,23 @@ enum ReturnType : uint8_t {
5454
DUAL_ONLY,
5555
};
5656

57+
struct PointXYZIRC
58+
{
59+
float x{0.0F};
60+
float y{0.0F};
61+
float z{0.0F};
62+
std::uint8_t intensity{0U};
63+
std::uint8_t return_type{0U};
64+
std::uint16_t channel{0U};
65+
66+
friend bool operator==(const PointXYZIRC & p1, const PointXYZIRC & p2) noexcept
67+
{
68+
return float_eq<float>(p1.x, p2.x) && float_eq<float>(p1.y, p2.y) &&
69+
float_eq<float>(p1.z, p2.z) && p1.intensity == p2.intensity &&
70+
p1.return_type == p2.return_type && p1.channel == p2.channel;
71+
}
72+
};
73+
5774
struct PointXYZIRADRT
5875
{
5976
float x{0.0F};
@@ -75,25 +92,97 @@ struct PointXYZIRADRT
7592
}
7693
};
7794

78-
enum class PointIndex { X, Y, Z, Intensity, Ring, Azimuth, Distance, ReturnType, TimeStamp };
95+
struct PointXYZIRCAEDT
96+
{
97+
float x{0.0F};
98+
float y{0.0F};
99+
float z{0.0F};
100+
std::uint8_t intensity{0U};
101+
std::uint8_t return_type{0U};
102+
std::uint16_t channel{0U};
103+
float azimuth{0.0F};
104+
float elevation{0.0F};
105+
float distance{0.0F};
106+
std::uint32_t time_stamp{0U};
107+
108+
friend bool operator==(const PointXYZIRCAEDT & p1, const PointXYZIRCAEDT & p2) noexcept
109+
{
110+
return float_eq<float>(p1.x, p2.x) && float_eq<float>(p1.y, p2.y) &&
111+
float_eq<float>(p1.z, p2.z) && p1.intensity == p2.intensity &&
112+
p1.return_type == p2.return_type && p1.channel == p2.channel &&
113+
float_eq<float>(p1.azimuth, p2.azimuth) && float_eq<float>(p1.distance, p2.distance) &&
114+
p1.time_stamp == p2.time_stamp;
115+
}
116+
};
117+
118+
enum class PointXYZIIndex { X, Y, Z, Intensity };
119+
enum class PointXYZIRCIndex { X, Y, Z, Intensity, ReturnType, Channel };
120+
enum class PointXYZIRADRTIndex {
121+
X,
122+
Y,
123+
Z,
124+
Intensity,
125+
Ring,
126+
Azimuth,
127+
Distance,
128+
ReturnType,
129+
TimeStamp
130+
};
131+
enum class PointXYZIRCAEDTIndex {
132+
X,
133+
Y,
134+
Z,
135+
Intensity,
136+
ReturnType,
137+
Channel,
138+
Azimuth,
139+
Elevation,
140+
Distance,
141+
TimeStamp
142+
};
79143

80144
LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(azimuth);
145+
LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(elevation);
81146
LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(distance);
82147
LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(return_type);
83148
LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(time_stamp);
84149

150+
LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(channel);
151+
152+
using PointXYZIRCGenerator = std::tuple<
153+
point_cloud_msg_wrapper::field_x_generator, point_cloud_msg_wrapper::field_y_generator,
154+
point_cloud_msg_wrapper::field_z_generator, point_cloud_msg_wrapper::field_intensity_generator,
155+
field_return_type_generator, field_channel_generator>;
156+
85157
using PointXYZIRADRTGenerator = std::tuple<
86158
point_cloud_msg_wrapper::field_x_generator, point_cloud_msg_wrapper::field_y_generator,
87159
point_cloud_msg_wrapper::field_z_generator, point_cloud_msg_wrapper::field_intensity_generator,
88160
point_cloud_msg_wrapper::field_ring_generator, field_azimuth_generator, field_distance_generator,
89161
field_return_type_generator, field_time_stamp_generator>;
90162

163+
using PointXYZIRCAEDTGenerator = std::tuple<
164+
point_cloud_msg_wrapper::field_x_generator, point_cloud_msg_wrapper::field_y_generator,
165+
point_cloud_msg_wrapper::field_z_generator, point_cloud_msg_wrapper::field_intensity_generator,
166+
field_return_type_generator, field_channel_generator, field_azimuth_generator,
167+
field_elevation_generator, field_distance_generator, field_time_stamp_generator>;
168+
91169
} // namespace autoware_point_types
92170

171+
POINT_CLOUD_REGISTER_POINT_STRUCT(
172+
autoware_point_types::PointXYZIRC,
173+
(float, x, x)(float, y, y)(float, z, z)(std::uint8_t, intensity, intensity)(
174+
std::uint8_t, return_type, return_type)(std::uint16_t, channel, channel))
175+
93176
POINT_CLOUD_REGISTER_POINT_STRUCT(
94177
autoware_point_types::PointXYZIRADRT,
95178
(float, x, x)(float, y, y)(float, z, z)(float, intensity, intensity)(std::uint16_t, ring, ring)(
96179
float, azimuth, azimuth)(float, distance, distance)(std::uint8_t, return_type, return_type)(
97180
double, time_stamp, time_stamp))
98181

182+
POINT_CLOUD_REGISTER_POINT_STRUCT(
183+
autoware_point_types::PointXYZIRCAEDT,
184+
(float, x, x)(float, y, y)(float, z, z)(std::uint8_t, intensity, intensity)(
185+
std::uint8_t, return_type,
186+
return_type)(std::uint16_t, channel, channel)(float, azimuth, azimuth)(
187+
float, elevation, elevation)(float, distance, distance)(std::uint32_t, time_stamp, time_stamp))
99188
#endif // AUTOWARE_POINT_TYPES__TYPES_HPP_

common/autoware_point_types/test/test_point_types.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ TEST(PointEquality, PointXYZIRADRT)
3636
EXPECT_EQ(pt0, pt1);
3737
}
3838

39+
TEST(PointEquality, PointXYZIRCAEDT)
40+
{
41+
using autoware_point_types::PointXYZIRCAEDT;
42+
43+
PointXYZIRCAEDT pt0{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
44+
PointXYZIRCAEDT pt1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
45+
EXPECT_EQ(pt0, pt1);
46+
}
47+
3948
TEST(PointEquality, FloatEq)
4049
{
4150
// test template

common/autoware_universe_utils/CMakeLists.txt

+25
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
cmake_minimum_required(VERSION 3.14)
22
project(autoware_universe_utils)
33

4+
option(BUILD_EXAMPLES "Build examples" OFF)
5+
46
find_package(autoware_cmake REQUIRED)
57
autoware_package()
68

79
find_package(Boost REQUIRED)
810

11+
find_package(fmt REQUIRED)
12+
913
ament_auto_add_library(autoware_universe_utils SHARED
1014
src/geometry/geometry.cpp
1115
src/geometry/pose_deviation.cpp
@@ -16,6 +20,11 @@ ament_auto_add_library(autoware_universe_utils SHARED
1620
src/ros/marker_helper.cpp
1721
src/ros/logger_level_configure.cpp
1822
src/system/backtrace.cpp
23+
src/system/time_keeper.cpp
24+
)
25+
26+
target_link_libraries(autoware_universe_utils
27+
fmt::fmt
1928
)
2029

2130
if(BUILD_TESTING)
@@ -30,4 +39,20 @@ if(BUILD_TESTING)
3039
)
3140
endif()
3241

42+
if(BUILD_EXAMPLES)
43+
message(STATUS "Building examples")
44+
file(GLOB_RECURSE example_files examples/*.cpp)
45+
46+
foreach(example_file ${example_files})
47+
get_filename_component(example_name ${example_file} NAME_WE)
48+
add_executable(${example_name} ${example_file})
49+
target_link_libraries(${example_name}
50+
autoware_universe_utils
51+
)
52+
install(TARGETS ${example_name}
53+
DESTINATION lib/${PROJECT_NAME}
54+
)
55+
endforeach()
56+
endif()
57+
3358
ament_auto_package()

0 commit comments

Comments
 (0)