Skip to content
Snippets Groups Projects
Commit 64132ec4 authored by René Paris's avatar René Paris
Browse files

ref: Improve naming of GetUpwardsShiftedLanePosition to GetShiftedPositionToLaneNormal

Closes #16
parent f2447b55
No related branches found
No related tags found
1 merge request!154ref: Improve naming of GetUpwardsShiftedLanePosition to GetShiftedPositionToLaneNormal
Pipeline #52759 passed with stage
in 0 seconds
/*******************************************************************************
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2024, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2022 Ansys, Inc.
*
* This program and the accompanying materials are made
......@@ -67,19 +67,23 @@ public:
[[nodiscard]] virtual Orientation3<units::angle::radian_t> GetLaneOrientation(
const Vec3<units::length::meter_t>& position) const = 0;
/// @brief Shifts a position the given amount upwards along the lane normal. This function is used for shifting
/// entities upwards, such that their bounding boxes are touching with the bottom-plane the road surface. Thus,
/// entities do not "sink" into the road.
/// @brief Calculates a new position along the lane normal, given a displacement.
///
/// @param position Position on road surface
/// @param upwards_shift Amount to shift position upwards along lane normal in [m]
/// @param allow_invalid_positions If true and the position cannot be mapped to a lane, then an upwards vector in
/// world z-direction is used instead of the lane normal for the shift
/// @return Upwards shifted position
/// @throw If the position cannot be mapped to a lane and allow_invalid_positions=false.
[[nodiscard]] virtual Vec3<units::length::meter_t> GetUpwardsShiftedLanePosition(const Vec3<units::length::meter_t>& position,
double upwards_shift,
bool allow_invalid_positions = false) const = 0;
/// This function translates entities upwards, ensuring their bounding boxes
/// touch the road surface with their bottom plane, preventing them from
/// "sinking" into the road.
///
/// @param position The initial position on the road surface.
/// @param displacement The displacement along the lane normal, in [m],
/// with positive values shifting the position upwards.
/// @param allow_invalid_positions If true and the position cannot be mapped to a lane,
/// the world's z-direction is used instead.
/// @return The new position along the lane normal (or world's z-direction).
/// @throw If initial position cannot be mapped to a lane and allow_invalid_positions=false.
[[nodiscard]] virtual Vec3<units::length::meter_t> GetShiftedPositionToLaneNormal(
const Vec3<units::length::meter_t>& position,
double displacement,
bool allow_invalid_positions = false) const = 0;
/// @brief Checks, if a given position can be mapped to a lane
///
......
......@@ -131,7 +131,8 @@ class MockQueryService : public mantle_api::ILaneLocationQueryService
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));
MOCK_METHOD(Vec3<units::length::meter_t>, GetShiftedPositionToLaneNormal, (const Vec3<units::length::meter_t>& position, double displacment, bool allowed_to_leave_lane), (const override));
bool IsPositionOnLane(const Vec3<units::length::meter_t>& position) const override
{
std::ignore = position;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment