Skip to content
Snippets Groups Projects
Commit 74266c90 authored by Naida Goro's avatar Naida Goro Committed by René Paris
Browse files

feature(doc): complete doxygen documentation

parent 9a038989
No related branches found
No related tags found
1 merge request!116doxygen warnings
Showing
with 411 additions and 120 deletions
......@@ -11,14 +11,17 @@
find_package(Doxygen QUIET REQUIRED dot OPTIONAL_COMPONENTS mscgen dia)
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
set(DOXYGEN_DOT_IMAGE_FORMAT svg)
set(DOXYGEN_IMAGE_PATH ${CMAKE_CURRENT_LIST_DIR}/images)
set(DOXYGEN_INCLUDE_PATH ${PROJECT_SOURCE_DIR}/include)
set(DOXYGEN_DOT_IMAGE_FORMAT svg)
set(DOXYGEN_INTERACTIVE_SVG YES)
set(DOXYGEN_QUIET YES)
set(DOXYGEN_TAB_SIZE 2)
set(DOXYGEN_UML_LOOK YES)
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE README.md)
set(DOXYGEN_WARN_NO_PARAMDOC YES)
set(DOXYGEN_WARN_LOGFILE ${CMAKE_CURRENT_BINARY_DIR}/DoxygenWarningLog.txt)
set(DOXYGEN_GENERATE_LATEX NO)
set(DOXYGEN_RECURSIVE YES)
doxygen_add_docs(
${PROJECT_NAME}_doc ${PROJECT_SOURCE_DIR}/README.md ${PROJECT_SOURCE_DIR}/include COMMENT "Generate html docs"
......
/*******************************************************************************
* Copyright (c) 2021-2022, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -22,15 +22,20 @@
namespace mantle_api
{
/// The geometric center is defined in the local entity coordinate system.
/// The geometric center is defined in relation to the origin of the
/// entity coordinate system.
/// Each entity has its own local, right-handed coordinate system, where x means "forward" (e.g. driving direction), y means left and z means upwards.
/// The origin of the entity coordinate system is determined by specifying the offset of the geometric bounding box center in entity coordinates.
/// For vehicles the origin shall be the center of the rear axis.
struct BoundingBox
{
Vec3<units::length::meter_t> geometric_center{};
Dimension3 dimension{};
Vec3<units::length::meter_t> geometric_center{}; ///< Coordinates of bounding box center in local coordinate system
Dimension3 dimension{}; ///< Dimension of the bounding box (i.e. length = x dimension, width = y dimension, height = z dimension)
};
/// @brief equality
/// @details Compares the values of two BoundingBoxes.
/// @param[in] lhs left-hand side value for the comparison
/// @param[in] rhs right-hand side value for the comparison
/// @returns true if the values of lhs exactly equal to the values of rhs.
constexpr bool operator==(const BoundingBox& lhs, const BoundingBox& rhs) noexcept
{
return lhs.geometric_center == rhs.geometric_center &&
......
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -21,18 +21,29 @@
namespace mantle_api
{
/// This struct represents the dimension of the bounding box
struct Dimension3
{
units::length::meter_t length{0};
units::length::meter_t width{0};
units::length::meter_t height{0};
units::length::meter_t length{0}; ///< Length of the object’s bounding box
units::length::meter_t width{0}; ///< Width of the object’s bounding box
units::length::meter_t height{0}; ///< Height of the object’s bounding box
};
/// @brief almost-equality
/// @details Compares the values of two dimensions.
/// @param[in] lhs The left-hand side value for the comparison
/// @param[in] rhs The right-hand side value for the comparison
/// @returns true if the values of lhs almost equal to the values of rhs.
constexpr bool operator==(const Dimension3& lhs, const Dimension3& rhs) noexcept
{
return AlmostEqual(lhs.length, rhs.length) && AlmostEqual(lhs.width, rhs.width) && AlmostEqual(lhs.height, rhs.height);
}
/// @brief inequality
/// @details Compares the value of two dimensions.
/// @param[in] lhs left-hand side value for the comparison
/// @param[in] rhs right-hand side value for the comparison
/// @returns true if the value of lhs is not almost equal to the value of rhs.
constexpr bool operator!=(const Dimension3& lhs, const Dimension3& rhs) noexcept
{
return !(lhs == rhs);
......
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2023, Mercedes-Benz Tech Innovation GmbH
*
* This program and the accompanying materials are made
......@@ -23,14 +23,14 @@
#include <type_traits>
#if !defined(MANTLE_API_DEFAULT_EPS)
/// \brief Default epsilon for floating-point comparison.
/// @brief Default epsilon for floating-point comparison.
///
/// > The C++ header <limits> provides a constant std::numeric_limits<float>::epsilon()
/// > The C++ header `<limits>` provides a constant `std::numeric_limits<float>::epsilon()`
/// > for this purpose. The “standard” epsilon has the value 1.192092896e-07. This is
/// > to [_sic_] small for the problem at hand, where the error is roughly 5.0e-06. Just do the
/// > simplest thing that could work and use 1.0e-05 for epsilon. [1]
///
/// \par References
/// @par References
/// [1] Stubert, B. (2019) Comparing two floating-point numbers, Embedded Use. Available at: https://embeddeduse.com/2019/08/26/qt-compare-two-floats/ (Accessed: 10 May 2023).
///
#define MANTLE_API_DEFAULT_EPS 1.0e-05
......@@ -42,6 +42,11 @@ namespace mantle_api
namespace details
{
/// @brief The signum function, that returns the sign of a real number
///
/// @tparam T the value type
/// @param[in] value Real number
/// @returns sign of a real number
template <typename T, std::enable_if_t<std::is_arithmetic_v<T>, bool> = true>
constexpr int signum(const T value) noexcept
{
......@@ -50,18 +55,18 @@ constexpr int signum(const T value) noexcept
} // namespace details
/// \brief Default epsilon for floating-point comparison.
/// @brief Default epsilon for floating-point comparison.
///
inline constexpr auto kDefaultEps = MANTLE_API_DEFAULT_EPS;
/// \brief Compare two values for almost-equality.
///
/// \tparam T the value type
/// \param[in] lhs The left-hand side value
/// \param[in] rhs The right-hand side value
/// \param[in] epsilon The epsilon for floating-point comparison. Defaults to kDefaultEps.
/// \param[in] absolute_comparison_only True if only absolute comparison should be used to test large numbers' equality. Defaults to false.
/// @brief Compare two values for almost-equality.
///
/// @tparam T the value type
/// @param[in] lhs The left-hand side value
/// @param[in] rhs The right-hand side value
/// @param[in] epsilon The epsilon for floating-point comparison. Defaults to kDefaultEps.
/// @param[in] absolute_comparison_only True if only absolute comparison should be used to test large numbers' equality. Defaults to false.
/// @returns true if the value of lhs almost equal to the value of rhs.
template <typename T, std::enable_if_t<std::is_floating_point_v<T>, bool> = true>
constexpr bool AlmostEqual(const T lhs, const T rhs, const T epsilon = static_cast<T>(kDefaultEps), bool absolute_comparison_only = false) noexcept
{
......@@ -101,14 +106,14 @@ constexpr bool AlmostEqual(const T lhs, const T rhs, const T epsilon = static_ca
return false;
}
/// \brief Compare two values for greater-or-almost-equality.
///
/// \tparam T the value type
/// \param[in] lhs The left-hand side value
/// \param[in] rhs The right-hand side value
/// \param[in] epsilon The epsilon for floating-point comparison. Defaults to kDefaultEps.
/// \param[in] absolute_comparison_only True if only absolute comparison should be used to test large numbers' equality. Defaults to false.
/// @brief Compare two values for greater-or-almost-equality.
///
/// @tparam T the value type
/// @param[in] lhs The left-hand side value
/// @param[in] rhs The right-hand side value
/// @param[in] epsilon The epsilon for floating-point comparison. Defaults to kDefaultEps.
/// @param[in] absolute_comparison_only True if only absolute comparison should be used to test large numbers' equality. Defaults to false.
/// @returns true if the value of lhs greater or almost equal to the value of rhs.
template <typename T, std::enable_if_t<std::is_floating_point_v<T>, bool> = true>
constexpr bool GreaterOrEqual(const T lhs, const T rhs, const T epsilon = static_cast<T>(kDefaultEps), bool absolute_comparison_only = false) noexcept
{
......@@ -120,14 +125,14 @@ constexpr bool GreaterOrEqual(const T lhs, const T rhs, const T epsilon = static
return AlmostEqual(lhs, rhs, epsilon, absolute_comparison_only);
}
/// \brief Compare two values for less-or-almost-equality.
///
/// \tparam T the value type
/// \param[in] lhs The left-hand side value
/// \param[in] rhs The right-hand side value
/// \param[in] epsilon The epsilon for floating-point comparison. Defaults to kDefaultEps.
/// \param[in] absolute_comparison_only True if only absolute comparison should be used to test large numbers' equality. Defaults to false.
/// @brief Compare two values for less-or-almost-equality.
///
/// @tparam T the value type
/// @param[in] lhs The left-hand side value
/// @param[in] rhs The right-hand side value
/// @param[in] epsilon The epsilon for floating-point comparison. Defaults to kDefaultEps.
/// @param[in] absolute_comparison_only True if only absolute comparison should be used to test large numbers' equality. Defaults to false.
/// @returns true if the value of lhs less or almost equal to the value of rhs.
template <typename T, std::enable_if_t<std::is_floating_point_v<T>, bool> = true>
constexpr bool LessOrEqual(const T lhs, const T rhs, const T epsilon = static_cast<T>(kDefaultEps), bool absolute_comparison_only = false) noexcept
{
......@@ -139,42 +144,42 @@ constexpr bool LessOrEqual(const T lhs, const T rhs, const T epsilon = static_ca
return AlmostEqual(lhs, rhs, epsilon, absolute_comparison_only);
}
/// \brief Compare two values for almost-equality.
///
/// \tparam T the value type
/// \param[in] lhs The left-hand side value
/// \param[in] rhs The right-hand side value
/// \param[in] epsilon The epsilon for floating-point comparison. Defaults to kDefaultEps.
/// \param[in] absolute_comparison_only True if only absolute comparison should be used to test large numbers' equality. Defaults to false.
/// @brief Compare two values for almost-equality.
///
/// @tparam T the value type
/// @param[in] lhs The left-hand side value
/// @param[in] rhs The right-hand side value
/// @param[in] epsilon The epsilon for floating-point comparison. Defaults to kDefaultEps.
/// @param[in] absolute_comparison_only True if only absolute comparison should be used to test large numbers' equality. Defaults to false.
/// @returns true if the value of lhs almost equal to the value of rhs.
template <typename T, std::enable_if_t<units::traits::is_unit_t<T>::value, bool> = true>
constexpr bool AlmostEqual(const T lhs, const T rhs, const T epsilon = T{kDefaultEps}, bool absolute_comparison_only = false) noexcept
{
return AlmostEqual(lhs(), rhs(), epsilon(), absolute_comparison_only);
}
/// \brief Compare two values for greater-or-almost-equality.
///
/// \tparam T the value type
/// \param[in] lhs The left-hand side value
/// \param[in] rhs The right-hand side value
/// \param[in] epsilon The epsilon for floating-point comparison. Defaults to kDefaultEps.
/// \param[in] absolute_comparison_only True if only absolute comparison should be used to test large numbers' equality. Defaults to false.
/// @brief Compare two values for greater-or-almost-equality.
///
/// @tparam T the value type
/// @param[in] lhs The left-hand side value
/// @param[in] rhs The right-hand side value
/// @param[in] epsilon The epsilon for floating-point comparison. Defaults to kDefaultEps.
/// @param[in] absolute_comparison_only True if only absolute comparison should be used to test large numbers' equality. Defaults to false.
/// @returns true if the value of lhs greater or almost equal to the value of rhs.
template <typename T, std::enable_if_t<units::traits::is_unit_t<T>::value, bool> = true>
constexpr bool GreaterOrEqual(const T lhs, const T rhs, const T epsilon = T{kDefaultEps}, bool absolute_comparison_only = false) noexcept
{
return GreaterOrEqual(lhs(), rhs(), epsilon(), absolute_comparison_only);
}
/// \brief Compare two values for less-or-almost-equality.
///
/// \tparam T the value type
/// \param[in] lhs The left-hand side value
/// \param[in] rhs The right-hand side value
/// \param[in] epsilon The epsilon for floating-point comparison. Defaults to kDefaultEps.
/// \param[in] absolute_comparison_only True if only absolute comparison should be used to test large numbers' equality. Defaults to false.
/// @brief Compare two values for less-or-almost-equality.
///
/// @tparam T the value type
/// @param[in] lhs The left-hand side value
/// @param[in] rhs The right-hand side value
/// @param[in] epsilon The epsilon for floating-point comparison. Defaults to kDefaultEps.
/// @param[in] absolute_comparison_only True if only absolute comparison should be used to test large numbers' equality. Defaults to false.
/// @returns true if the value of lhs less or almost equal to the value of rhs.
template <typename T, std::enable_if_t<units::traits::is_unit_t<T>::value, bool> = true>
constexpr bool LessOrEqual(const T lhs, const T rhs, const T epsilon = T{kDefaultEps}, bool absolute_comparison_only = false) noexcept
{
......
/*******************************************************************************
* Copyright (c) 2022, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2022-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -21,8 +21,8 @@
namespace mantle_api
{
using UniqueId = std::uint64_t;
constexpr UniqueId InvalidId{std::numeric_limits<UniqueId>::max()};
using UniqueId = std::uint64_t; ///< Container for unique id
constexpr UniqueId InvalidId{std::numeric_limits<UniqueId>::max()}; ///< 'invalid' id
/// Common interface for all classes that can be referenced by an ID or name.
class IIdentifiable
......@@ -30,12 +30,16 @@ class IIdentifiable
public:
virtual ~IIdentifiable() = default;
/// The unique id is provided and maintained by the scenario simulator.
/// @brief The unique id is provided and maintained by the scenario simulator.
/// @return Unique id
[[nodiscard]] virtual UniqueId GetUniqueId() const = 0;
/// Scenario specific name of an object.
///
/// The scenario description is responsible for keeping the name unique.
/// @brief The scenario description is responsible for keeping the name unique.
/// @param name Scenario specific name of an object
virtual void SetName(const std::string& name) = 0;
/// @brief The scenario description is responsible for keeping the name unique.
/// @return Scenario specific name of an object
[[nodiscard]] virtual const std::string& GetName() const = 0;
};
......
......@@ -35,51 +35,51 @@ public:
virtual ~ILogger() = default;
/// Get the current log level from the logging interface
/// \return The current log level
/// @return The current log level
[[nodiscard]] virtual LogLevel GetCurrentLogLevel() const noexcept = 0;
/// Log a message on the logging interface
/// \param[in] level The log level of the message
/// \param[in] message The log message
/// @param[in] level The log level of the message
/// @param[in] message The log message
virtual void Log(LogLevel level, std::string_view message) noexcept = 0;
/// Log a message with log level "Trace"
/// \param[in] message The log message
/// @param[in] message The log message
inline void Trace(std::string_view message) noexcept
{
Log(LogLevel::kTrace, message);
}
/// Log a message with log level "Debug"
/// \param[in] message The log message
/// @param[in] message The log message
inline void Debug(std::string_view message) noexcept
{
Log(LogLevel::kDebug, message);
}
/// Log a message with log level "Info"
/// \param[in] message The log message
/// @param[in] message The log message
inline void Info(std::string_view message) noexcept
{
Log(LogLevel::kInfo, message);
}
/// Log a message with log level "Warning"
/// \param[in] message The log message
/// @param[in] message The log message
inline void Warning(std::string_view message) noexcept
{
Log(LogLevel::kWarning, message);
}
/// Log a message with log level "Error"
/// \param[in] message The log message
/// @param[in] message The log message
inline void Error(std::string_view message) noexcept
{
Log(LogLevel::kError, message);
}
/// Log a message with log level "Critical"
/// \param[in] message The log message
/// @param[in] message The log message
inline void Critical(std::string_view message) noexcept
{
Log(LogLevel::kCritical, message);
......
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -21,6 +21,8 @@
namespace units
{
/// Adds a single new unit to the given namespace, as well as a literal definition and `cout` support based on the given
/// `abbreviation`.
UNIT_ADD(angular_acceleration,
radians_per_second_squared,
radians_per_second_squared,
......@@ -34,6 +36,8 @@ using angular_acceleration_unit = base_unit<detail::meter_ratio<0>, std::ratio<0
UNIT_ADD_CATEGORY_TRAIT(angular_acceleration)
/// Adds a single new unit to the given namespace, as well as a literal definition and `cout` support based on the given
/// `abbreviation`.
UNIT_ADD(angular_jerk,
radians_per_second_cubed,
radians_per_second_cubed,
......@@ -55,38 +59,69 @@ template <typename T,
class = typename std::enable_if_t<units::traits::is_angle_unit<T>::value ||
units::traits::is_angular_velocity_unit<T>::value ||
units::traits::is_angular_acceleration_unit<T>::value>>
/// Definition of the orientation in terms of the Yaw/Pitch/Roll orientation angles in the Cartesian coordinate system
struct Orientation3
{
Orientation3() = default;
/// Constructor
///
/// @param[in] yaw_in yaw angle
/// @param[in] pitch_in pitch angle
/// @param[in] roll_in roll angle
Orientation3(T yaw_in, T pitch_in, T roll_in)
: yaw{yaw_in}, pitch{pitch_in}, roll{roll_in}
{
}
T yaw{};
T pitch{};
T roll{};
T yaw{}; ///< Yaw represents the rotation around the vertical axis (heading angle)
T pitch{}; ///< Pitch represents the rotation around the lateral axis (elevation angle)
T roll{}; ///< Roll represents the rotation around the longitudinal axis (bank angle)
};
/// @brief almost-equality
/// @details Compares the values of two orientations.
/// @tparam T the value type
/// @param[in] lhs The left-hand side value for the comparison
/// @param[in] rhs The right-hand side value for the comparison
/// @returns true if the values of lhs almost equal to the values of rhs.
template <typename T>
constexpr bool operator==(const Orientation3<T>& lhs, const Orientation3<T>& rhs) noexcept
{
return AlmostEqual(lhs.yaw, rhs.yaw) && AlmostEqual(lhs.pitch, rhs.pitch) && AlmostEqual(lhs.roll, rhs.roll);
}
/// @brief inequality
/// @details Compares the value of two orientations.
/// @tparam T the value type
/// @param[in] lhs left-hand side value for the comparison
/// @param[in] rhs right-hand side value for the comparison
/// @returns true if the value of lhs is not almost equal to the value of rhs.
template <typename T>
constexpr bool operator!=(const Orientation3<T>& lhs, const Orientation3<T>& rhs) noexcept
{
return !(lhs == rhs);
}
/// @brief addition
/// @details Returns the sum of two orientations
/// @tparam T the value type
/// @param[in] lhs left-hand side value for the sum
/// @param[in] rhs right-hand side value for the sum
/// @returns sum of lhs and rhs.
template <typename T>
constexpr Orientation3<T> operator+(const Orientation3<T>& lhs, const Orientation3<T>& rhs) noexcept
{
return Orientation3<T>{lhs.yaw + rhs.yaw, lhs.pitch + rhs.pitch, lhs.roll + rhs.roll};
}
/// @brief subtraction
/// @details Returns the difference of two orientations
/// @tparam T the value type
/// @param[in] lhs left-hand side value for the difference
/// @param[in] rhs right-hand side value for the difference
/// @returns difference of lhs and rhs.
template <typename T>
constexpr Orientation3<T> operator-(const Orientation3<T>& lhs, const Orientation3<T>& rhs) noexcept
{
......
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -23,19 +23,32 @@
namespace mantle_api
{
/// This struct represents the point of a polygonal chain (polyline) trajectory specification
struct PolyLinePoint
{
Pose pose{};
std::optional<Time> time{};
Pose pose{}; ///< Pose of the PolyLinePoint
std::optional<Time> time{}; ///< Time specification of the PolyLinePoint
/// @brief Equality comparison for PolyLinePoint.
///
/// @param[in] other The left-hand side value for the comparison
/// @returns true if the values of `this` exactly equal to the values of other.
bool operator==(const PolyLinePoint& other) const
{
return other.time == time && other.pose == pose;
}
/// @brief Prints a human-readable representation of 'polyLinePoint' to 'os'.
/// @param os The output stream
/// @param polyLinePoint The point of a polygonal chain (polyline) trajectory specification
/// @returns 'polyLinePoint' in a human-readable format
friend std::ostream& operator<<(std::ostream& os, const PolyLinePoint& polyLinePoint);
};
/// @brief Prints a human-readable representation of 'polyLinePoint' to 'os'.
/// @param os The output stream
/// @param polyLinePoint The point of a polygonal chain (polyline) trajectory specification
/// @returns 'polyLinePoint' in a human-readable format
inline std::ostream& operator<<(std::ostream& os, const PolyLinePoint& polyLinePoint)
{
os << polyLinePoint.pose;
......@@ -48,6 +61,7 @@ inline std::ostream& operator<<(std::ostream& os, const PolyLinePoint& polyLineP
return os;
}
/// The list of polyline points
using PolyLine = std::vector<PolyLinePoint>;
} // namespace mantle_api
......
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -23,19 +23,34 @@
namespace mantle_api
{
/// Pose in the Cartesian coordinate system
struct Pose
{
/// Position defined in terms of the x/y/z coordinates in the Cartesian coordinate system
Vec3<units::length::meter_t> position{};
/// Orientation defined in terms of the Yaw/Pitch/Roll orientation angles in the Cartesian coordinate system
Orientation3<units::angle::radian_t> orientation{};
/// @brief Equality comparison for Pose.
///
/// @param[in] other The left-hand side value for the comparison
/// @returns true if the values of `this` exactly equal to the values of other.
bool operator==(const Pose& other) const
{
return other.position == position && other.orientation == orientation;
}
/// @brief Prints a human-readable representation of 'pose' to 'os'.
/// @param os The output stream
/// @param pose Open scenario pose
/// @returns 'pose' in a human-readable format
friend inline std::ostream& operator<<(std::ostream& os, const Pose& pose);
};
/// @brief Prints a human-readable representation of 'pose' to 'os'.
/// @param os The output stream
/// @param pose Open scenario pose
/// @returns 'pose' in a human-readable format
std::ostream& operator<<(std::ostream& os, const Pose& pose)
{
os << "position ("
......
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -26,6 +26,7 @@
namespace mantle_api
{
/// Position defined in terms of the road coordinates (t,s) applied to a given road as defined in OpenDRIVE
struct OpenDriveRoadPosition
{
/// @brief RoadId as defined in OpenDRIVE
......@@ -36,6 +37,7 @@ struct OpenDriveRoadPosition
units::length::meter_t t_offset{0.0};
};
/// Position that is determined by a lane (lane ID as defined in OpenDRIVE) and the s coordinate of a given road
struct OpenDriveLanePosition
{
/// @brief RoadId as defined in OpenDRIVE
......@@ -48,6 +50,7 @@ struct OpenDriveLanePosition
units::length::meter_t t_offset{0.0};
};
/// Position defined in terms of the spherical geographic coordinates (angular Longitude and Latitude)
struct LatLonPosition
{
/// @brief GPS latitude, unit: [rad]
......@@ -56,11 +59,15 @@ struct LatLonPosition
units::angle::radian_t longitude{0.0};
};
/// Variant of possible definitions of position (e.g. in terms of the road coordinates, spherical geographic coordinates etc.)
using Position = std::variant<OpenDriveRoadPosition, OpenDriveLanePosition, LatLonPosition, Vec3<units::length::meter_t>>;
/// @brief Equality comparison for OpenDriveRoadPosition.
///
/// **Attention** Floating-point comparision may require tweaks in precision.
/// @param[in] lhs The left-hand side value for the comparison
/// @param[in] rhs The right-hand side value for the comparison
/// @returns true if the values of lhs (almost) equal to the values of rhs.
inline bool operator==(const OpenDriveRoadPosition& lhs, const OpenDriveRoadPosition& rhs) noexcept
{
return lhs.road == rhs.road &&
......@@ -68,6 +75,11 @@ inline bool operator==(const OpenDriveRoadPosition& lhs, const OpenDriveRoadPosi
AlmostEqual(lhs.t_offset, rhs.t_offset);
}
/// @brief Inequality comparison for OpenDriveLanePosition.
///
/// @param[in] lhs left-hand side value for the comparison
/// @param[in] rhs right-hand side value for the comparison
/// @returns true if the value of lhs is not almost equal to the value of rhs.
inline bool operator!=(const OpenDriveRoadPosition& lhs, const OpenDriveRoadPosition& rhs) noexcept
{
return !(lhs == rhs);
......@@ -76,6 +88,9 @@ inline bool operator!=(const OpenDriveRoadPosition& lhs, const OpenDriveRoadPosi
/// @brief Equality comparison for OpenDriveLanePosition.
///
/// **Attention** Floating-point comparision may require tweaks in precision.
/// @param[in] lhs The left-hand side value for the comparison
/// @param[in] rhs The right-hand side value for the comparison
/// @returns true if the values of lhs (almost) equal to the values of rhs.
inline bool operator==(const OpenDriveLanePosition& lhs, const OpenDriveLanePosition& rhs) noexcept
{
return lhs.road == rhs.road &&
......@@ -84,6 +99,11 @@ inline bool operator==(const OpenDriveLanePosition& lhs, const OpenDriveLanePosi
AlmostEqual(lhs.t_offset, rhs.t_offset);
}
/// @brief Inequality comparison for OpenDriveLanePosition.
///
/// @param[in] lhs left-hand side value for the comparison
/// @param[in] rhs right-hand side value for the comparison
/// @returns true if the value of lhs is not almost equal to the value of rhs.
inline bool operator!=(const OpenDriveLanePosition& lhs, const OpenDriveLanePosition& rhs) noexcept
{
return !(lhs == rhs);
......@@ -92,11 +112,19 @@ inline bool operator!=(const OpenDriveLanePosition& lhs, const OpenDriveLanePosi
/// @brief Equality comparison for LatLonPosition.
///
/// **Attention** Floating-point comparision may require tweaks in precision.
/// @param[in] lhs The left-hand side value for the comparison
/// @param[in] rhs The right-hand side value for the comparison
/// @returns true if the values of lhs almost equal to the values of rhs.
constexpr bool operator==(const LatLonPosition& lhs, const LatLonPosition& rhs) noexcept
{
return AlmostEqual(lhs.latitude, rhs.latitude) && AlmostEqual(lhs.longitude, rhs.longitude);
}
/// @brief Inequality comparison for LatLonPosition.
///
/// @param[in] lhs left-hand side value for the comparison
/// @param[in] rhs right-hand side value for the comparison
/// @returns true if the value of lhs is not almost equal to the value of rhs.
constexpr bool operator!=(const LatLonPosition& lhs, const LatLonPosition& rhs) noexcept
{
return !(lhs == rhs);
......
/*******************************************************************************
* Copyright (c) 2022, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2022-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -33,7 +33,9 @@ enum class RouteStrategy
/// Groups a Waypoint with a RouteStrategy
struct RouteWaypoint
{
/// Reference position used to form a route
mantle_api::Vec3<units::length::meter_t> waypoint{};
/// Defines how a route should be calculated
RouteStrategy route_strategy{RouteStrategy::kUndefined};
};
......@@ -41,6 +43,7 @@ struct RouteWaypoint
/// linking them, from which the actual route can be calculated
struct RouteDefinition
{
/// The list of waypoints with associated RouteStrategies
std::vector<mantle_api::RouteWaypoint> waypoints{};
};
......
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -27,6 +27,8 @@
namespace units
{
/// Adds unit 'jerk' to the given namespace, as well as a literal definition and `cout` support based on the given
/// `abbreviation`.
UNIT_ADD(jerk,
meters_per_second_cubed,
meters_per_second_cubed,
......@@ -42,6 +44,8 @@ using jerk_unit = base_unit<detail::meter_ratio<1>, std::ratio<0>, std::ratio<-3
UNIT_ADD_CATEGORY_TRAIT(jerk)
/// Adds new unit 'jerk_acceleration' to the given namespace, as well as a literal definition and `cout` support based on the given
/// `abbreviation`.
UNIT_ADD(jerk_acceleration,
meters_per_second_to_the_power_of_four,
meters_per_second_to_the_power_of_four,
......@@ -62,26 +66,32 @@ UNIT_ADD_CATEGORY_TRAIT(jerk_acceleration)
namespace mantle_api
{
/// Definition of a spline segment represented by the polynomial parameters a, b, c, d
/// @tparam T Type of polynomial parameters
template <typename T>
struct SplineSegment
{
Vec3<T> a;
Vec3<T> b;
Vec3<T> c;
Vec3<T> d;
Vec3<T> a; ///< Polynom parameter a, e.g. unit: [m]
Vec3<T> b; ///< Polynom parameter b, e.g. unit: [1/m]
Vec3<T> c; ///< Polynom parameter c, e.g. unit: [1/m²]
Vec3<T> d; ///< Polynom parameter d, e.g. unit: [1/m³]
};
/// Definition of the section of the spline curve
/// @tparam T the value type
template <typename T, class = typename std::enable_if_t<units::traits::is_unit<T>::value>>
struct SplineSection
{
/// Time specification at the start of the section of the spline curve
Time start_time{0};
/// Time specification at the end of the section of the spline curve
Time end_time{0};
/// @brief Represents the polynomial.
///
/// The tuple stores in format \f$[a_3, a_2, a_1, a_0]\f$ for a polynomial in form
/// \f[
/// @f[
/// P(x) = \sum_{i=0}^{3} a_{i} x^{i} = a_3 x^3 + a_2 x^2 + a_1 x + a_0
/// \f]
/// @f]
std::tuple<units::unit_t<units::compound_unit<T, units::inverse<units::cubed<units::time::second>>>>,
units::unit_t<units::compound_unit<T, units::inverse<units::squared<units::time::second>>>>,
units::unit_t<units::compound_unit<T, units::inverse<units::time::second>>>,
......@@ -94,6 +104,11 @@ struct SplineSection
};
/// @brief Equality comparison for SplineSection.
///
/// @tparam T the value type
/// @param[in] lhs The left-hand side value for the comparison
/// @param[in] rhs The right-hand side value for the comparison
/// @returns true if the values of lhs (almost) equal to the values of rhs.
template <typename T, class = typename std::enable_if_t<units::traits::is_unit<T>::value>>
constexpr bool operator==(const SplineSection<T>& lhs, const SplineSection<T>& rhs) noexcept
{
......
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -21,21 +21,21 @@
namespace mantle_api
{
using Time = units::time::millisecond_t;
using Time = units::time::millisecond_t; ///< Time in ms
/// @brief Converts input in [s] to @ref Time.
/// @brief Converts input in [s] to @cond \ref Time @endcond.
/// @tparam T Input type, e.g. `double`.
/// @param duration Input value
/// @return Duration representing the given input in units of @ref Time.
/// @return Duration representing the given input in units of @cond \ref Time @endcond.
template <typename T>
inline Time SecondsToTime(T duration)
{
return {std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::duration<T>{duration})};
}
/// @brief Converts input @ref Time to [s].
/// @brief Converts input @cond \ref Time @endcond to [s].
/// @param time Time
/// @return Duration in seconds representing the passed in @ref Time.
/// @return Duration in seconds representing the passed in @cond \ref Time @endcond.
inline double TimeToSeconds(const Time& time)
{
return units::time::second_t{time}.value();
......
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -22,14 +22,23 @@
namespace mantle_api
{
/// Definition of a trajectory type in terms of shape
struct Trajectory
{
std::string name;
std::variant<PolyLine> type;
std::string name; ///< Name of the trajectory type
std::variant<PolyLine> type; ///< Trajectory type in terms of shape
/// @brief Prints a human-readable representation of 'trajectory' to 'os'.
/// @param os The output stream
/// @param trajectory Open scenario trajectory
/// @returns 'trajectory' in a human-readable format
friend std::ostream& operator<<(std::ostream& os, const Trajectory& trajectory);
};
/// @brief Prints a human-readable representation of 'trajectory' to 'os'.
/// @param os The output stream
/// @param trajectory Open scenario trajectory
/// @returns 'trajectory' in a human-readable format
inline std::ostream& operator<<(std::ostream& os, const Trajectory& trajectory)
{
os << "Trajectory \"" << trajectory.name;
......
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -23,69 +23,130 @@ namespace mantle_api
{
template <typename T, class = typename std::enable_if_t<units::traits::is_unit_t<T>::value>>
/// 3-dimensional vector that contains three components (x, y, z) in the right-handed Cartesian coordinate system
struct Vec3
{
Vec3() = default;
/// Constructor
///
/// @param[in] x_in x-value
/// @param[in] y_in y-value
/// @param[in] z_in z-value
Vec3(T x_in, T y_in, T z_in)
: x{x_in}, y{y_in}, z{z_in}
{
}
T x{0};
T y{0};
T z{0};
T x{0}; ///< x-component
T y{0}; ///< y-component
T z{0}; ///< z-component
/// @brief Returns length of the vector
///
/// @returns length of the vector
inline T Length() const { return units::math::sqrt((x * x) + (y * y) + (z * z)); }
/// @brief Changes the sign of the 3d vector
///
/// @returns 3d vector
inline Vec3<T> operator-() const noexcept
{
return {-x, -y, -z};
}
};
/// @brief almost-equality
/// @details Compares the values of two 3d vectors.
/// @tparam T the value type
/// @param[in] lhs The left-hand side value for the comparison
/// @param[in] rhs The right-hand side value for the comparison
/// @returns true if the values of lhs almost equal to the values of rhs.
template <typename T>
constexpr bool operator==(const Vec3<T>& lhs, const Vec3<T>& rhs) noexcept
{
return AlmostEqual(lhs.x, rhs.x) && AlmostEqual(lhs.y, rhs.y) && AlmostEqual(lhs.z, rhs.z);
}
/// @brief inequality
/// @details Compares the value of two 3d vectors.
/// @tparam T the value type
/// @param[in] lhs left-hand side value for the comparison
/// @param[in] rhs right-hand side value for the comparison
/// @returns true if the value of lhs is not almost equal to the value of rhs.
template <typename T>
constexpr bool operator!=(const Vec3<T>& lhs, const Vec3<T>& rhs) noexcept
{
return !(lhs == rhs);
}
/// @brief subtraction
/// @details Returns the difference of two 3d vectors
/// @tparam T the value type
/// @param[in] lhs left-hand side value for the difference
/// @param[in] rhs right-hand side value for the difference
/// @returns difference of lhs and rhs.
template <typename T>
constexpr Vec3<T> operator-(const Vec3<T>& lhs, const Vec3<T>& rhs) noexcept
{
return {lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z};
}
/// @brief addition
/// @details Returns the sum of two 3d vectors
/// @tparam T the value type
/// @param[in] lhs left-hand side value for the sum
/// @param[in] rhs right-hand side value for the sum
/// @returns sum of lhs and rhs.
template <typename T>
constexpr Vec3<T> operator+(const Vec3<T>& lhs, const Vec3<T>& rhs) noexcept
{
return {lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z};
}
/// @brief multiplication
/// @details Multiplication by a scalar for 3d vector
/// @tparam T the value type
/// @param[in] lhs left-hand side value for the multiplication
/// @param[in] d scalar
/// @returns the scalar multiplied vector
template <typename T>
constexpr Vec3<T> operator*(const Vec3<T>& lhs, double d) noexcept
{
return {lhs.x * d, lhs.y * d, lhs.z * d};
}
/// @brief multiplication
/// @details Multiplication by a scalar for 3d vector
/// @tparam T the value type
/// @param[in] d scalar
/// @param[in] rhs right-hand side value for the multiplication
/// @returns the scalar multiplied vector
template <typename T>
constexpr Vec3<T> operator*(double d, const Vec3<T>& rhs) noexcept
{
return rhs * d;
}
/// @brief division
/// @details Division by a scalar for 3d vector
/// @tparam T the value type
/// @param[in] lhs left-hand side value for the division
/// @param[in] d scalar
/// @returns the lhs divided by d
template <typename T>
constexpr Vec3<T> operator/(const Vec3<T>& lhs, double d) noexcept
{
return {lhs.x / d, lhs.y / d, lhs.z / d};
}
/// @brief addable
/// @details Add a 3d vector to a 3d vector
/// @tparam T the value type
/// @param[in] lhs left-hand side value
/// @param[in] rhs right-hand side value, which will be added
/// @returns the lhs where rhs is added
template <typename T>
constexpr Vec3<T> operator+=(Vec3<T>& lhs, const Vec3<T>& rhs) noexcept
{
......@@ -95,6 +156,12 @@ constexpr Vec3<T> operator+=(Vec3<T>& lhs, const Vec3<T>& rhs) noexcept
return lhs;
}
/// @brief subtractable
/// @details Subtract a 3d vector from a 3d vector
/// @tparam T the value type
/// @param[in] lhs left-hand side value
/// @param[in] rhs right-hand side value
/// @returns the lhs from where rhs is subtracted
template <typename T>
constexpr Vec3<T> operator-=(Vec3<T>& lhs, const Vec3<T>& rhs) noexcept
{
......@@ -104,6 +171,12 @@ constexpr Vec3<T> operator-=(Vec3<T>& lhs, const Vec3<T>& rhs) noexcept
return lhs;
}
/// @brief addable
/// @details Add a scalar to a 3d vector
/// @tparam T the value type
/// @param[in] lhs left-hand side value
/// @param[in] d scalar
/// @returns the lhs where d is added
template <typename T>
constexpr Vec3<T> operator+=(Vec3<T>& lhs, double d) noexcept
{
......@@ -112,6 +185,13 @@ constexpr Vec3<T> operator+=(Vec3<T>& lhs, double d) noexcept
lhs.z += d;
return lhs;
}
/// @brief subtractable
/// @details Subtract a scalar from a 3d vector
/// @tparam T Type of vector components
/// @param[in] lhs left-hand side value
/// @param[in] d scalar
/// @returns the lhs from where d is subtracted
template <typename T>
constexpr Vec3<T> operator-=(Vec3<T>& lhs, double d) noexcept
{
......
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -20,15 +20,21 @@
namespace mantle_api
{
/// Definition of the position of the rectangle
struct Rectangle
{
/// The position of the lower left corner of the rectangle
Position bottom_left{};
/// The position of upper right corner of the rectangle
Position top_right{};
};
/// Definition of the road friction patch
struct FrictionPatch
{
/// Geometric properties of the road friction patch
Rectangle bounding_box{};
/// Percentage of road friction
units::concentration::percent_t friction{100.0};
};
} // namespace mantle_api
......
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
......@@ -19,6 +19,7 @@
namespace mantle_api
{
/// Specify the amount of the precipitation.
enum class Precipitation
{
kUnknown,
......@@ -32,6 +33,7 @@ enum class Precipitation
kExtreme
};
/// Specify the amount of the fog.
enum class Fog
{
kUnknown,
......@@ -46,6 +48,7 @@ enum class Fog
kDense
};
/// Specify the level of illumination.
enum class Illumination
{
kUnknown,
......@@ -61,14 +64,15 @@ enum class Illumination
kLevel9
};
/// Definition of weather conditions in terms of fog, precipitation, illumination, humidity, temperature and atmospheric pressure states
struct Weather
{
Fog fog{Fog::kExcellentVisibility};
Precipitation precipitation{Precipitation::kNone};
Illumination illumination{Illumination::kOther};
units::concentration::percent_t humidity{0.0};
units::temperature::kelvin_t temperature{0.0};
units::pressure::pascal_t atmospheric_pressure{0.0};
Fog fog{Fog::kExcellentVisibility}; ///< Defines the fog, i.e. visual range
Precipitation precipitation{Precipitation::kNone}; ///< Defines the precipitation, i.e. intensity
Illumination illumination{Illumination::kOther}; ///< Defines the illumination using levels
units::concentration::percent_t humidity{0.0}; ///< Defines the humidity
units::temperature::kelvin_t temperature{0.0}; ///< Defines the outside temperature around the entities of the scenario
units::pressure::pascal_t atmospheric_pressure{0.0}; ///< Defines the atmospheric pressure around the entities of the scenario
};
} // namespace mantle_api
......
......@@ -33,6 +33,7 @@
namespace mantle_api
{
/// Base interface for the environment conditions (e.g. time of day, weather, road condition) of a scenario
class IEnvironment
{
public:
......@@ -40,8 +41,9 @@ public:
/// Load a map file and parse it into the memory.
///
/// @param file_path map file path from the scenario file. If this path is not resolved by the engine, the
/// environment must do so.
/// @param map_file_path map file path from the scenario file. If this path is not resolved by the engine, the
/// environment must do so.
/// @param map_details Area of the map
virtual void CreateMap(const std::string& map_file_path, const mantle_api::MapDetails& map_details) = 0;
/// Assigns an entity to the specified controller. This controller needs to be created beforehand.
......@@ -67,27 +69,73 @@ public:
///
/// @param entity_id The entity to check
/// @param type The control strategy type
/// @return true if a control strategy of a certain type for a specific entity has been fulfilled
[[nodiscard]] virtual bool HasControlStrategyGoalBeenReached(UniqueId entity_id, mantle_api::ControlStrategyType type) const = 0;
/// @brief Retrieves the ILaneLocationQueryService that provides abstraction layer for all map related functions
///
/// @return reference to the ILaneLocationQueryService
[[nodiscard]] virtual const ILaneLocationQueryService& GetQueryService() const = 0;
/// @brief Retrieves the coord converter that provides transformation of different position types, curvature, elevation etc.
///
/// @return pointer to the coord converter interface
[[nodiscard]] virtual const ICoordConverter* GetConverter() const = 0;
/// @brief Retrieves the geometry helper that provides functionality to perform geometrical calculations
///
/// @return pointer to the geometry helper interface
[[nodiscard]] virtual const IGeometryHelper* GetGeometryHelper() const = 0;
/// @brief Retrieves the entity repository that provides CRUD functionality for scenario entities
///
/// @return reference to the entity repository interface
virtual IEntityRepository& GetEntityRepository() = 0;
/// @brief Retrieves the entity repository that provides CRUD functionality for scenario entities
///
/// @return const reference to the entity repository interface
[[nodiscard]] virtual const IEntityRepository& GetEntityRepository() const = 0;
/// @brief Retrieves the controller repository that provides CRUD functionality for controllers
///
/// @return reference to the controller repository interface
virtual IControllerRepository& GetControllerRepository() = 0;
/// @brief Retrieves the controller repository that provides CRUD functionality for controllers
///
/// @return const reference to the controller repository interface
[[nodiscard]] virtual const IControllerRepository& GetControllerRepository() const = 0;
/// @brief DateTime in UTC (converted from RFC 3339 standard)
/// @brief Sets the DateTime in UTC (converted from RFC 3339 standard)
///
/// @param time Time in ms
virtual void SetDateTime(mantle_api::Time time) = 0;
/// @brief Gets the DateTime in UTC
///
/// @return time in ms
virtual mantle_api::Time GetDateTime() = 0;
/// @brief Time since start of simulation
/// @brief Gets the time since start of simulation
///
/// @return time since start of simulation in ms
virtual mantle_api::Time GetSimulationTime() = 0;
/// @brief Sets the weather conditions
///
/// @param weather Weather conditions to be used
virtual void SetWeather(Weather weather) = 0;
/// @brief Sets the road conditions
///
/// @param friction_patches Friction patches on the road
virtual void SetRoadCondition(std::vector<FrictionPatch> friction_patches) = 0;
/// @brief Sets the state of a traffic signal
///
/// @param traffic_signal_name ID of the traffic signal
/// @param traffic_signal_state State of the traffic signal to be used
virtual void SetTrafficSignalState(const std::string& traffic_signal_name, const std::string& traffic_signal_state) = 0;
/// @brief Execute a command that is specific for an environment implementation
......@@ -126,7 +174,9 @@ public:
/// @param parameters The traffic swarm parameters
virtual void InitTrafficSwarmService(const TrafficSwarmParameters& parameters) = 0;
/// @brief Returns the traffic swarm service
/// @brief Gets the traffic swarm service
///
/// @return reference to the traffic swarm service interface
[[nodiscard]] virtual ITrafficSwarmService& GetTrafficSwarmService() = 0;
};
} // namespace mantle_api
......
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2022 Ansys, Inc.
*
* This program and the accompanying materials are made
......@@ -22,6 +22,8 @@
namespace mantle_api
{
/// Base interface for the scenario
class IScenarioEngine
{
public:
......@@ -31,6 +33,7 @@ public:
virtual void Init() = 0;
/// Provide information about the scenario loaded in `Init()`
/// @return information about the scenario
[[nodiscard]] virtual ScenarioInfo GetScenarioInfo() const = 0;
/// Calculate the new state of the scenario implementation.
......@@ -43,6 +46,7 @@ public:
/// @return `true` if processing the scenario is complete, `false` otherwise.
[[nodiscard]] virtual bool IsFinished() const = 0;
/// Activates external controller for the host
virtual void ActivateExternalHostControl() = 0;
/// Check if the scenario and catalog has been parsed correctly
......
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