15 #ifndef TRAFFIC_SIMULATOR__TEST__TRAFFIC_LIGHTS__COMMON_TEST_FIXTURES_HPP_
16 #define TRAFFIC_SIMULATOR__TEST__TRAFFIC_LIGHTS__COMMON_TEST_FIXTURES_HPP_
18 #include <gtest/gtest.h>
20 #include <ament_index_cpp/get_package_share_directory.hpp>
27 template <
typename TrafficLightsT, const
char * Architecture>
33 if constexpr (std::is_same_v<TrafficLightsT, traffic_simulator::ConventionalTrafficLights>) {
34 return std::make_unique<TrafficLightsT>(
node_ptr);
35 }
else if constexpr (std::is_same_v<TrafficLightsT, traffic_simulator::V2ITrafficLights>) {
36 return std::make_unique<TrafficLightsT>(
node_ptr, Architecture);
41 std::is_same_v<TrafficLightsT, traffic_simulator::ConventionalTrafficLights> or
42 std::is_same_v<TrafficLightsT, traffic_simulator::V2ITrafficLights>,
43 "Given TrafficLights type is not supported");
45 const auto lanelet_path = ament_index_cpp::get_package_share_directory(
"traffic_simulator") +
46 "/map/standard_map/lanelet2_map.osm";
52 const lanelet::Id
id{34836};
56 const rclcpp::Node::SharedPtr
node_ptr = rclcpp::Node::make_shared(
"TrafficLightsInternalTest");
58 rclcpp::executors::SingleThreadedExecutor
executor;
60 std::unique_ptr<TrafficLightsT>
lights;
63 template <
typename TrafficLightsT>
69 template <
typename TrafficLightsT>
77 template <
typename TrafficLightsT>
80 if constexpr (std::is_same_v<TrafficLightsT, traffic_simulator::ConventionalTrafficLights>) {
81 return "ConventionalTrafficLights";
82 }
else if constexpr (std::is_same_v<TrafficLightsT, traffic_simulator::V2ITrafficLights>) {
83 return "V2ITrafficLights";
Definition: common_test_fixtures.hpp:29
const rclcpp::Node::SharedPtr node_ptr
Definition: common_test_fixtures.hpp:56
std::unique_ptr< TrafficLightsT > lights
Definition: common_test_fixtures.hpp:60
const lanelet::Id signal_id
Definition: common_test_fixtures.hpp:54
TrafficLightsInternalTestArchitectureDependent()
Definition: common_test_fixtures.hpp:31
rclcpp::executors::SingleThreadedExecutor executor
Definition: common_test_fixtures.hpp:58
Definition: common_test_fixtures.hpp:72
Definition: common_test_fixtures.hpp:66
constexpr char architecture_old[]
Definition: common_test_fixtures.hpp:24
constexpr char architecture_new[]
Definition: common_test_fixtures.hpp:25
auto activate(Ts &&... xs)
Definition: lanelet_map.hpp:33
std::string string
Definition: junit5.hpp:26
Definition: common_test_fixtures.hpp:76
static auto GetName(int) -> std::string
Definition: common_test_fixtures.hpp:78