Skip to content

Commit

Permalink
Provides a test to validate the end to end connectivity of routing::R…
Browse files Browse the repository at this point in the history
…oute (#81)

* Provides a test to validate the end to end connectivity of routing::Routes.
---------

Signed-off-by: Agustin Alba Chicar <[email protected]>
  • Loading branch information
agalbachicar authored Oct 8, 2024
1 parent 0ea1b95 commit eafdd63
Show file tree
Hide file tree
Showing 3 changed files with 448 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/DefaultObjContent.obj DESTINATION ${T
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/HighlightedSegments.obj DESTINATION ${TEST_PATH})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/NoBranchPointsObjContent.obj DESTINATION ${TEST_PATH})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/StackedBranchPointsObjContent.obj DESTINATION ${TEST_PATH})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/resources/odr/MultipleStraightSegments.xodr DESTINATION ${TEST_PATH})

ament_add_gtest(derive_lane_s_routes_test derive_lane_s_routes_test.cc)
ament_add_gtest(distance_router_test distance_router_test.cc)
Expand All @@ -50,6 +51,7 @@ ament_add_gtest(intersection_book_loader_test intersection_book_loader_test.cc)
ament_add_gmock(object_query_test object_query_test.cc)
ament_add_gtest(phase_ring_book_loader_test phase_ring_book_loader_test.cc)
ament_add_gtest(road_rulebook_loader_test road_rulebook_loader_test.cc)
ament_add_gtest(route_end_to_end_connectivity_test route_end_to_end_connectivity_test.cc WORKING_DIRECTORY ${TEST_PATH})
ament_add_gtest(segment_analysis_test segment_analysis_test.cc)
ament_add_gtest(traffic_light_book_loader_test traffic_light_book_loader_test.cc)
ament_add_gtest(waypoints_test waypoints_test.cc)
Expand All @@ -64,6 +66,7 @@ add_dependencies_to_test(intersection_book_loader_test)
add_dependencies_to_test(object_query_test)
add_dependencies_to_test(phase_ring_book_loader_test)
add_dependencies_to_test(road_rulebook_loader_test)
add_dependencies_to_test(route_end_to_end_connectivity_test)
add_dependencies_to_test(segment_analysis_test)
add_dependencies_to_test(traffic_light_book_loader_test)
add_dependencies_to_test(waypoints_test)
146 changes: 146 additions & 0 deletions test/resources/odr/MultipleStraightSegments.xodr
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
BSD 3-Clause License
Copyright (c) 2024, Woven by Toyota. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<OpenDRIVE>
<header revMajor="1" revMinor="1" name="MultipleStraightSegments" version="1.00" date="Mon Mar 04 17:50:00 2024" north="0.0" south="0.0" east="0.0" west="0.0" maxRoad="2" maxJunc="0" maxPrg="0">
<geoReference><![CDATA[+proj=tmerc +lat_0=37.4168716 +lon_0=-122.1030492 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +vunits=m +no_defs ]]></geoReference>
</header>
<road name="Road 1" length="100.0" id="1" junction="-1">
<link>
<successor elementType="road" elementId="2" contactPoint="start" />
</link>
<planView>
<geometry s="0.0" x="0.0" y="0.0" hdg="0.0" length="100.0">
<line/>
</geometry>
</planView>
<elevationProfile>
</elevationProfile>
<lateralProfile>
</lateralProfile>
<lanes>
<laneSection s="0.0">
<left>
<lane id="1" type="driving" level= "0">
<link>
<successor id="1" />
</link>
<width sOffset="0.0" a="3.5" b="0.0" c="0.0" d="0.0"/>
<roadMark sOffset="0.0" type="solid" weight="standard" color="standard" width="2.e-01"/>
<userData>
<vectorLane travelDir="backward"/>
</userData>
</lane>
</left>
<center>
<lane id="0" type="driving" level= "0">
<link>
<successor id="0" />
</link>
<roadMark sOffset="0.0" type="broken" weight="standard" color="standard" width="1.e-01"/>
<userData>
<vectorLane travelDir="undirected"/>
</userData>
</lane>
</center>
<right>
<lane id="-1" type="driving" level= "0">
<link>
<successor id="-1" />
</link>
<width sOffset="0.0" a="3.5" b="0.0" c="0.0" d="0.0"/>
<roadMark sOffset="0.0" type="solid" weight="standard" color="standard" width="2.e-01"/>
<userData>
<vectorLane travelDir="forward"/>
</userData>
</lane>
</right>
</laneSection>
</lanes>
<objects />
<signals />
</road>
<road name="Road 2" length="100.0" id="2" junction="-1">
<link>
<predecessor elementType="road" elementId="1" contactPoint="end" />
</link>
<planView>
<geometry s="0.0" x="100.0" y="0.0" hdg="0.0" length="100.0">
<line/>
</geometry>
</planView>
<elevationProfile>
</elevationProfile>
<lateralProfile>
</lateralProfile>
<lanes>
<laneSection s="0.0">
<left>
<lane id="1" type="driving" level= "0">
<link>
<predecessor id="1" />
</link>
<width sOffset="0.0" a="3.5" b="0.0" c="0.0" d="0.0"/>
<roadMark sOffset="0.0" type="solid" weight="standard" color="standard" width="2.e-01"/>
<userData>
<vectorLane travelDir="backward"/>
</userData>
</lane>
</left>
<center>
<lane id="0" type="driving" level= "0">
<link>
<predecessor id="0" />
</link>
<roadMark sOffset="0.0" type="broken" weight="standard" color="standard" width="1.e-01"/>
<userData>
<vectorLane travelDir="undirected"/>
</userData>
</lane>
</center>
<right>
<lane id="-1" type="driving" level= "0">
<link>
<predecessor id="-1" />
</link>
<width sOffset="0.0" a="3.5" b="0.0" c="0.0" d="0.0"/>
<roadMark sOffset="0.0" type="solid" weight="standard" color="standard" width="2.e-01"/>
<userData>
<vectorLane travelDir="forward"/>
</userData>
</lane>
</right>
</laneSection>
</lanes>
<objects />
<signals />
</road>
</OpenDRIVE>
Loading

0 comments on commit eafdd63

Please sign in to comment.