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..c514afb3 --- /dev/null +++ b/common/autoware_core_component_interface_specs/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.14) +project(autoware_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..772adf47 --- /dev/null +++ b/common/autoware_core_component_interface_specs/README.md @@ -0,0 +1,48 @@ +# autoware_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 + +## Usage + +To use these interface specifications in your component: + +1. Add this package as a dependency in your package.xml: + +```xml +autoware_core_component_interface_specs +``` + +2. Use the provided interfaces in your component code. + +```cpp +#include + +// Example: Creating a publisher using the interface specs +rclcpp::Publisher::SharedPtr publisher_ = +create_publisher( +KinematicState::name, +KinematicState::get_qos()); + +// Example: Creating a subscription using the interface specs +auto subscriber_ = create_subscription( +KinematicState::name, +KinematicState::get_qos(), +std::bind(&YourClass::callback, this, std::placeholders::1)); +``` diff --git a/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/base.hpp b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/base.hpp new file mode 100644 index 00000000..a738fb5a --- /dev/null +++ b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/base.hpp @@ -0,0 +1,42 @@ +// 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__BASE_HPP_ +#define AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__BASE_HPP_ + +#include + +#include +#include +#include + +namespace autoware::component_interface_specs +{ + +struct InterfaceBase +{ + static constexpr char name[] = ""; + static constexpr size_t depth = 1; + static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; + static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_VOLATILE; + + static rclcpp::QoS get_qos() + { + return rclcpp::QoS{depth}.reliability(reliability).durability(durability); + } +}; + +} // namespace autoware::component_interface_specs + +#endif // AUTOWARE__CORE_COMPONENT_INTERFACE_SPECS__BASE_HPP_ 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..779ce913 --- /dev/null +++ b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/control.hpp @@ -0,0 +1,37 @@ +// 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 + +#include + +namespace autoware::component_interface_specs::control +{ + +struct ControlCommand : InterfaceBase +{ + 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::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..5ff82b20 --- /dev/null +++ b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/localization.hpp @@ -0,0 +1,47 @@ +// 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 +#include + +namespace autoware::component_interface_specs::localization +{ + +struct KinematicState : InterfaceBase +{ + 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 : InterfaceBase +{ + 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::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..30b188e7 --- /dev/null +++ b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/map.hpp @@ -0,0 +1,57 @@ +// 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 +#include + +namespace autoware::component_interface_specs::map +{ + +struct MapProjectorInfo : InterfaceBase +{ + 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 : InterfaceBase +{ + 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 : InterfaceBase +{ + 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::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..74917f5b --- /dev/null +++ b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/perception.hpp @@ -0,0 +1,37 @@ +// 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 + +#include + +namespace autoware::component_interface_specs::perception +{ + +struct ObjectRecognition : InterfaceBase +{ + 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::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..702218ce --- /dev/null +++ b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/planning.hpp @@ -0,0 +1,47 @@ +// 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 +#include + +namespace autoware::component_interface_specs::planning +{ + +struct LaneletRoute : InterfaceBase +{ + 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 : InterfaceBase +{ + 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::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..abcb77f0 --- /dev/null +++ b/common/autoware_core_component_interface_specs/include/autoware/core_component_interface_specs/vehicle.hpp @@ -0,0 +1,69 @@ +// 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 "base.hpp" + +#include +#include + +#include +#include +#include +#include + +namespace autoware::component_interface_specs::vehicle +{ + +struct SteeringStatus : InterfaceBase +{ + 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 : InterfaceBase +{ + 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 : InterfaceBase +{ + 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 : InterfaceBase +{ + 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::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..0b831476 --- /dev/null +++ b/common/autoware_core_component_interface_specs/package.xml @@ -0,0 +1,34 @@ + + + + autoware_component_interface_specs + 0.0.0 + The autoware_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 + rcl + rclcpp + rosidl_runtime_cpp + sensor_msgs + + 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..bec8ce7a --- /dev/null +++ b/common/autoware_core_component_interface_specs/test/test_control.cpp @@ -0,0 +1,20 @@ +// 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..bd202537 --- /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::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::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..8f1e057d --- /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::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::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::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..8ad6d9df --- /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::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..ad8bd353 --- /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::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::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..39a4a7f6 --- /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::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::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::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::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); + } +}