1 #include <gtest/gtest.h>
16 std::vector<RoutingGraphConstPtr> graphs{testData.vehicleGraph, testData.pedestrianGraph};
17 container = std::make_unique<RoutingGraphContainer>(graphs);
26 ASSERT_NE(graph->passableSubmap()->laneletLayer.find(from), graph->passableSubmap()->laneletLayer.end());
27 ConstLanelet fromLanelet{*graph->passableSubmap()->laneletLayer.find(from)};
28 ASSERT_NE(graph->passableSubmap()->laneletLayer.find(to), graph->passableSubmap()->laneletLayer.end());
29 ConstLanelet toLanelet{*graph->passableSubmap()->laneletLayer.find(to)};
30 Optional<Route> tempRoute = graph->getRoute(fromLanelet, toLanelet, routingCostId);
31 ASSERT_TRUE(!!tempRoute);
32 route = std::make_unique<Route>(std::move(*tempRoute));
39 ConstLanelet pedestrianLanelet{*laneletMap->laneletLayer.find(2031)};
40 ConstLanelets conflictingVehicle{container->conflictingInGraph(pedestrianLanelet, 0)};
41 ASSERT_EQ(conflictingVehicle.size(), 1ul);
42 EXPECT_EQ(conflictingVehicle[0], *laneletMap->laneletLayer.find(2020));
44 ConstLanelets conflictingPedestrian{container->conflictingInGraph(pedestrianLanelet, 1)};
45 EXPECT_EQ(conflictingPedestrian.size(), 0ul);
49 ConstLanelet pedestrianLanelet{*laneletMap->laneletLayer.find(2031)};
51 ASSERT_EQ(result.size(), 2ul);
54 ASSERT_EQ(conflictingVehicle.size(), 1ul);
55 EXPECT_EQ(conflictingVehicle[0], *laneletMap->laneletLayer.find(2020));
58 EXPECT_EQ(conflictingPedestrian.size(), 0ul);
62 getAndCheckRoute(container->routingGraphs()[0], 2017, 2024);
63 ConstLanelets conflictingVehicle{container->conflictingOfRouteInGraph(route.get(), 0)};
64 EXPECT_EQ(conflictingVehicle.size(), 2ul);
66 ConstLanelets conflictingPedestrian{container->conflictingOfRouteInGraph(route.get(), 1)};
67 EXPECT_EQ(conflictingPedestrian.size(), 1ul);
71 getAndCheckRoute(container->routingGraphs()[0], 2017, 2024);
73 ASSERT_EQ(result.size(), 2ul);
76 EXPECT_EQ(conflictingVehicle.size(), 2ul);
79 EXPECT_EQ(conflictingPedestrian.size(), 1ul);
83 ConstLanelet bridgeLanelet{*laneletMap->laneletLayer.find(2032)};
84 ConstLanelets conflictingVehicle{container->conflictingInGraph(bridgeLanelet, 0, 2.)};
85 EXPECT_EQ(conflictingVehicle.size(), 0ul);
87 conflictingVehicle = container->conflictingInGraph(lanelets.find(2005)->second, 0, 2.);
88 ASSERT_EQ(conflictingVehicle.size(), 1ul);
89 EXPECT_TRUE(conflictingVehicle.front() == lanelets.find(2006)->second);
91 conflictingVehicle = container->conflictingInGraph(lanelets.find(2006)->second, 0, 2.);
92 ASSERT_EQ(conflictingVehicle.size(), 1ul);
93 EXPECT_TRUE(conflictingVehicle.front() == lanelets.find(2005)->second);
95 ConstLanelets conflictingPedestrian{container->conflictingInGraph(bridgeLanelet, 1, 2.)};
96 EXPECT_EQ(conflictingPedestrian.size(), 0ul);
100 ConstLanelet bridgeLanelet{*laneletMap->laneletLayer.find(2032)};
101 ConstLanelets conflictingVehicle{container->conflictingInGraph(bridgeLanelet, 0, 4.)};
102 EXPECT_EQ(conflictingVehicle.size(), 2ul);
104 conflictingVehicle = container->conflictingInGraph(lanelets.find(2005)->second, 0, 4.);
105 EXPECT_EQ(conflictingVehicle.size(), 2ul);
107 conflictingVehicle = container->conflictingInGraph(lanelets.find(2006)->second, 0, 4.);
108 EXPECT_EQ(conflictingVehicle.size(), 2ul);
110 ConstLanelets conflictingPedestrian{container->conflictingInGraph(bridgeLanelet, 1, 4.)};
111 EXPECT_EQ(conflictingPedestrian.size(), 0ul);