diff --git a/common/autoware_core_component_interface_specs/CMakeLists.txt b/common/autoware_core_component_interface_specs/CMakeLists.txt new file mode 100644 index 00000000..c6912cd2 --- /dev/null +++ b/common/autoware_core_component_interface_specs/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.14) +project(autoware_core_component_interface_specs) + +find_package(autoware_cmake REQUIRED) +autoware_package() + +if(BUILD_TESTING) + ament_auto_add_gtest(gtest_${PROJECT_NAME} + test/gtest_main.cpp + test/test_planning.cpp + test/test_control.cpp + test/test_localization.cpp + test/test_map.cpp + test/test_perception.cpp + test/test_vehicle.cpp + ) +endif() + +ament_auto_package() diff --git a/common/autoware_core_component_interface_specs/README.md b/common/autoware_core_component_interface_specs/README.md new file mode 100644 index 00000000..d216477d --- /dev/null +++ b/common/autoware_core_component_interface_specs/README.md @@ -0,0 +1,18 @@ +# autoware_core_component_interface_specs + +This package defines the standardized component interface specifications for Autoware Core, ensuring consistent communication and interaction between various components in the Autoware autonomous driving stack. + +## Purpose + +The purpose of this package is to: +- Provide a single source of truth for component interface definitions +- Ensure consistency across different implementations +- Facilitate modular development and component interchangeability +- Document the communication protocols between Autoware Core components + +## Structure + +The package contains interface specifications for various components, including: +- Message definitions +- Service interfaces +- Action interfaces diff --git a/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/control.hpp b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/control.hpp new file mode 100644 index 00000000..fe3d26b9 --- /dev/null +++ b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/control.hpp @@ -0,0 +1,36 @@ +// Copyright 2022 TIER IV, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__CONTROL_HPP_ +#define AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__CONTROL_HPP_ + +#include + +#include + +namespace autoware::core_component_interface_specs::control +{ + +struct ControlCommand +{ + using Message = autoware_control_msgs::msg::Control; + static constexpr char name[] = "/control/command/control_cmd"; + static constexpr size_t depth = 1; + static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; + static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL; +}; + +} // namespace autoware::core_component_interface_specs::control + +#endif // AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__CONTROL_HPP_ diff --git a/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/localization.hpp b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/localization.hpp new file mode 100644 index 00000000..8a74d08e --- /dev/null +++ b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/localization.hpp @@ -0,0 +1,46 @@ +// Copyright 2022 TIER IV, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__LOCALIZATION_HPP_ +#define AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__LOCALIZATION_HPP_ + +#include + +#include +#include + +namespace autoware::core_component_interface_specs::localization +{ + +struct KinematicState +{ + using Message = nav_msgs::msg::Odometry; + static constexpr char name[] = "/localization/kinematic_state"; + static constexpr size_t depth = 1; + static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; + static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_VOLATILE; +}; + +struct Acceleration +{ + using Message = geometry_msgs::msg::AccelWithCovarianceStamped; + static constexpr char name[] = "/localization/acceleration"; + static constexpr size_t depth = 1; + static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; + static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_VOLATILE; +}; + +} // namespace autoware::core_component_interface_specs::localization + +#endif // AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__LOCALIZATION_HPP_ diff --git a/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/map.hpp b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/map.hpp new file mode 100644 index 00000000..bdb181fa --- /dev/null +++ b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/map.hpp @@ -0,0 +1,56 @@ +// Copyright 2023 TIER IV, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__MAP_HPP_ +#define AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__MAP_HPP_ + +#include + +#include +#include +#include + +namespace autoware::core_component_interface_specs::map +{ + +struct MapProjectorInfo +{ + using Message = autoware_map_msgs::msg::MapProjectorInfo; + static constexpr char name[] = "/map/map_projector_info"; + static constexpr size_t depth = 1; + static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; + static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL; +}; + +struct PointCloudMap +{ + using Message = sensor_msgs::msg::PointCloud2; + static constexpr char name[] = "/map/point_cloud_map"; + static constexpr size_t depth = 1; + static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; + static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL; +}; + +struct VectorMap +{ + using Message = autoware_map_msgs::msg::LaneletMapBin; + static constexpr char name[] = "/map/vector_map"; + static constexpr size_t depth = 1; + static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; + static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL; +}; + +} // namespace autoware::core_component_interface_specs::map + +#endif // AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__MAP_HPP_ diff --git a/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/perception.hpp b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/perception.hpp new file mode 100644 index 00000000..1654d56d --- /dev/null +++ b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/perception.hpp @@ -0,0 +1,36 @@ +// Copyright 2022 TIER IV, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__PERCEPTION_HPP_ +#define AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__PERCEPTION_HPP_ + +#include + +#include + +namespace autoware::core_component_interface_specs::perception +{ + +struct ObjectRecognition +{ + using Message = autoware_perception_msgs::msg::PredictedObjects; + static constexpr char name[] = "/perception/object_recognition/objects"; + static constexpr size_t depth = 1; + static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; + static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_VOLATILE; +}; + +} // namespace autoware::core_component_interface_specs::perception + +#endif // AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__PERCEPTION_HPP_ diff --git a/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/planning.hpp b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/planning.hpp new file mode 100644 index 00000000..50d5ccc6 --- /dev/null +++ b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/planning.hpp @@ -0,0 +1,46 @@ +// Copyright 2022 TIER IV, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__PLANNING_HPP_ +#define AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__PLANNING_HPP_ + +#include + +#include +#include + +namespace autoware::core_component_interface_specs::planning +{ + +struct LaneletRoute +{ + using Message = autoware_planning_msgs::msg::LaneletRoute; + static constexpr char name[] = "/planning/mission_planning/route_selector/main/route"; + static constexpr size_t depth = 1; + static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; + static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL; +}; + +struct Trajectory +{ + using Message = autoware_planning_msgs::msg::Trajectory; + static constexpr char name[] = "/planning/scenario_planning/trajectory"; + static constexpr size_t depth = 1; + static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; + static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_VOLATILE; +}; + +} // namespace autoware::core_component_interface_specs::planning + +#endif // AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__PLANNING_HPP_ diff --git a/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/vehicle.hpp b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/vehicle.hpp new file mode 100644 index 00000000..b942ee2d --- /dev/null +++ b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/vehicle.hpp @@ -0,0 +1,66 @@ +// Copyright 2023 TIER IV, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__VEHICLE_HPP_ +#define AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__VEHICLE_HPP_ + +#include + +#include +#include +#include +#include + +namespace autoware::core_component_interface_specs::vehicle +{ + +struct SteeringStatus +{ + using Message = autoware_vehicle_msgs::msg::SteeringReport; + static constexpr char name[] = "/vehicle/status/steering_status"; + static constexpr size_t depth = 1; + static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; + static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_VOLATILE; +}; + +struct GearStatus +{ + using Message = autoware_vehicle_msgs::msg::GearReport; + static constexpr char name[] = "/vehicle/status/gear_status"; + static constexpr size_t depth = 1; + static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; + static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_VOLATILE; +}; + +struct TurnIndicatorStatus +{ + using Message = autoware_vehicle_msgs::msg::TurnIndicatorsReport; + static constexpr char name[] = "/vehicle/status/turn_indicators_status"; + static constexpr size_t depth = 1; + static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; + static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_VOLATILE; +}; + +struct HazardLightStatus +{ + using Message = autoware_vehicle_msgs::msg::HazardLightsReport; + static constexpr char name[] = "/vehicle/status/hazard_lights_status"; + static constexpr size_t depth = 1; + static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; + static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_VOLATILE; +}; + +} // namespace autoware::core_component_interface_specs::vehicle + +#endif // AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__VEHICLE_HPP_ diff --git a/common/autoware_core_component_interface_specs/package.xml b/common/autoware_core_component_interface_specs/package.xml new file mode 100644 index 00000000..01755da4 --- /dev/null +++ b/common/autoware_core_component_interface_specs/package.xml @@ -0,0 +1,34 @@ + + + + autoware_core_component_interface_specs + 0.0.0 + The autoware_core_component_interface_specs package + Takagi, Isamu + Yukihiro Saito + Ryohsuke Mitsudome + Apache License 2.0 + + ament_cmake_auto + autoware_cmake + + autoware_control_msgs + autoware_localization_msgs + autoware_map_msgs + autoware_perception_msgs + autoware_planning_msgs + autoware_vehicle_msgs + nav_msgs + sensor_msgs + rcl + rclcpp + rosidl_runtime_cpp + + ament_cmake_gtest + ament_lint_auto + autoware_lint_common + + + ament_cmake + + diff --git a/common/autoware_core_component_interface_specs/test/gtest_main.cpp b/common/autoware_core_component_interface_specs/test/gtest_main.cpp new file mode 100644 index 00000000..81d9d534 --- /dev/null +++ b/common/autoware_core_component_interface_specs/test/gtest_main.cpp @@ -0,0 +1,21 @@ +// Copyright 2023 The Autoware Contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "gtest/gtest.h" + +int main(int argc, char * argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/common/autoware_core_component_interface_specs/test/test_control.cpp b/common/autoware_core_component_interface_specs/test/test_control.cpp new file mode 100644 index 00000000..e6e0b7c9 --- /dev/null +++ b/common/autoware_core_component_interface_specs/test/test_control.cpp @@ -0,0 +1,21 @@ +// Copyright 2023 The Autoware Contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "autoware/component_interface_specs/control.hpp" +#include "gtest/gtest.h" + +TEST(control, interface) +{ + +} diff --git a/common/autoware_core_component_interface_specs/test/test_localization.cpp b/common/autoware_core_component_interface_specs/test/test_localization.cpp new file mode 100644 index 00000000..0fdd510e --- /dev/null +++ b/common/autoware_core_component_interface_specs/test/test_localization.cpp @@ -0,0 +1,37 @@ +// Copyright 2023 The Autoware Contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "autoware/component_interface_specs/localization.hpp" +#include "gtest/gtest.h" + +TEST(localization, interface) +{ + { + using autoware::core_component_interface_specs::localization::KinematicState; + KinematicState kinematic_state; + size_t depth = 1; + EXPECT_EQ(kinematic_state.depth, depth); + EXPECT_EQ(kinematic_state.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE); + EXPECT_EQ(kinematic_state.durability, RMW_QOS_POLICY_DURABILITY_VOLATILE); + } + + { + using autoware::core_component_interface_specs::localization::Acceleration; + Acceleration acceleration; + size_t depth = 1; + EXPECT_EQ(acceleration.depth, depth); + EXPECT_EQ(acceleration.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE); + EXPECT_EQ(acceleration.durability, RMW_QOS_POLICY_DURABILITY_VOLATILE); + } +} diff --git a/common/autoware_core_component_interface_specs/test/test_map.cpp b/common/autoware_core_component_interface_specs/test/test_map.cpp new file mode 100644 index 00000000..a33fecb5 --- /dev/null +++ b/common/autoware_core_component_interface_specs/test/test_map.cpp @@ -0,0 +1,46 @@ +// Copyright 2023 The Autoware Contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "autoware/component_interface_specs/map.hpp" +#include "gtest/gtest.h" + +TEST(map, interface) +{ + { + using autoware::core_component_interface_specs::map::MapProjectorInfo; + MapProjectorInfo map_projector; + size_t depth = 1; + EXPECT_EQ(map_projector.depth, depth); + EXPECT_EQ(map_projector.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE); + EXPECT_EQ(map_projector.durability, RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL); + } + + { + using autoware::core_component_interface_specs::map::PointCloudMap; + PointCloudMap point_cloud_map; + size_t depth = 1; + EXPECT_EQ(point_cloud_map.depth, depth); + EXPECT_EQ(point_cloud_map.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE); + EXPECT_EQ(point_cloud_map.durability, RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL); + } + + { + using autoware::core_component_interface_specs::map::VectorMap; + VectorMap vector_map; + size_t depth = 1; + EXPECT_EQ(vector_map.depth, depth); + EXPECT_EQ(vector_map.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE); + EXPECT_EQ(vector_map.durability, RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL); + } +} diff --git a/common/autoware_core_component_interface_specs/test/test_perception.cpp b/common/autoware_core_component_interface_specs/test/test_perception.cpp new file mode 100644 index 00000000..f90498b0 --- /dev/null +++ b/common/autoware_core_component_interface_specs/test/test_perception.cpp @@ -0,0 +1,28 @@ +// Copyright 2023 The Autoware Contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "autoware/component_interface_specs/perception.hpp" +#include "gtest/gtest.h" + +TEST(perception, interface) +{ + { + using autoware::core_component_interface_specs::perception::ObjectRecognition; + ObjectRecognition object_recognition; + size_t depth = 1; + EXPECT_EQ(object_recognition.depth, depth); + EXPECT_EQ(object_recognition.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE); + EXPECT_EQ(object_recognition.durability, RMW_QOS_POLICY_DURABILITY_VOLATILE); + } +} diff --git a/common/autoware_core_component_interface_specs/test/test_planning.cpp b/common/autoware_core_component_interface_specs/test/test_planning.cpp new file mode 100644 index 00000000..c590e1e6 --- /dev/null +++ b/common/autoware_core_component_interface_specs/test/test_planning.cpp @@ -0,0 +1,37 @@ +// Copyright 2023 The Autoware Contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "autoware/component_interface_specs/planning.hpp" +#include "gtest/gtest.h" + +TEST(planning, interface) +{ + { + using autoware::core_component_interface_specs::planning::LaneletRoute; + LaneletRoute route; + size_t depth = 1; + EXPECT_EQ(route.depth, depth); + EXPECT_EQ(route.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE); + EXPECT_EQ(route.durability, RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL); + } + + { + using autoware::core_component_interface_specs::planning::Trajectory; + Trajectory trajectory; + size_t depth = 1; + EXPECT_EQ(trajectory.depth, depth); + EXPECT_EQ(trajectory.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE); + EXPECT_EQ(trajectory.durability, RMW_QOS_POLICY_DURABILITY_VOLATILE); + } +} diff --git a/common/autoware_core_component_interface_specs/test/test_vehicle.cpp b/common/autoware_core_component_interface_specs/test/test_vehicle.cpp new file mode 100644 index 00000000..b8086c05 --- /dev/null +++ b/common/autoware_core_component_interface_specs/test/test_vehicle.cpp @@ -0,0 +1,55 @@ +// Copyright 2023 The Autoware Contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "autoware/component_interface_specs/vehicle.hpp" +#include "gtest/gtest.h" + +TEST(vehicle, interface) +{ + { + using autoware::core_component_interface_specs::vehicle::SteeringStatus; + SteeringStatus status; + size_t depth = 1; + EXPECT_EQ(status.depth, depth); + EXPECT_EQ(status.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE); + EXPECT_EQ(status.durability, RMW_QOS_POLICY_DURABILITY_VOLATILE); + } + + { + using autoware::core_component_interface_specs::vehicle::GearStatus; + GearStatus status; + size_t depth = 1; + EXPECT_EQ(status.depth, depth); + EXPECT_EQ(status.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE); + EXPECT_EQ(status.durability, RMW_QOS_POLICY_DURABILITY_VOLATILE); + } + + { + using autoware::core_component_interface_specs::vehicle::TurnIndicatorStatus; + TurnIndicatorStatus status; + size_t depth = 1; + EXPECT_EQ(status.depth, depth); + EXPECT_EQ(status.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE); + EXPECT_EQ(status.durability, RMW_QOS_POLICY_DURABILITY_VOLATILE); + } + + { + using autoware::core_component_interface_specs::vehicle::HazardLightStatus; + HazardLightStatus status; + size_t depth = 1; + EXPECT_EQ(status.depth, depth); + EXPECT_EQ(status.reliability, RMW_QOS_POLICY_RELIABILITY_RELIABLE); + EXPECT_EQ(status.durability, RMW_QOS_POLICY_DURABILITY_VOLATILE); + } +}