diff --git a/include/MantleAPI/Map/i_lane_location_query_service.h b/include/MantleAPI/Map/i_lane_location_query_service.h index fad37f9181e60837193526b520f4f470662bd765..73687219d34ab13c17a0bcb0891802466cb7059a 100644 --- a/include/MantleAPI/Map/i_lane_location_query_service.h +++ b/include/MantleAPI/Map/i_lane_location_query_service.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2021-2025, Bayerische Motoren Werke Aktiengesellschaft (BMW AG) * Copyright (c) 2022 Ansys, Inc. * * This program and the accompanying materials are made @@ -186,6 +186,15 @@ public: /// first lane in the list is considered. No value, if the position is not on a lane. [[nodiscard]] virtual std::optional<Vec3<units::length::meter_t>> GetProjectedCenterLinePoint( const Vec3<units::length::meter_t>& position) const = 0; + + /// Tries to map a given position (only x/y coordinate considered) to the top-most lane at that position and then + /// returns the height of the road surface at the given position. + /// + /// @param position Position that shall be mapped to a lane. Must be on a lane (use IsPositionOnLane() before). + /// @return Height of the road surface of the top-most lane in world coordinate system (z-coordinate) + /// @throw If the position cannot be mapped to a lane + [[nodiscard]] virtual units::length::meter_t GetLaneHeightAtPosition( + const Vec3<units::length::meter_t>& position) const = 0; }; } // namespace mantle_api diff --git a/test/MantleAPI/Test/test_utils.h b/test/MantleAPI/Test/test_utils.h index 50ec8e4125857e840515d88362e6295b3a340b1e..468d592a188bcc7ee90ce1e9fe73826c19ff565c 100644 --- a/test/MantleAPI/Test/test_utils.h +++ b/test/MantleAPI/Test/test_utils.h @@ -139,11 +139,8 @@ public: MOCK_METHOD(Orientation3<units::angle::radian_t>, GetLaneOrientation, (const Vec3<units::length::meter_t>& position), (const override)); MOCK_METHOD(Vec3<units::length::meter_t>, GetUpwardsShiftedLanePosition, (const Vec3<units::length::meter_t>& position, double upwards_shift, bool allowed_to_leave_lane), (const override)); - bool IsPositionOnLane(const Vec3<units::length::meter_t>& position) const override - { - std::ignore = position; - return false; - } + + MOCK_METHOD(bool, IsPositionOnLane, (const Vec3<units::length::meter_t>& position), (const override)); MOCK_METHOD(std::vector<UniqueId>, GetLaneIdsAtPosition, (const Vec3<units::length::meter_t>& position), (const override)); @@ -186,6 +183,8 @@ public: (const Vec3<units::length::meter_t>&), (const, override)); + MOCK_METHOD(units::length::meter_t, GetLaneHeightAtPosition, (const Vec3<units::length::meter_t>&), (const)); + private: MockVehicle test_vehicle_{}; };