diff --git a/.cmake-format b/.cmake-format new file mode 100644 index 0000000000000000000000000000000000000000..4a8725e227eb590eb2328abb7bf93f60ed2b034e --- /dev/null +++ b/.cmake-format @@ -0,0 +1,80 @@ +line_width: 120 +tab_size: 2 +max_subgroups_hwrap: 2 +max_pargs_hwrap: 6 +separate_ctrl_name_with_space: false +separate_fn_name_with_space: false +dangle_parens: true +dangle_align: prefix +min_prefix_chars: 4 +max_prefix_chars: 10 +max_lines_hwrap: 2 +line_ending: unix +command_case: canonical +keyword_case: upper +additional_commands: + CPMAddPackage: + flags: + - SYSTEM + pargs: "*" + kwargs: + NAME: "*" + GIT_REPOSITORY: "*" + GITHUB_REPOSITORY: "*" + GITLAB_REPOSITORY: "*" + GIT_TAG: "*" + VERSION: "*" + OPTIONS: "*" + PATCH_COMMAND: "*" + DOWNLOAD_ONLY: "*" + configure_package_config_file: + flags: + - NO_SET_AND_CHECK_MACRO + - NO_CHECK_REQUIRED_COMPONENTS_MACRO + kwargs: + INSTALL_DESTINATION: "*" + PATH_VARS: "*" + INSTALL_PREFIX: "*" + find_dependency: + flags: + - CONFIG + - QUIET + - REQUIRED + kwargs: + COMPONENTS: "*" + gtest_discover_tests: + flags: + - NO_PRETTY_TYPES + - NO_PRETTY_VALUES + kwargs: + EXTRA_ARGS: "*" + WORKING_DIRECTORY: "*" + TEST_PREFIX: "*" + TEST_SUFFIX: "*" + PROPERTIES: "*" + TEST_LIST: "*" + DISCOVERY_TIMEOUT: "*" + setup_target_for_coverage_gcovr_html: + kwargs: + BASE_DIRECTORY: "*" + EXCLUDE: "*" + EXECUTABLE: "*" + EXECUTABLE_ARGS: "*" + DEPENDENCIES: "*" +always_wrap: [] +enable_sort: true +autosort: false +hashruler_min_length: 10 +per_command: {} +layout_passes: {} +bullet_char: "*" +enum_char: . +enable_markup: true +first_comment_is_literal: true +literal_comment_pattern: null +fence_pattern: ^\s*([`~]{3}[`~]*)(.*)$ +ruler_pattern: ^\s*[^\w\s]{3}.*[^\w\s]{3}$ +canonicalize_hashrulers: true +emit_byteorder_mark: false +input_encoding: utf-8 +output_encoding: utf-8 diff --git a/.gitignore b/.gitignore index fe88310591ed00e0504c31f1c5e985a295f415fe..7543762f04810e451230b237303655b621d2e974 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,5 @@ bazel-* /compile_commands.json # Ignore the directory in which `clangd` stores its local index. /.cache/ + +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..2540da515f70c8c315f3062b185c83e240dc070c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,89 @@ +#===------------------------------------------------------------------------===# +# +# Copyright (c) 2025 Mercedes-Benz Tech Innovation GmbH +# +# SPDX-License-Identifier: EPL-2.0 +# +#===------------------------------------------------------------------------===# + +cmake_minimum_required(VERSION 3.25.0) + +cmake_policy(SET CMP0135 NEW) + +list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") + +project( + RoadLogicSuite + VERSION 4.1.2 + DESCRIPTION "Library for loading and providing data from an OpenDRIVE map" + HOMEPAGE_URL "https://gitlab.eclipse.org/eclipse/openpass/road-logic-suite" + LANGUAGES CXX +) + +option(BUILD_SHARED_LIBS "Build shared libraries" ON) +option(ROAD_LOGIC_SUITE_BUILD_DOCS "Build documentation" ${PROJECT_IS_TOP_LEVEL}) +option(ROAD_LOGIC_SUITE_BUILD_TESTS "Build tests" ${PROJECT_IS_TOP_LEVEL}) +option(ROAD_LOGIC_SUITE_INSTALL "Install the project" ${PROJECT_IS_TOP_LEVEL}) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +if(ROAD_LOGIC_SUITE_INSTALL) + include(GNUInstallDirs) + set(ROAD_LOGIC_SUITE_INSTALL_LIBDIR + "${CMAKE_INSTALL_LIBDIR}" + CACHE PATH "Library install directory" + ) + set(ROAD_LOGIC_SUITE_INSTALL_INCLUDEDIR + "${CMAKE_INSTALL_INCLUDEDIR}" + CACHE PATH "Include install directory" + ) + set(ROAD_LOGIC_SUITE_INSTALL_CONFIGDIR + "${ROAD_LOGIC_SUITE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" + CACHE PATH "Config install directory" + ) + set(ROAD_LOGIC_SUITE_INSTALL_DATADIR + "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}" + CACHE PATH "Data install directory" + ) +endif() + +add_subdirectory(ThirdParty) +add_subdirectory(RoadLogicSuite) + +if(ROAD_LOGIC_SUITE_BUILD_TESTS) + enable_testing() +endif() + +if(ROAD_LOGIC_SUITE_BUILD_DOCS) + add_subdirectory(Documentation) +endif() + +if(ROAD_LOGIC_SUITE_INSTALL) + install( + EXPORT RoadLogicSuiteTargets + NAMESPACE RoadLogicSuite:: + DESTINATION "${ROAD_LOGIC_SUITE_INSTALL_CONFIGDIR}" + ) + + include(CMakePackageConfigHelpers) + + configure_package_config_file( + cmake/RoadLogicSuiteConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/RoadLogicSuiteConfig.cmake" + INSTALL_DESTINATION "${ROAD_LOGIC_SUITE_INSTALL_CONFIGDIR}" + ) + + write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/RoadLogicSuiteConfigVersion.cmake" + VERSION ${PROJECT_VERSION} + COMPATIBILITY SameMajorVersion + ) + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/RoadLogicSuiteConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/RoadLogicSuiteConfigVersion.cmake" + DESTINATION "${ROAD_LOGIC_SUITE_INSTALL_CONFIGDIR}" + ) + + install(FILES LICENSE.txt README.md DESTINATION "${ROAD_LOGIC_SUITE_INSTALL_DATADIR}") +endif() diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000000000000000000000000000000000000..4abb61237c4f39ab6420153e0fc4b21de2205e47 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,126 @@ +{ + "version": 10, + "cmakeMinimumRequired": { + "major": 3, + "minor": 25, + "patch": 0 + }, + "configurePresets": [ + { + "name": "default", + "displayName": "Default Config", + "description": "Default build using Ninja generator", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build", + "installDir": "${sourceDir}/build/prefix" + }, + { + "name": "devel", + "inherits": "default", + "displayName": "Devel Config", + "description": "Devel build using Ninja Multi-Config generator", + "generator": "Ninja Multi-Config", + "cacheVariables": { + "CMAKE_EXPORT_COMPILE_COMMANDS": true + } + } + ], + "buildPresets": [ + { + "name": "default", + "displayName": "Default Build", + "configurePreset": "default", + "configuration": "Release" + }, + { + "name": "devel-debug", + "displayName": "Devel Debug Build", + "configurePreset": "devel", + "configuration": "Debug" + }, + { + "name": "devel-release", + "displayName": "Devel Release Build", + "configurePreset": "devel", + "configuration": "Release" + } + ], + "testPresets": [ + { + "name": "default", + "displayName": "Default Test", + "configurePreset": "default", + "output": { + "outputOnFailure": true + }, + "execution": { + "noTestsAction": "error", + "stopOnFailure": true + } + }, + { + "name": "devel", + "displayName": "Devel Test", + "configurePreset": "devel", + "output": { + "outputOnFailure": true + }, + "execution": { + "noTestsAction": "error", + "stopOnFailure": true + } + } + ], + "packagePresets": [ + { + "name": "default", + "displayName": "Default Package", + "configurePreset": "default", + "generators": [ + "TGZ" + ] + } + ], + "workflowPresets": [ + { + "name": "default", + "displayName": "Default Workflow", + "steps": [ + { + "type": "configure", + "name": "default" + }, + { + "type": "build", + "name": "default" + }, + { + "type": "test", + "name": "default" + }, + { + "type": "package", + "name": "default" + } + ] + }, + { + "name": "devel", + "displayName": "Devel Workflow", + "steps": [ + { + "type": "configure", + "name": "devel" + }, + { + "type": "build", + "name": "devel" + }, + { + "type": "test", + "name": "devel" + } + ] + } + ] +} diff --git a/Documentation/CMakeLists.txt b/Documentation/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..4a3f3c1b7e148252e4ddd11a2c670413aa3c8ac4 --- /dev/null +++ b/Documentation/CMakeLists.txt @@ -0,0 +1,7 @@ +#===------------------------------------------------------------------------===# +# +# Copyright © 2025 Mercedes-Benz Group AG +# +# SPDX-License-Identifier: LicenseRef-MB-ISL-1.0 +# +#===------------------------------------------------------------------------===# diff --git a/RoadLogicSuite/CMakeLists.txt b/RoadLogicSuite/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..f1b921a4c21c4565c61207e3d4a5ec621ff27876 --- /dev/null +++ b/RoadLogicSuite/CMakeLists.txt @@ -0,0 +1,79 @@ +#===------------------------------------------------------------------------===# +# +# Copyright (c) 2025 Mercedes-Benz Tech Innovation GmbH +# +# SPDX-License-Identifier: EPL-2.0 +# +#===------------------------------------------------------------------------===# + +add_library(road_logic_suite) +add_library(RoadLogicSuite::road_logic_suite ALIAS road_logic_suite) + +target_sources( + road_logic_suite + PRIVATE Internal/coordinate_converter.cpp + Internal/geometry_lookup_rtree.cpp + Internal/Geometry/arc.cpp + Internal/Geometry/i_geometry.cpp + Internal/Geometry/line.cpp + Internal/Geometry/param_poly_3.cpp + Internal/Geometry/spiral.cpp + Internal/libopendrive_converter_helpers.cpp + Internal/libopendrive_converter.cpp + Internal/libopendrive_road_object_converter.cpp + Internal/libopendrive_road_signal_converter.cpp + Internal/MapConversion/lane_info.cpp + Internal/MapConversion/mantle_barrier_converter.cpp + Internal/MapConversion/mantle_id_provider.cpp + Internal/MapConversion/mantle_junction_converter.cpp + Internal/MapConversion/mantle_map_converter_utils.cpp + Internal/MapConversion/mantle_map_converter.cpp + Internal/MapConversion/mantle_map_lane_linker.cpp + Internal/MapConversion/mantle_road_object_converter.cpp + Internal/MapConversion/mantle_road_signal_converter.cpp + Internal/MapValidation/default_validation_config.cpp + Internal/MapValidation/validation_runner.cpp + Internal/MapValidation/Validators/road_length_validator.cpp + Internal/open_drive_data.cpp + Internal/road_logic_suite_impl.cpp + Internal/Types/lane_section.cpp + Internal/Types/lane.cpp + Internal/Types/poly3.cpp + Internal/Types/road_mark_utils.cpp + Internal/Utils/converter_utils.cpp + Internal/Utils/math_utils.cpp + map_loader.cpp + road_logic_suite.cpp + PUBLIC FILE_SET + HEADERS + BASE_DIRS + ${PROJECT_SOURCE_DIR} + FILES + ${CMAKE_CURRENT_SOURCE_DIR}/map_converter_config.h + ${CMAKE_CURRENT_SOURCE_DIR}/map_loader.h + ${CMAKE_CURRENT_SOURCE_DIR}/road_logic_suite.h +) + +target_link_libraries( + road_logic_suite + PUBLIC eigen::eigen + MantleAPI::MantleAPI + MapSDK::map_sdk + OpenDrive::OpenDrive + pugixml::pugixml + RTree::RTree + units::units +) + +target_include_directories( + road_logic_suite PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}> $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}> + $<INSTALL_INTERFACE:${ROAD_LOGIC_SUITE_INSTALL_INCLUDEDIR}> +) + +if(ROAD_LOGIC_SUITE_INSTALL) + install( + TARGETS road_logic_suite + EXPORT RoadLogicSuiteTargets + FILE_SET HEADERS + ) +endif() diff --git a/RoadLogicSuite/Internal/Geometry/spiral.cpp b/RoadLogicSuite/Internal/Geometry/spiral.cpp index 3caed3bc85f1f39222603d9b349910df1d884618..c9f1f2dcec9528f84e8d6b94d1ba6ceb39a172f8 100644 --- a/RoadLogicSuite/Internal/Geometry/spiral.cpp +++ b/RoadLogicSuite/Internal/Geometry/spiral.cpp @@ -17,6 +17,8 @@ namespace road_logic_suite constexpr int kAmountPreSamplingPoints = 11; constexpr int kMaxNewtonSteps = 50; +using odr::odrSpiral; + Spiral::Spiral(const units::length::meter_t& s, const Vec2<units::length::meter_t>& position, const units::angle::radian_t& hdg, diff --git a/RoadLogicSuite/Internal/MapConversion/mantle_barrier_converter.h b/RoadLogicSuite/Internal/MapConversion/mantle_barrier_converter.h index c73ddf61ef5027f4cddaec00155b593bb3bcdd38..49d16bde29af2a704387b0639a5e4af809519fa2 100644 --- a/RoadLogicSuite/Internal/MapConversion/mantle_barrier_converter.h +++ b/RoadLogicSuite/Internal/MapConversion/mantle_barrier_converter.h @@ -15,8 +15,8 @@ #include "RoadLogicSuite/Internal/coordinate_converter.h" #include "RoadLogicSuite/map_converter_config.h" -#include <MapAPI/lane_boundary.h> -#include <MapAPI/map.h> +#include <MapSDK/lane_boundary.h> +#include <MapSDK/map.h> namespace road_logic_suite::map_conversion { @@ -41,4 +41,4 @@ class MantleBarrierConverter }; } // namespace road_logic_suite::map_conversion -#endif // ROADLOGICSUITE_MANTLE_BARRIER_CONVERTER_H \ No newline at end of file +#endif // ROADLOGICSUITE_MANTLE_BARRIER_CONVERTER_H diff --git a/RoadLogicSuite/Internal/MapConversion/mantle_map_converter.h b/RoadLogicSuite/Internal/MapConversion/mantle_map_converter.h index 9a563378897478e83cb4da2531d42c2d20df6a19..e4a044d2fecdc8a1931d03e62cd29b8d1e303064 100644 --- a/RoadLogicSuite/Internal/MapConversion/mantle_map_converter.h +++ b/RoadLogicSuite/Internal/MapConversion/mantle_map_converter.h @@ -19,7 +19,7 @@ #include "RoadLogicSuite/Internal/open_drive_data.h" #include "RoadLogicSuite/map_converter_config.h" -#include <MapAPI/i_map_loader.h> +#include <MapSDK/i_map_loader.h> namespace road_logic_suite::map_conversion { diff --git a/RoadLogicSuite/Internal/MapConversion/mantle_map_converter_test.cpp b/RoadLogicSuite/Internal/MapConversion/mantle_map_converter_test.cpp index 17e7cb7025902812f9127e386e69b59cf51945ae..fbffa5bf61b30d8c63c94fb1565e8df1c539fd21 100644 --- a/RoadLogicSuite/Internal/MapConversion/mantle_map_converter_test.cpp +++ b/RoadLogicSuite/Internal/MapConversion/mantle_map_converter_test.cpp @@ -510,7 +510,7 @@ TEST(MantleConverterTest, GivenRoadWithArcGeometry_WhenConvertingRoad_ThenValues } /// @verbatim -/// Expected Lane IDs (MapAPI), direction and center line y-values for the six-lane road. (Checked on 12.06.2023) +/// Expected Lane IDs (MapSDK), direction and center line y-values for the six-lane road. (Checked on 12.06.2023) /// ╓─────────────────────╖ /// ║ <- Lane 11 ║ y=7.5 /// ╟─────────────────────╢ diff --git a/RoadLogicSuite/Internal/MapConversion/mantle_map_converter_utils.h b/RoadLogicSuite/Internal/MapConversion/mantle_map_converter_utils.h index 7e1688a901351e79d42afee3cdb042326a795ccb..c83d1e5f792a412df1914e9ce07420a20085d579 100644 --- a/RoadLogicSuite/Internal/MapConversion/mantle_map_converter_utils.h +++ b/RoadLogicSuite/Internal/MapConversion/mantle_map_converter_utils.h @@ -15,7 +15,7 @@ #include "RoadLogicSuite/Internal/Utils/converter_utils.h" #include <MantleAPI/Common/i_identifiable.h> -#include <MapAPI/map.h> +#include <MapSDK/map.h> namespace road_logic_suite::map_conversion::utils { diff --git a/RoadLogicSuite/Internal/MapConversion/mantle_map_lane_linker.h b/RoadLogicSuite/Internal/MapConversion/mantle_map_lane_linker.h index 99dfb94153b08830800b1b7dda83883a3799f702..b9c6644782404eec91c56e44ac8f673532876bd3 100644 --- a/RoadLogicSuite/Internal/MapConversion/mantle_map_lane_linker.h +++ b/RoadLogicSuite/Internal/MapConversion/mantle_map_lane_linker.h @@ -16,7 +16,7 @@ #include "RoadLogicSuite/Internal/open_drive_data.h" #include "RoadLogicSuite/Internal/road.h" -#include <MapAPI/lane.h> +#include <MapSDK/lane.h> namespace road_logic_suite::map_conversion { diff --git a/RoadLogicSuite/Internal/MapConversion/mantle_road_object_converter.h b/RoadLogicSuite/Internal/MapConversion/mantle_road_object_converter.h index 53510da79f42397bdf75a4486be7a1bb44b7da7f..129505ae0d628e2330eb3655a0e2f0cce42a21f4 100644 --- a/RoadLogicSuite/Internal/MapConversion/mantle_road_object_converter.h +++ b/RoadLogicSuite/Internal/MapConversion/mantle_road_object_converter.h @@ -14,7 +14,7 @@ #include "RoadLogicSuite/Internal/MapConversion/mantle_id_provider.h" #include "RoadLogicSuite/Internal/open_drive_data.h" -#include <MapAPI/map.h> +#include <MapSDK/map.h> namespace road_logic_suite::map_conversion { @@ -32,4 +32,4 @@ class MantleRoadObjectConverter }; } // namespace road_logic_suite::map_conversion -#endif // ROADLOGICSUITE_MANTLE_ROAD_OBJECT_CONVERTER_H \ No newline at end of file +#endif // ROADLOGICSUITE_MANTLE_ROAD_OBJECT_CONVERTER_H diff --git a/RoadLogicSuite/Internal/MapConversion/mantle_road_object_converter_test.cpp b/RoadLogicSuite/Internal/MapConversion/mantle_road_object_converter_test.cpp index 231dbe5aad9c28af801237f59f889a4ce09ae4b5..48d7e41a283a6de0e638bca547861cb972bb715c 100644 --- a/RoadLogicSuite/Internal/MapConversion/mantle_road_object_converter_test.cpp +++ b/RoadLogicSuite/Internal/MapConversion/mantle_road_object_converter_test.cpp @@ -12,7 +12,7 @@ #include "RoadLogicSuite/Internal/open_drive_data.h" -#include <MapAPI/map.h> +#include <MapSDK/map.h> #include <gmock/gmock.h> namespace @@ -168,4 +168,4 @@ TEST(MantleRoadObjectConverterTest, GivenAFewObjects_WhenConvertingToMantleMap_T EXPECT_EQ(map.stationary_objects[1]->id, mantle_api::UniqueId{2}); EXPECT_EQ(map.stationary_objects[2]->id, mantle_api::UniqueId{3}); } -} // namespace \ No newline at end of file +} // namespace diff --git a/RoadLogicSuite/Internal/MapConversion/mantle_road_signal_converter.h b/RoadLogicSuite/Internal/MapConversion/mantle_road_signal_converter.h index 3efa3f692d3d30d84761ddb0f26e7624e2a50781..ba15465e6817a9f8934602980f3fe289c2c75c4e 100644 --- a/RoadLogicSuite/Internal/MapConversion/mantle_road_signal_converter.h +++ b/RoadLogicSuite/Internal/MapConversion/mantle_road_signal_converter.h @@ -14,7 +14,7 @@ #include "RoadLogicSuite/Internal/MapConversion/mantle_id_provider.h" #include "RoadLogicSuite/Internal/open_drive_data.h" -#include <MapAPI/map.h> +#include <MapSDK/map.h> namespace road_logic_suite::map_conversion { @@ -32,4 +32,4 @@ class MantleRoadSignalConverter }; } // namespace road_logic_suite::map_conversion -#endif // ROADLOGICSUITE_MANTLE_ROAD_SIGNAL_CONVERTER_H \ No newline at end of file +#endif // ROADLOGICSUITE_MANTLE_ROAD_SIGNAL_CONVERTER_H diff --git a/RoadLogicSuite/Internal/MapConversion/mantle_road_signal_converter_test.cpp b/RoadLogicSuite/Internal/MapConversion/mantle_road_signal_converter_test.cpp index 137884fb3333d1e07271d59b3b1a7bc601dfbcf9..04dab5490f8e95317ae91025fecc881460df4a5b 100644 --- a/RoadLogicSuite/Internal/MapConversion/mantle_road_signal_converter_test.cpp +++ b/RoadLogicSuite/Internal/MapConversion/mantle_road_signal_converter_test.cpp @@ -12,7 +12,7 @@ #include "RoadLogicSuite/Internal/open_drive_data.h" -#include <MapAPI/map.h> +#include <MapSDK/map.h> #include <gmock/gmock.h> namespace diff --git a/RoadLogicSuite/Internal/Utils/converter_utils.h b/RoadLogicSuite/Internal/Utils/converter_utils.h index c494a122c89fb6d2734c7d22b646937ed2942258..75fff6a56bfe4cbe8a6f7f18bb88e62de4036069 100644 --- a/RoadLogicSuite/Internal/Utils/converter_utils.h +++ b/RoadLogicSuite/Internal/Utils/converter_utils.h @@ -15,7 +15,7 @@ #include "RoadLogicSuite/Internal/coordinate_converter.h" #include <MantleAPI/Common/vector.h> -#include <MapAPI/lane_boundary.h> +#include <MapSDK/lane_boundary.h> #include <units.h> namespace road_logic_suite::utils diff --git a/RoadLogicSuite/Internal/libopendrive_converter.cpp b/RoadLogicSuite/Internal/libopendrive_converter.cpp index d9c2e7b24c05711cc4850d33358c68f9dab99660..91e8733424e69ba4476ee0d0068e1122884b5340 100644 --- a/RoadLogicSuite/Internal/libopendrive_converter.cpp +++ b/RoadLogicSuite/Internal/libopendrive_converter.cpp @@ -24,7 +24,7 @@ #include <Geometries/ParamPoly3.h> #include <Geometries/Spiral.h> #include <OpenDriveMap.h> -#include <pugixml/pugixml.hpp> +#include <pugixml.hpp> #include <string> diff --git a/RoadLogicSuite/Tests/MantleMapConvertIntegrationTestFixture/mantle_map_convert_integration_test_fixture.h b/RoadLogicSuite/Tests/MantleMapConvertIntegrationTestFixture/mantle_map_convert_integration_test_fixture.h index 6229a42cd5eb5682ff605ac356a74226c926fe00..2c613efecf07c5eef8274cbadb9bc550e07399f3 100644 --- a/RoadLogicSuite/Tests/MantleMapConvertIntegrationTestFixture/mantle_map_convert_integration_test_fixture.h +++ b/RoadLogicSuite/Tests/MantleMapConvertIntegrationTestFixture/mantle_map_convert_integration_test_fixture.h @@ -14,9 +14,9 @@ #include "RoadLogicSuite/Tests/Utils/file_paths.h" #include "RoadLogicSuite/road_logic_suite.h" -#include <MapAPI/lane.h> -#include <MapAPI/lane_boundary.h> -#include <MapAPI/map.h> +#include <MapSDK/lane.h> +#include <MapSDK/lane_boundary.h> +#include <MapSDK/map.h> #include <gtest/gtest.h> namespace road_logic_suite::test diff --git a/RoadLogicSuite/map_loader.h b/RoadLogicSuite/map_loader.h index 9c31a1a0c57daf7c2210305bd3eaee164a1273a7..dd75a040743cf4f0c5b057f6d2b5bb1329412edf 100644 --- a/RoadLogicSuite/map_loader.h +++ b/RoadLogicSuite/map_loader.h @@ -11,7 +11,7 @@ #ifndef ROADLOGICSUITE_MAPLOADER_H #define ROADLOGICSUITE_MAPLOADER_H -#include <MapAPI/i_map_loader.h> +#include <MapSDK/i_map_loader.h> #include <memory> diff --git a/RoadLogicSuite/road_logic_suite.h b/RoadLogicSuite/road_logic_suite.h index f3ee28e371434e5223c253ba9242d22ae1964ac8..602b340264d00d1bfe386e5a247af6fa9b4d7a2f 100644 --- a/RoadLogicSuite/road_logic_suite.h +++ b/RoadLogicSuite/road_logic_suite.h @@ -15,7 +15,7 @@ #include "map_converter_config.h" #include <MantleAPI/Common/position.h> -#include <MapAPI/i_map_loader.h> +#include <MapSDK/i_map_loader.h> #include <memory> #include <optional> diff --git a/ThirdParty/CMakeLists.txt b/ThirdParty/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..a59bfdf16a37e1182f3cb871d8291c22706f5952 --- /dev/null +++ b/ThirdParty/CMakeLists.txt @@ -0,0 +1,16 @@ +#===------------------------------------------------------------------------===# +# +# Copyright © 2025 Mercedes-Benz Group AG +# +# SPDX-License-Identifier: LicenseRef-MB-ISL-1.0 +# +#===------------------------------------------------------------------------===# + +include(CPM) +add_subdirectory(eigen) +add_subdirectory(googletest) +add_subdirectory(libOpenDRIVE) +add_subdirectory(mantle_api) +add_subdirectory(map_sdk) +add_subdirectory(rtree) +add_subdirectory(units) diff --git a/ThirdParty/eigen/CMakeLists.txt b/ThirdParty/eigen/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..84461dfea3bfa72dcb61012a0acc62dd9edec299 --- /dev/null +++ b/ThirdParty/eigen/CMakeLists.txt @@ -0,0 +1,22 @@ +#===------------------------------------------------------------------------===# +# +# Copyright © 2025 Mercedes-Benz Group AG +# +# SPDX-License-Identifier: LicenseRef-MB-ISL-1.0 +# +#===------------------------------------------------------------------------===# + +CPMAddPackage( + NAME eigen + GITLAB_REPOSITORY libeigen/eigen + GIT_TAG 3.4 + VERSION 3.4 + DOWNLOAD_ONLY YES + SYSTEM +) + +if(eigen_ADDED) + add_library(eigen INTERFACE IMPORTED GLOBAL) + add_library(eigen::eigen ALIAS eigen) + target_include_directories(eigen INTERFACE ${eigen_SOURCE_DIR}) +endif() diff --git a/ThirdParty/googletest/CMakeLists.txt b/ThirdParty/googletest/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..613e68e0044e4d1768ab743cca146ed90f895f8e --- /dev/null +++ b/ThirdParty/googletest/CMakeLists.txt @@ -0,0 +1,15 @@ +#===------------------------------------------------------------------------===# +# +# Copyright © 2025 Mercedes-Benz Group AG +# +# SPDX-License-Identifier: LicenseRef-MB-ISL-1.0 +# +#===------------------------------------------------------------------------===# + +CPMAddPackage( + NAME googletest + GITHUB_REPOSITORY google/googletest + VERSION 1.15.2 + OPTIONS "INSTALL_GTEST OFF" "gtest_force_shared_crt ON" + SYSTEM +) diff --git a/ThirdParty/libOpenDRIVE/CMakeLists.txt b/ThirdParty/libOpenDRIVE/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..abca48a54c0b737adc4cc62ef54a47e2d8056edf --- /dev/null +++ b/ThirdParty/libOpenDRIVE/CMakeLists.txt @@ -0,0 +1,19 @@ +#===------------------------------------------------------------------------===# +# +# Copyright © 2025 Mercedes-Benz Group AG +# +# SPDX-License-Identifier: LicenseRef-MB-ISL-1.0 +# +#===------------------------------------------------------------------------===# + +CPMAddPackage( + NAME libOpenDRIVE + GITHUB_REPOSITORY pageldev/libOpenDRIVE + GIT_TAG 82c2dd918580df120b30673e3484c3c2aaf5aa69 + VERSION 0.5.0 + SYSTEM +) + +if(TARGET OpenDrive AND NOT TARGET OpenDrive::OpenDrive) + add_library(OpenDrive::OpenDrive ALIAS OpenDrive) +endif() diff --git a/ThirdParty/mantle_api/CMakeLists.txt b/ThirdParty/mantle_api/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..43cc2bce5729432493947ae2753e5fb5b90aa233 --- /dev/null +++ b/ThirdParty/mantle_api/CMakeLists.txt @@ -0,0 +1,17 @@ +#===------------------------------------------------------------------------===# +# +# Copyright © 2025 Mercedes-Benz Group AG +# +# SPDX-License-Identifier: LicenseRef-MB-ISL-1.0 +# +#===------------------------------------------------------------------------===# + +CPMAddPackage( + NAME mantle_api + GIT_REPOSITORY https://gitlab.eclipse.org/eclipse/openpass/mantle-api.git + # FIXME(mstump8): Remove next line and set to correct version when available + GIT_TAG 6661fe96a2c8534dd49da66c08ec1c1ad67e1a90 + VERSION 8.0.0 + OPTIONS "MantleAPI_INSTALL ON" "MantleAPI_INSTALL_MOCKS ON" + SYSTEM +) diff --git a/ThirdParty/map_sdk/CMakeLists.txt b/ThirdParty/map_sdk/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..cbbce736eed1fc39330f4832a425ee7076b2fc0b --- /dev/null +++ b/ThirdParty/map_sdk/CMakeLists.txt @@ -0,0 +1,17 @@ +#===------------------------------------------------------------------------===# +# +# Copyright © 2025 Mercedes-Benz Group AG +# +# SPDX-License-Identifier: LicenseRef-MB-ISL-1.0 +# +#===------------------------------------------------------------------------===# + +CPMAddPackage( + NAME map_sdk + GIT_REPOSITORY https://gitlab.eclipse.org/eclipse/openpass/map-sdk.git + # FIXME(mstump8): Remove next line and set to correct version when available + GIT_TAG d0fcf744b32164f0b89f37ed062009b5b68e8e07 + VERSION 0.4.0 + OPTIONS "MAP_SDK_INSTALL ON" + SYSTEM +) diff --git a/ThirdParty/rtree/CMakeLists.txt b/ThirdParty/rtree/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..3043e3dcaa293011c54c4b45c2be522179fdc75c --- /dev/null +++ b/ThirdParty/rtree/CMakeLists.txt @@ -0,0 +1,21 @@ +#===------------------------------------------------------------------------===# +# +# Copyright © 2025 Mercedes-Benz Group AG +# +# SPDX-License-Identifier: LicenseRef-MB-ISL-1.0 +# +#===------------------------------------------------------------------------===# + +CPMAddPackage( + NAME RTree + GITHUB_REPOSITORY nushoin/RTree + GIT_TAG 4bd551c7e2b2cf3fce9d4bf3d18f4c58d1efefc1 + DOWNLOAD_ONLY YES + SYSTEM +) + +if(RTree_ADDED) + add_library(RTree INTERFACE IMPORTED GLOBAL) + add_library(RTree::RTree ALIAS RTree) + target_include_directories(RTree INTERFACE ${RTree_SOURCE_DIR}) +endif() diff --git a/ThirdParty/units/CMakeLists.txt b/ThirdParty/units/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..a828c36897ced52ceabd580f2e3557705e66fb70 --- /dev/null +++ b/ThirdParty/units/CMakeLists.txt @@ -0,0 +1,14 @@ +#===------------------------------------------------------------------------===# +# +# Copyright © 2025 Mercedes-Benz Group AG +# +# SPDX-License-Identifier: LicenseRef-MB-ISL-1.0 +# +#===------------------------------------------------------------------------===# + +CPMAddPackage( + NAME units + GITHUB_REPOSITORY nholthaus/units + VERSION 2.3.3 + SYSTEM +) diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake new file mode 100644 index 0000000000000000000000000000000000000000..47e2e872abb89bbdda6794532d12b1a6dbe50c65 --- /dev/null +++ b/cmake/CPM.cmake @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: MIT +# +# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors + +set(CPM_DOWNLOAD_VERSION 0.40.5) +set(CPM_HASH_SUM "c46b876ae3b9f994b4f05a4c15553e0485636862064f1fcc9d8b4f832086bc5d") + +if(CPM_SOURCE_CACHE) + set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +elseif(DEFINED ENV{CPM_SOURCE_CACHE}) + set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +else() + set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +endif() + +# Expand relative path. This is important if the provided path contains a tilde (~) +get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) + +file(DOWNLOAD + https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake + ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} +) + +include(${CPM_DOWNLOAD_LOCATION}) diff --git a/cmake/FindPlantUML.cmake b/cmake/FindPlantUML.cmake new file mode 100644 index 0000000000000000000000000000000000000000..9f056d1940a2d2f2d959b48be423fe83d8ee831d --- /dev/null +++ b/cmake/FindPlantUML.cmake @@ -0,0 +1,23 @@ +################################################################################ +# Copyright (c) 2024 Mercedes-Benz Tech Innovation GmbH +# +# This program and the accompanying materials are made available under the terms +# of the Eclipse Public License 2.0 which is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +################################################################################ + +find_file(PLANTUML_JAR plantuml.jar PATHS ${PLANTUML_JAR_PATH} ENV{PLANTUML_JAR_PATH} /usr/share/plantuml) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PlantUML DEFAULT_MSG PLANTUML_JAR) + +if(PlantUML_FOUND) + if(NOT TARGET PlantUML::PlantUML) + add_executable(PlantUML::PlantUML IMPORTED) + if(EXISTS "${PLANTUML_JAR}") + set_target_properties(PlantUML::PlantUML PROPERTIES IMPORTED_LOCATION "${PLANTUML_JAR}") + endif() + endif() +endif() diff --git a/cmake/RoadLogicSuiteConfig.cmake.in b/cmake/RoadLogicSuiteConfig.cmake.in new file mode 100644 index 0000000000000000000000000000000000000000..70786f94fef9826c6e6a2ba5953f2cf4b5dfe33c --- /dev/null +++ b/cmake/RoadLogicSuiteConfig.cmake.in @@ -0,0 +1,22 @@ +#===------------------------------------------------------------------------===# +# +# Copyright (c) 2025 Mercedes-Benz Tech Innovation GmbH +# +# SPDX-License-Identifier: EPL-2.0 +# +#===------------------------------------------------------------------------===# + +@PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) +find_dependency(eigen) +find_dependency(MantleAPI) +find_dependency(MapSDK) +find_dependency(OpenDrive) +find_dependency(units) + +if(NOT TARGET RoadLogicSuite::road_logic_suite AND NOT RoadLogicSuite_BINARY_DIR) + set_and_check(RoadLogicSuite_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") + mark_as_advanced(RoadLogicSuite_INCLUDE_DIR) + include("${CMAKE_CURRENT_LIST_DIR}/RoadLogicSuiteTargets.cmake") +endif()