Skip to content

Commit 8e1b703

Browse files
authored
Merge branch 'main' into add-gtest-of-global-parameter-loader
2 parents dcd336b + 64e2ab3 commit 8e1b703

File tree

823 files changed

+36318
-10552
lines changed

Some content is hidden

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

823 files changed

+36318
-10552
lines changed

.cspell-partial.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"perception/bytetrack/lib/**"
66
],
77
"ignoreRegExpList": [],
8-
"words": []
8+
"words": ["dltype", "tvmgen", "quantizer", "imageio", "mimsave"]
99
}

.github/CODEOWNERS

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

.github/sync-files.yaml

-14
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,6 @@
4242
- \"\"
4343
- -cuda
4444
include:" {source}
45-
- source: .github/workflows/build-and-test-differential.yaml
46-
pre-commands: |
47-
sd "container: ros:(\w+)" "container: ghcr.io/autowarefoundation/autoware-universe:\$1-latest" {source}
48-
49-
sd -s 'container: ${{ matrix.container }}' 'container: ${{ matrix.container }}${{ matrix.container-suffix }}' {source}
50-
sd -- \
51-
" include:" \
52-
" container-suffix:
53-
- \"\"
54-
- -cuda
55-
include:" {source}
56-
57-
sd "^ container: ghcr.io/autowarefoundation/autoware-universe:(\w+)-latest\$" \
58-
" container: ghcr.io/autowarefoundation/autoware-universe:\$1-latest-cuda" {source}
5945
- source: .github/workflows/build-and-test-differential-self-hosted.yaml
6046
pre-commands: |
6147
sd "container: ros:(\w+)" "container: ghcr.io/autowarefoundation/autoware-universe:\$1-latest" {source}

common/autoware_auto_tf2/include/autoware_auto_tf2/tf2_autoware_auto_msgs.hpp

-50
Original file line numberDiff line numberDiff line change
@@ -45,56 +45,6 @@ using BoundingBox = autoware_auto_perception_msgs::msg::BoundingBox;
4545

4646
namespace tf2
4747
{
48-
49-
/*************/
50-
/** Point32 **/
51-
/*************/
52-
53-
/** \brief Apply a geometry_msgs TransformStamped to a geometry_msgs Point32 type.
54-
* This function is a specialization of the doTransform template defined in tf2/convert.h.
55-
* \param t_in The point to transform, as a Point32 message.
56-
* \param t_out The transformed point, as a Point32 message.
57-
* \param transform The timestamped transform to apply, as a TransformStamped message.
58-
*/
59-
template <>
60-
inline void doTransform(
61-
const geometry_msgs::msg::Point32 & t_in, geometry_msgs::msg::Point32 & t_out,
62-
const geometry_msgs::msg::TransformStamped & transform)
63-
{
64-
const KDL::Vector v_out = gmTransformToKDL(transform) * KDL::Vector(t_in.x, t_in.y, t_in.z);
65-
t_out.x = static_cast<float>(v_out[0]);
66-
t_out.y = static_cast<float>(v_out[1]);
67-
t_out.z = static_cast<float>(v_out[2]);
68-
}
69-
70-
/*************/
71-
/** Polygon **/
72-
/*************/
73-
74-
/** \brief Apply a geometry_msgs TransformStamped to a geometry_msgs Polygon type.
75-
* This function is a specialization of the doTransform template defined in tf2/convert.h.
76-
* \param t_in The polygon to transform.
77-
* \param t_out The transformed polygon.
78-
* \param transform The timestamped transform to apply, as a TransformStamped message.
79-
*/
80-
template <>
81-
inline void doTransform(
82-
const geometry_msgs::msg::Polygon & t_in, geometry_msgs::msg::Polygon & t_out,
83-
const geometry_msgs::msg::TransformStamped & transform)
84-
{
85-
// Don't call the Point32 doTransform to avoid doing this conversion every time
86-
const auto kdl_frame = gmTransformToKDL(transform);
87-
// We don't use std::back_inserter to allow aliasing between t_in and t_out
88-
t_out.points.resize(t_in.points.size());
89-
for (size_t i = 0; i < t_in.points.size(); ++i) {
90-
const KDL::Vector v_out =
91-
kdl_frame * KDL::Vector(t_in.points[i].x, t_in.points[i].y, t_in.points[i].z);
92-
t_out.points[i].x = static_cast<float>(v_out[0]);
93-
t_out.points[i].y = static_cast<float>(v_out[1]);
94-
t_out.points[i].z = static_cast<float>(v_out[2]);
95-
}
96-
}
97-
9848
/******************/
9949
/** Quaternion32 **/
10050
/******************/

common/component_interface_specs/CMakeLists.txt

+34
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,38 @@ project(component_interface_specs)
44
find_package(autoware_cmake REQUIRED)
55
autoware_package()
66

7+
include_directories(
8+
include
9+
SYSTEM
10+
${rclcpp_INCLUDE_DIRS}
11+
${rosidl_runtime_cpp_INCLUDE_DIRS}
12+
${rcl_INCLUDE_DIRS}
13+
${autoware_adapi_v1_msgs_INCLUDE_DIRS}
14+
${autoware_auto_planning_msgs_INCLUDE_DIRS}
15+
${autoware_planning_msgs_INCLUDE_DIRS}
16+
${autoware_auto_vehicle_msgs_INCLUDE_DIRS}
17+
${tier4_control_msgs_INCLUDE_DIRS}
18+
${nav_msgs_INCLUDE_DIRS}
19+
${tier4_system_msgs_INCLUDE_DIRS}
20+
${tier4_vehicle_msgs_INCLUDE_DIRS}
21+
${autoware_auto_perception_msgs_INCLUDE_DIRS}
22+
${tier4_map_msgs_INCLUDE_DIRS}
23+
)
24+
25+
if(BUILD_TESTING)
26+
ament_add_ros_isolated_gtest(test_component_interface_specs
27+
test/gtest_main.cpp
28+
test/test_planning.cpp
29+
test/test_control.cpp
30+
test/test_localization.cpp
31+
test/test_system.cpp
32+
test/test_map.cpp
33+
test/test_perception.cpp
34+
test/test_vehicle.cpp
35+
)
36+
target_include_directories(test_component_interface_specs
37+
PRIVATE include
38+
)
39+
endif()
40+
741
ament_auto_package()

common/component_interface_specs/package.xml

+16-1
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,28 @@
1111
<license>Apache License 2.0</license>
1212

1313
<buildtool_depend>ament_cmake_auto</buildtool_depend>
14+
<buildtool_depend>ament_cmake_core</buildtool_depend>
15+
<buildtool_depend>ament_cmake_export_dependencies</buildtool_depend>
16+
<buildtool_depend>ament_cmake_test</buildtool_depend>
1417
<buildtool_depend>autoware_cmake</buildtool_depend>
1518

19+
<buildtool_export_depend>ament_cmake_core</buildtool_export_depend>
20+
<buildtool_export_depend>ament_cmake_test</buildtool_export_depend>
21+
1622
<depend>autoware_adapi_v1_msgs</depend>
23+
<depend>autoware_auto_perception_msgs</depend>
24+
<depend>autoware_auto_planning_msgs</depend>
1725
<depend>autoware_auto_vehicle_msgs</depend>
26+
<depend>autoware_planning_msgs</depend>
27+
<depend>nav_msgs</depend>
28+
<depend>rcl</depend>
29+
<depend>rclcpp</depend>
30+
<depend>rosidl_runtime_cpp</depend>
31+
<depend>tier4_control_msgs</depend>
1832
<depend>tier4_map_msgs</depend>
33+
<depend>tier4_system_msgs</depend>
1934
<depend>tier4_vehicle_msgs</depend>
20-
35+
<test_depend>ament_cmake_ros</test_depend>
2136
<test_depend>ament_lint_auto</test_depend>
2237
<test_depend>autoware_lint_common</test_depend>
2338

common/motion_utils/src/motion_utils.cpp common/component_interface_specs/test/gtest_main.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Tier IV, Inc.
1+
// Copyright 2023 The Autoware Contributors
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -12,4 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "motion_utils/motion_utils.hpp"
15+
#include "gtest/gtest.h"
16+
17+
int main(int argc, char * argv[])
18+
{
19+
::testing::InitGoogleTest(&argc, argv);
20+
return RUN_ALL_TESTS();
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright 2023 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+
#include "component_interface_specs/control.hpp"
16+
#include "gtest/gtest.h"
17+
18+
TEST(control, interface)
19+
{
20+
{
21+
using control_interface::IsPaused;
22+
IsPaused is_paused;
23+
size_t depth = 1;
24+
EXPECT_EQ(is_paused.depth, depth);
25+
EXPECT_EQ(is_paused.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE);
26+
EXPECT_EQ(is_paused.durability, RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL);
27+
}
28+
29+
{
30+
using control_interface::IsStartRequested;
31+
IsStartRequested is_start_requested;
32+
size_t depth = 1;
33+
EXPECT_EQ(is_start_requested.depth, depth);
34+
EXPECT_EQ(is_start_requested.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE);
35+
EXPECT_EQ(is_start_requested.durability, RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL);
36+
}
37+
38+
{
39+
using control_interface::IsStopped;
40+
IsStopped is_stopped;
41+
size_t depth = 1;
42+
EXPECT_EQ(is_stopped.depth, depth);
43+
EXPECT_EQ(is_stopped.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE);
44+
EXPECT_EQ(is_stopped.durability, RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL);
45+
}
46+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright 2023 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+
#include "component_interface_specs/localization.hpp"
16+
#include "gtest/gtest.h"
17+
18+
TEST(localization, interface)
19+
{
20+
{
21+
using localization_interface::InitializationState;
22+
InitializationState initialization_state;
23+
size_t depth = 1;
24+
EXPECT_EQ(initialization_state.depth, depth);
25+
EXPECT_EQ(initialization_state.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE);
26+
EXPECT_EQ(initialization_state.durability, RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL);
27+
}
28+
29+
{
30+
using localization_interface::KinematicState;
31+
KinematicState kinematic_state;
32+
size_t depth = 1;
33+
EXPECT_EQ(kinematic_state.depth, depth);
34+
EXPECT_EQ(kinematic_state.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE);
35+
EXPECT_EQ(kinematic_state.durability, RMW_QOS_POLICY_DURABILITY_VOLATILE);
36+
}
37+
38+
{
39+
using localization_interface::Acceleration;
40+
Acceleration acceleration;
41+
size_t depth = 1;
42+
EXPECT_EQ(acceleration.depth, depth);
43+
EXPECT_EQ(acceleration.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE);
44+
EXPECT_EQ(acceleration.durability, RMW_QOS_POLICY_DURABILITY_VOLATILE);
45+
}
46+
}

common/tier4_autoware_utils/src/tier4_autoware_utils.cpp common/component_interface_specs/test/test_map.cpp

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Tier IV, Inc.
1+
// Copyright 2023 The Autoware Contributors
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -12,4 +12,17 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "tier4_autoware_utils/tier4_autoware_utils.hpp"
15+
#include "component_interface_specs/map.hpp"
16+
#include "gtest/gtest.h"
17+
18+
TEST(map, interface)
19+
{
20+
{
21+
using map_interface::MapProjectorInfo;
22+
MapProjectorInfo map_projector;
23+
size_t depth = 1;
24+
EXPECT_EQ(map_projector.depth, depth);
25+
EXPECT_EQ(map_projector.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE);
26+
EXPECT_EQ(map_projector.durability, RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL);
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2023 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+
#include "component_interface_specs/perception.hpp"
16+
#include "gtest/gtest.h"
17+
18+
TEST(perception, interface)
19+
{
20+
{
21+
using perception_interface::ObjectRecognition;
22+
ObjectRecognition object_recognition;
23+
size_t depth = 1;
24+
EXPECT_EQ(object_recognition.depth, depth);
25+
EXPECT_EQ(object_recognition.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE);
26+
EXPECT_EQ(object_recognition.durability, RMW_QOS_POLICY_DURABILITY_VOLATILE);
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Copyright 2023 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+
#include "component_interface_specs/planning.hpp"
16+
#include "gtest/gtest.h"
17+
18+
TEST(planning, interface)
19+
{
20+
{
21+
using planning_interface::RouteState;
22+
RouteState state;
23+
size_t depth = 1;
24+
EXPECT_EQ(state.depth, depth);
25+
EXPECT_EQ(state.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE);
26+
EXPECT_EQ(state.durability, RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL);
27+
}
28+
29+
{
30+
using planning_interface::Route;
31+
Route route;
32+
size_t depth = 1;
33+
EXPECT_EQ(route.depth, depth);
34+
EXPECT_EQ(route.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE);
35+
EXPECT_EQ(route.durability, RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL);
36+
}
37+
38+
{
39+
using planning_interface::NormalRoute;
40+
NormalRoute route;
41+
size_t depth = 1;
42+
EXPECT_EQ(route.depth, depth);
43+
EXPECT_EQ(route.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE);
44+
EXPECT_EQ(route.durability, RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL);
45+
}
46+
47+
{
48+
using planning_interface::MrmRoute;
49+
MrmRoute route;
50+
size_t depth = 1;
51+
EXPECT_EQ(route.depth, depth);
52+
EXPECT_EQ(route.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE);
53+
EXPECT_EQ(route.durability, RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL);
54+
}
55+
56+
{
57+
using planning_interface::Trajectory;
58+
Trajectory trajectory;
59+
size_t depth = 1;
60+
EXPECT_EQ(trajectory.depth, depth);
61+
EXPECT_EQ(trajectory.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE);
62+
EXPECT_EQ(trajectory.durability, RMW_QOS_POLICY_DURABILITY_VOLATILE);
63+
}
64+
}

0 commit comments

Comments
 (0)