From 694abe440c913d41e7b0fbe4a7723745175cbf30 Mon Sep 17 00:00:00 2001
From: Arun Das <arun.das@bmw.de>
Date: Tue, 6 Apr 2021 13:36:40 +0200
Subject: [PATCH] Update interface

Signed-off-by: Arun Das <arun.das@bmw.de>
---
 MantleAPI/BUILD.bazel                         |  18 +--
 .../include/MantleAPI/Common/bounding_box.h   |  32 ++--
 .../include/MantleAPI/Common/dimension.h      |  16 +-
 .../MantleAPI/Common/floating_point_helper.h  |  23 +--
 .../include/MantleAPI/Common/i_identifiable.h |  17 +-
 .../include/MantleAPI/Common/orientation.h    |  36 +++--
 MantleAPI/include/MantleAPI/Common/pose.h     |  16 +-
 MantleAPI/include/MantleAPI/Common/position.h |  22 +--
 .../MantleAPI/Common/simulation_time.h        |  41 +++--
 MantleAPI/include/MantleAPI/Common/spline.h   |  22 +--
 MantleAPI/include/MantleAPI/Common/vector.h   |  22 +--
 .../EnvironmentalConditions/date_time.h       |  31 ++++
 .../EnvironmentalConditions/road_condition.h  |  16 +-
 .../EnvironmentalConditions/weather.h         |  26 ++-
 .../MantleAPI/Execution/i_environment.h       |  39 +++--
 .../MantleAPI/Execution/i_scenario_engine.h   |  19 +--
 .../MantleAPI/Execution/scenario_info.h       |  19 ++-
 .../include/MantleAPI/Map/i_coord_converter.h |  17 +-
 .../Map/i_lane_location_query_service.h       |  28 ++--
 MantleAPI/include/MantleAPI/Map/i_route.h     |  17 +-
 .../MantleAPI/Traffic/control_strategy.h      | 128 +++++++++++++++
 .../MantleAPI/Traffic/entity_properties.h     |  33 ++--
 .../MantleAPI/Traffic/i_controller_config.h   |  75 +++++++--
 .../include/MantleAPI/Traffic/i_entity.h      |  34 ++--
 .../MantleAPI/Traffic/i_entity_repository.h   |  17 +-
 MantleAPI/test/MantleAPI/Test/test_utils.h    | 152 +++++++++++-------
 MantleAPI/test/interface_test.cpp             |  19 ++-
 27 files changed, 618 insertions(+), 317 deletions(-)
 create mode 100644 MantleAPI/include/MantleAPI/EnvironmentalConditions/date_time.h
 create mode 100644 MantleAPI/include/MantleAPI/Traffic/control_strategy.h

diff --git a/MantleAPI/BUILD.bazel b/MantleAPI/BUILD.bazel
index 02f78c62..e533abec 100644
--- a/MantleAPI/BUILD.bazel
+++ b/MantleAPI/BUILD.bazel
@@ -1,12 +1,12 @@
-/*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+################################################################################
+# Copyright (c) 2021, 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
+# which is available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+################################################################################
 
 cc_library(
     name = "mantle_api",
diff --git a/MantleAPI/include/MantleAPI/Common/bounding_box.h b/MantleAPI/include/MantleAPI/Common/bounding_box.h
index 3c611b8f..7be0db8e 100644
--- a/MantleAPI/include/MantleAPI/Common/bounding_box.h
+++ b/MantleAPI/include/MantleAPI/Common/bounding_box.h
@@ -1,12 +1,12 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  bounding_box.h */
@@ -15,20 +15,24 @@
 #ifndef MANTLEAPI_COMMON_BOUNDINGBOX_H
 #define MANTLEAPI_COMMON_BOUNDINGBOX_H
 
-#include <MantleAPI/Common/i_position.h>
+#include <MantleAPI/Common/dimension.h>
 #include <MantleAPI/Common/vector.h>
 
 namespace mantle_api
 {
-/// Bounding box is defined in local object coordinate system.
-/// The origin of the object coordinate system is defined in relation to the geometric center.
+/// Bounding box is defined in local entity coordinate system.
+/// The origin of the entity coordinate system is defined in relation to the geometric center.
 struct BoundingBox
 {
     Vec3d geometric_center{0.0, 0.0, 0.0};
-    double width{0.0};
-    double length{0.0};
-    double height{0.0};
+    Dimension3d dimension{0.0, 0.0, 0.0};
 };
+
+inline bool operator==(const BoundingBox& lhs, const BoundingBox& rhs) noexcept
+{
+    return lhs.geometric_center == rhs.geometric_center && lhs.dimension == rhs.dimension;
+}
+
 }  // namespace mantle_api
 
 #endif  // MANTLEAPI_COMMON_BOUNDINGBOX_H
diff --git a/MantleAPI/include/MantleAPI/Common/dimension.h b/MantleAPI/include/MantleAPI/Common/dimension.h
index f7650230..64b97e29 100644
--- a/MantleAPI/include/MantleAPI/Common/dimension.h
+++ b/MantleAPI/include/MantleAPI/Common/dimension.h
@@ -1,12 +1,12 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  dimension.h */
diff --git a/MantleAPI/include/MantleAPI/Common/floating_point_helper.h b/MantleAPI/include/MantleAPI/Common/floating_point_helper.h
index 218c26ae..ea93a5fd 100644
--- a/MantleAPI/include/MantleAPI/Common/floating_point_helper.h
+++ b/MantleAPI/include/MantleAPI/Common/floating_point_helper.h
@@ -1,23 +1,24 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  floating_point_helper.h */
 //-----------------------------------------------------------------------------
 
-#ifndef THIRDPARTY_MANTLEAPI_INCLUDE_MANTLEAPI_COMMON_FLOATING_POINT_HELPER_H
-#define THIRDPARTY_MANTLEAPI_INCLUDE_MANTLEAPI_COMMON_FLOATING_POINT_HELPER_H
+#ifndef MANTLEAPI_COMMON_FLOATING_POINT_HELPER_H
+#define MANTLEAPI_COMMON_FLOATING_POINT_HELPER_H
 
 #include <cmath>
 #include <limits>
 #include <type_traits>
+
 namespace mantle_api
 {
 
@@ -90,4 +91,4 @@ bool LessOrEqual(T lhs, T rhs, T precision = std::numeric_limits<T>::epsilon())
 }
 }  // namespace mantle_api
 
-#endif  // THIRDPARTY_MANTLEAPI_INCLUDE_MANTLEAPI_COMMON_FLOATING_POINT_HELPER_H
+#endif  // MANTLEAPI_COMMON_FLOATING_POINT_HELPER_H
diff --git a/MantleAPI/include/MantleAPI/Common/i_identifiable.h b/MantleAPI/include/MantleAPI/Common/i_identifiable.h
index 71ea8d6e..24b6a927 100644
--- a/MantleAPI/include/MantleAPI/Common/i_identifiable.h
+++ b/MantleAPI/include/MantleAPI/Common/i_identifiable.h
@@ -1,18 +1,17 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  i_identifiable.h */
 //-----------------------------------------------------------------------------
 
-
 #ifndef MANTLEAPI_COMMON_IIDENTIFIABLE_H
 #define MANTLEAPI_COMMON_IIDENTIFIABLE_H
 
diff --git a/MantleAPI/include/MantleAPI/Common/orientation.h b/MantleAPI/include/MantleAPI/Common/orientation.h
index d9651e5a..ab2038fb 100644
--- a/MantleAPI/include/MantleAPI/Common/orientation.h
+++ b/MantleAPI/include/MantleAPI/Common/orientation.h
@@ -1,20 +1,19 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  orientation.h */
 //-----------------------------------------------------------------------------
 
-
-#ifndef SIMULATOR_ORIENTATION_H
-#define SIMULATOR_ORIENTATION_H
+#ifndef MANTLEAPI_COMMON_ORIENTATION_H
+#define MANTLEAPI_COMMON_ORIENTATION_H
 
 #include <MantleAPI/Common/floating_point_helper.h>
 
@@ -24,6 +23,9 @@ namespace mantle_api
 template <typename T>
 struct Orientation3
 {
+    Orientation3() = default;
+    Orientation3(T yaw, T pitch, T roll) : yaw{yaw}, pitch{pitch}, roll{roll} {}
+
     T yaw{};
     T pitch{};
     T roll{};
@@ -41,6 +43,16 @@ inline bool operator!=(const Orientation3d& lhs, const Orientation3d& rhs) noexc
     return !(lhs == rhs);
 }
 
+inline Orientation3d operator+(const Orientation3d& lhs, const Orientation3d& rhs) noexcept
+{
+    return Orientation3d{lhs.yaw + rhs.yaw, lhs.pitch + rhs.pitch, lhs.roll + rhs.roll};
+}
+
+inline Orientation3d operator-(const Orientation3d& lhs, const Orientation3d& rhs) noexcept
+{
+    return Orientation3d{lhs.yaw - rhs.yaw, lhs.pitch - rhs.pitch, lhs.roll - rhs.roll};
+}
+
 }  // namespace mantle_api
 
-#endif  // SIMULATOR_ORIENTATION_H
+#endif  // MANTLEAPI_COMMON_ORIENTATION_H
diff --git a/MantleAPI/include/MantleAPI/Common/pose.h b/MantleAPI/include/MantleAPI/Common/pose.h
index 57b41c93..0cbdd8e6 100644
--- a/MantleAPI/include/MantleAPI/Common/pose.h
+++ b/MantleAPI/include/MantleAPI/Common/pose.h
@@ -1,12 +1,12 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  pose.h */
diff --git a/MantleAPI/include/MantleAPI/Common/position.h b/MantleAPI/include/MantleAPI/Common/position.h
index d8d01314..029e375a 100644
--- a/MantleAPI/include/MantleAPI/Common/position.h
+++ b/MantleAPI/include/MantleAPI/Common/position.h
@@ -1,19 +1,19 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  position.h */
 //-----------------------------------------------------------------------------
 
-#ifndef SCENARIOABSTRACT_COMMON_IPOSITION_H
-#define SCENARIOABSTRACT_COMMON_IPOSITION_H
+#ifndef MANTLEAPI_COMMON_IPOSITION_H
+#define MANTLEAPI_COMMON_IPOSITION_H
 
 #include <MantleAPI/Common/floating_point_helper.h>
 #include <MantleAPI/Common/vector.h>
@@ -79,4 +79,4 @@ inline bool operator!=(const LatLonPosition& lhs, const LatLonPosition& rhs) noe
 }
 
 }  // namespace mantle_api
-#endif  // SCENARIOABSTRACT_COMMON_IPOSITION_H
+#endif  // MANTLEAPI_COMMON_IPOSITION_H
diff --git a/MantleAPI/include/MantleAPI/Common/simulation_time.h b/MantleAPI/include/MantleAPI/Common/simulation_time.h
index 4e94030a..77200149 100644
--- a/MantleAPI/include/MantleAPI/Common/simulation_time.h
+++ b/MantleAPI/include/MantleAPI/Common/simulation_time.h
@@ -1,25 +1,44 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  simulation_time.h */
 //-----------------------------------------------------------------------------
 
-#ifndef SCENARIOABSTRACT_COMMON_SIMULATION_TIME_H
-#define SCENARIOABSTRACT_COMMON_SIMULATION_TIME_H
+#ifndef MANTLEAPI_COMMON_SIMULATION_TIME_H
+#define MANTLEAPI_COMMON_SIMULATION_TIME_H
 
 #include <chrono>
 
 namespace mantle_api
 {
 using SimulationTime = std::chrono::duration<std::int64_t, std::milli>;
+
+/// @brief Converts input in [s] to @ref SimulationTime.
+/// @tparam T Input type, eg. `double`.
+/// @param duration Input value
+/// @return Duration representing the given input in units of @ref SimulationTime.
+template <typename T>
+inline SimulationTime SecondsToSimulationTime(T duration)
+{
+    return std::chrono::duration_cast<SimulationTime>(std::chrono::duration<T>{duration});
+}
+
+/// @brief Converts input @ref SimulationTime to [s].
+/// @param time Simulation time
+/// @return Duration ins seconds representing the passed in @ref SimulationTime.
+inline double SimulationTimeToSeconds(const SimulationTime& time)
+{
+    return static_cast<double>(time.count()) / 1000.0;
 }
+  
+}  // namespace mantle_api
 
-#endif  // SCENARIOABSTRACT_COMMON_SIMULATION_TIME_H
\ No newline at end of file
+#endif  // MANTLEAPI_COMMON_SIMULATION_TIME_H
diff --git a/MantleAPI/include/MantleAPI/Common/spline.h b/MantleAPI/include/MantleAPI/Common/spline.h
index 9c399447..1fd7c9be 100644
--- a/MantleAPI/include/MantleAPI/Common/spline.h
+++ b/MantleAPI/include/MantleAPI/Common/spline.h
@@ -1,19 +1,19 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  spline.h */
 //-----------------------------------------------------------------------------
 
-#ifndef SCENARIOABSTRACT_COMMON_SPLINE_H
-#define SCENARIOABSTRACT_COMMON_SPLINE_H
+#ifndef MANTLEAPI_COMMON_SPLINE_H
+#define MANTLEAPI_COMMON_SPLINE_H
 
 #include <MantleAPI/Common/floating_point_helper.h>
 #include <MantleAPI/Common/simulation_time.h>
@@ -47,4 +47,4 @@ inline bool operator==(const SplineSection& lhs, const SplineSection& rhs) noexc
 
 }  // namespace mantle_api
 
-#endif  // SCENARIOABSTRACT_COMMON_SPLINE_H
\ No newline at end of file
+#endif  // MANTLEAPI_COMMON_SPLINE_H
diff --git a/MantleAPI/include/MantleAPI/Common/vector.h b/MantleAPI/include/MantleAPI/Common/vector.h
index 2405e5a4..d495f9dd 100644
--- a/MantleAPI/include/MantleAPI/Common/vector.h
+++ b/MantleAPI/include/MantleAPI/Common/vector.h
@@ -1,18 +1,17 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  vector.h */
 //-----------------------------------------------------------------------------
 
-
 #ifndef MANTLEAPI_COMMON_VECTOR_H
 #define MANTLEAPI_COMMON_VECTOR_H
 
@@ -55,6 +54,11 @@ inline Vec3d operator+(const Vec3d& lhs, const Vec3d& rhs) noexcept
     return {lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z};
 }
 
+inline Vec3d operator*(const Vec3d& lhs, double d) noexcept
+{
+    return {lhs.x * d, lhs.y * d, lhs.z * d};
+}
+
 }  // namespace mantle_api
 
 #endif  // MANTLEAPI_COMMON_VECTOR_H
diff --git a/MantleAPI/include/MantleAPI/EnvironmentalConditions/date_time.h b/MantleAPI/include/MantleAPI/EnvironmentalConditions/date_time.h
new file mode 100644
index 00000000..f1005118
--- /dev/null
+++ b/MantleAPI/include/MantleAPI/EnvironmentalConditions/date_time.h
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+//-----------------------------------------------------------------------------
+/** @file  date_time.h */
+//-----------------------------------------------------------------------------
+
+#ifndef MANTLEAPI_ENVIRONMENTALCONDITIONS_DATETIME_H
+#define MANTLEAPI_ENVIRONMENTALCONDITIONS_DATETIME_H
+
+#include <MantleAPI/Common/simulation_time.h>
+
+#include <chrono>
+
+namespace mantle_api
+{
+
+struct DateTime
+{
+    SimulationTime date_time_ms{0};
+};
+
+}  // namespace mantle_api
+#endif  // MANTLEAPI_ENVIRONMENTALCONDITIONS_DATETIME_H
diff --git a/MantleAPI/include/MantleAPI/EnvironmentalConditions/road_condition.h b/MantleAPI/include/MantleAPI/EnvironmentalConditions/road_condition.h
index fdabdd08..147ab828 100644
--- a/MantleAPI/include/MantleAPI/EnvironmentalConditions/road_condition.h
+++ b/MantleAPI/include/MantleAPI/EnvironmentalConditions/road_condition.h
@@ -1,12 +1,12 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  road_condition.h */
diff --git a/MantleAPI/include/MantleAPI/EnvironmentalConditions/weather.h b/MantleAPI/include/MantleAPI/EnvironmentalConditions/weather.h
index 955b720c..aa11aa9f 100644
--- a/MantleAPI/include/MantleAPI/EnvironmentalConditions/weather.h
+++ b/MantleAPI/include/MantleAPI/EnvironmentalConditions/weather.h
@@ -1,12 +1,12 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  weather.h */
@@ -17,8 +17,6 @@
 
 #include <chrono>
 
-using Milliseconds = std::chrono::duration<int64_t, std::ratio<1, 1000>>;
-
 namespace mantle_api
 {
 enum class Precipitation
@@ -65,14 +63,12 @@ enum class Illumination
 
 struct Weather
 {
-    Fog fog{Fog::kUnknown};
-    Precipitation precipitation{Precipitation::kUnknown};
-    Illumination illumination{Illumination::kUnknown};
+    Fog fog{Fog::kExcellentVisibility};
+    Precipitation precipitation{Precipitation::kNone};
+    Illumination illumination{Illumination::kOther};
     double humidity_percent{0.0};
     double temperature_kelvin{0.0};
     double atmospheric_pressure_pascal{0.0};
-
-    Milliseconds date_time_ms{0};  // TODO: we should move this out of the weather...?!
 };
 }  // namespace mantle_api
 
diff --git a/MantleAPI/include/MantleAPI/Execution/i_environment.h b/MantleAPI/include/MantleAPI/Execution/i_environment.h
index 1983b4dc..337b8207 100644
--- a/MantleAPI/include/MantleAPI/Execution/i_environment.h
+++ b/MantleAPI/include/MantleAPI/Execution/i_environment.h
@@ -1,21 +1,21 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  i_environment.h */
 //-----------------------------------------------------------------------------
 
-
 #ifndef MANTLEAPI_EXECUTION_IENVIRONMENT_H
 #define MANTLEAPI_EXECUTION_IENVIRONMENT_H
 
+#include <MantleAPI/EnvironmentalConditions/date_time.h>
 #include <MantleAPI/EnvironmentalConditions/road_condition.h>
 #include <MantleAPI/EnvironmentalConditions/weather.h>
 #include <MantleAPI/Map/i_coord_converter.h>
@@ -41,18 +41,29 @@ class IEnvironment
     ///                  environment.
     virtual void CreateMap(const std::string& file_path, const std::vector<Position>& map_region) = 0;
 
-    /// Creates a controller from the given config. A created controller can be assigned to multiple entities.
+    /// Creates a controller from the given config. A created controller can be assigned to multiple entities
     ///
-    /// @param config Specifies what kind of controller shall be created. The config needs to contain an ID to
+    /// @param config Specifies what kind of controller shall be created. The config needs to contain a controller ID
     ///               in order to be able to assign this controller to an entity.
     virtual void CreateController(std::unique_ptr<IControllerConfig> config) = 0;
 
-    /// Assigns an entity to a copy of the specified controller. This controller needs to be created beforehand.
+    /// Assigns an entity to a copy of the specified controller. This controller needs to be created beforehand. Only
+    /// one controller can be added to an entity
     ///
     /// @param entity The entity to be manipulated by the specified controller.
     /// @param controller_id Identifies the controller to manipulate the entity.
     virtual void AddEntityToController(IEntity& entity, std::uint64_t controller_id) = 0;
 
+    virtual void RemoveControllerFromEntity(std::uint64_t entity_id) = 0;
+
+    /// Updates the control strategies in the composite controller.
+    ///
+    /// @param controller_id      Specifies the controller to be updated
+    /// @param control_strategies Specifies the desired movement behaviour for the entity
+    virtual void UpdateControlStrategies(
+        std::uint64_t controller_id,
+        std::vector<std::unique_ptr<mantle_api::ControlStrategy>>& control_strategies) = 0;
+
     virtual const ILaneLocationQueryService& GetQueryService() const = 0;
     virtual const ICoordConverter* GetConverter() const = 0;
 
@@ -60,8 +71,8 @@ class IEnvironment
     virtual const IEntityRepository& GetEntityRepository() const = 0;
 
     /// @brief DateTime in UTC (converted from RFC 3339 standard)
-    virtual void SetDateTime(std::chrono::duration<std::int64_t, std::milli> date_time) = 0;
-    virtual std::chrono::duration<std::int64_t, std::milli> GetDateTime() = 0;
+    virtual void SetDateTime(DateTime date_time) = 0;
+    virtual DateTime GetDateTime() = 0;
 
     virtual void SetWeather(Weather weather) = 0;
     virtual void SetRoadCondition(std::vector<FrictionPatch> friction_patches) = 0;
diff --git a/MantleAPI/include/MantleAPI/Execution/i_scenario_engine.h b/MantleAPI/include/MantleAPI/Execution/i_scenario_engine.h
index ee08f52c..a07260c3 100644
--- a/MantleAPI/include/MantleAPI/Execution/i_scenario_engine.h
+++ b/MantleAPI/include/MantleAPI/Execution/i_scenario_engine.h
@@ -1,18 +1,17 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  i_scenario_engine.h */
 //-----------------------------------------------------------------------------
 
-
 #ifndef MANTLEAPI_EXECUTION_ISCENARIOENGINE_H
 #define MANTLEAPI_EXECUTION_ISCENARIOENGINE_H
 
@@ -42,6 +41,8 @@ class IScenarioEngine
     /// Indicates whether the scenario implementation has finished processing the scenario (end of scenario is reached).
     /// @return `true` if processing the scenario is complete, `false` otherwise.
     virtual bool IsFinished() const = 0;
+
+    virtual void ActivateExternalHostControl() = 0;
 };
 }  // namespace mantle_api
 
diff --git a/MantleAPI/include/MantleAPI/Execution/scenario_info.h b/MantleAPI/include/MantleAPI/Execution/scenario_info.h
index 3bf2b708..6e0dd3b4 100644
--- a/MantleAPI/include/MantleAPI/Execution/scenario_info.h
+++ b/MantleAPI/include/MantleAPI/Execution/scenario_info.h
@@ -1,22 +1,21 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  scenario_info.h */
 //-----------------------------------------------------------------------------
 
-
 #ifndef MANTLEAPI_EXECUTION_SCENARIOINFO_H
 #define MANTLEAPI_EXECUTION_SCENARIOINFO_H
 
-#include <MantleAPI/Execution/simulation_time.h>
+#include <MantleAPI/Common/simulation_time.h>
 
 #include <map>
 #include <string>
diff --git a/MantleAPI/include/MantleAPI/Map/i_coord_converter.h b/MantleAPI/include/MantleAPI/Map/i_coord_converter.h
index ed3cdb33..87892dde 100644
--- a/MantleAPI/include/MantleAPI/Map/i_coord_converter.h
+++ b/MantleAPI/include/MantleAPI/Map/i_coord_converter.h
@@ -1,18 +1,17 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  i_coord_converter.h */
 //-----------------------------------------------------------------------------
 
-
 #ifndef MANTLEAPI_MAP_ICOORDCONVERTER_H
 #define MANTLEAPI_MAP_ICOORDCONVERTER_H
 
diff --git a/MantleAPI/include/MantleAPI/Map/i_lane_location_query_service.h b/MantleAPI/include/MantleAPI/Map/i_lane_location_query_service.h
index c5703824..0fd41bde 100644
--- a/MantleAPI/include/MantleAPI/Map/i_lane_location_query_service.h
+++ b/MantleAPI/include/MantleAPI/Map/i_lane_location_query_service.h
@@ -1,21 +1,23 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  i_lane_location_query_service.h */
 //-----------------------------------------------------------------------------
 
-#ifndef MANTLEAPI_MAP_IQUERYSERVICE_H
-#define MANTLEAPI_MAP_IQUERYSERVICE_H
+#ifndef MANTLEAPI_MAP_ILANELOCATIONQUERYSERVICE_H
+#define MANTLEAPI_MAP_ILANELOCATIONQUERYSERVICE_H
 
 #include <MantleAPI/Common/i_identifiable.h>
+#include <MantleAPI/Common/orientation.h>
+#include <MantleAPI/Common/vector.h>
 
 namespace mantle_api
 {
@@ -32,7 +34,11 @@ class ILaneLocationQueryService
     /// We need to think about proper interface functions we want to define here (GetLaneLocation? GetLanes? But this
     /// would add a rat-tail of more interfaces we need to define (ILaneLocation, ILane, ...?)
     // virtual const IIdentifiable& GetMapObjectById(UniqueId id) = 0;
+
+    virtual Orientation3d GetLaneOrientation(const Vec3d& position) const = 0;
+    virtual Vec3d GetUpwardsShiftedLanePosition(const Vec3d& position, double upwards_shift) const = 0;
+    virtual bool IsPositionOnLane(const Vec3d& position) const = 0;
 };
 }  // namespace mantle_api
 
-#endif  // MANTLEAPI_MAP_IQUERYSERVICE_H
+#endif  // MANTLEAPI_MAP_ILANELOCATIONQUERYSERVICE_H
diff --git a/MantleAPI/include/MantleAPI/Map/i_route.h b/MantleAPI/include/MantleAPI/Map/i_route.h
index e13adac7..8079861f 100644
--- a/MantleAPI/include/MantleAPI/Map/i_route.h
+++ b/MantleAPI/include/MantleAPI/Map/i_route.h
@@ -1,18 +1,17 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  i_route.h */
 //-----------------------------------------------------------------------------
 
-
 #ifndef MANTLEAPI_MAP_IROUTE_H
 #define MANTLEAPI_MAP_IROUTE_H
 
diff --git a/MantleAPI/include/MantleAPI/Traffic/control_strategy.h b/MantleAPI/include/MantleAPI/Traffic/control_strategy.h
new file mode 100644
index 00000000..68252a16
--- /dev/null
+++ b/MantleAPI/include/MantleAPI/Traffic/control_strategy.h
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+//-----------------------------------------------------------------------------
+/** @file  control_strategy.h */
+//-----------------------------------------------------------------------------
+
+#ifndef MANTLEAPI_TRAFFIC_CONTROLSTRATEGY_H
+#define MANTLEAPI_TRAFFIC_CONTROLSTRATEGY_H
+
+#include <MantleAPI/Common/spline.h>
+#include <MantleAPI/Common/vector.h>
+
+#include <vector>
+
+namespace mantle_api
+{
+
+enum class MovementDomain
+{
+    undefined = 0,
+    lateral,
+    longitudinal,
+    both
+};
+
+struct ControlStrategy
+{
+    virtual ~ControlStrategy() = default;
+
+    // TODO: extend by bool use_dynamic_constraints when needed (false assumed at the moment)
+
+    MovementDomain movement_domain{MovementDomain::undefined};
+};
+
+inline bool operator==(const ControlStrategy& lhs, const ControlStrategy& rhs) noexcept
+{
+    return lhs.movement_domain == rhs.movement_domain;
+}
+
+inline bool operator!=(const ControlStrategy& lhs, const ControlStrategy& rhs) noexcept
+{
+    return !(lhs == rhs);
+}
+
+struct KeepVelocityControlStrategy : public ControlStrategy
+{
+    KeepVelocityControlStrategy() { movement_domain = MovementDomain::longitudinal; }
+    // Doesn`t need configuration attributes. Controller keeps current velocity on adding entity or update
+};
+
+struct KeepLaneOffsetControlStrategy : public ControlStrategy
+{
+    KeepLaneOffsetControlStrategy() { movement_domain = MovementDomain::lateral; }
+    // Doesn`t need configuration attributes. Controller keeps current lane offset on adding entity or update
+};
+
+// Control strategy which sets the respective value y (heading/velocity) as a polynomial function y = P(x) of simulation
+// time x
+struct FollowSplineControlStrategy : public ControlStrategy
+{
+    // movement_domain has to be set when used! Lat=heading, Lon=velocity
+    FollowSplineControlStrategy() {}
+
+    std::vector<mantle_api::SplineSection> splines;
+    double default_value{0};  // when no spline section is defined for a certain simulation time
+};
+
+// TODO: Create new control strategy for following 3D trajectories with shapes NURBS, polyline, clothoid
+
+struct FollowRouteControlStrategy : public ControlStrategy
+{
+    FollowRouteControlStrategy() { movement_domain = MovementDomain::lateral; }
+
+    std::vector<mantle_api::Vec3d> waypoints;
+};
+
+enum class Dimension
+{
+    undefined = 0,
+    distance,
+    rate,
+    time
+};
+
+enum class Shape
+{
+    undefined = 0,
+    cubic,
+    linear,
+    sinusoidal
+};
+
+struct TransitionDynamics
+{
+    Dimension dimension{Dimension::undefined};
+    Shape shape{Shape::undefined};
+    double value{0};
+};
+
+struct AcquireVelocityControlStrategy : public ControlStrategy
+{
+    AcquireVelocityControlStrategy() { movement_domain = MovementDomain::longitudinal; }
+
+    double velocity_target;
+    TransitionDynamics transition_dynamics;
+};
+
+struct AcquireLaneOffsetControlStrategy : public ControlStrategy
+{
+    AcquireLaneOffsetControlStrategy() { movement_domain = MovementDomain::lateral; }
+
+    int road_id;
+    int lane_id;
+    double offset;
+    TransitionDynamics transition_dynamics;
+};
+
+}  // namespace mantle_api
+
+#endif  // MANTLEAPI_TRAFFIC_CONTROLSTRATEGY_H
diff --git a/MantleAPI/include/MantleAPI/Traffic/entity_properties.h b/MantleAPI/include/MantleAPI/Traffic/entity_properties.h
index 5800b3d4..7e37ccb5 100644
--- a/MantleAPI/include/MantleAPI/Traffic/entity_properties.h
+++ b/MantleAPI/include/MantleAPI/Traffic/entity_properties.h
@@ -1,22 +1,21 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  entity_properties.h */
 //-----------------------------------------------------------------------------
 
-
 #ifndef MANTLEAPI_TRAFFIC_ENTITYPROPERTIES_H
 #define MANTLEAPI_TRAFFIC_ENTITYPROPERTIES_H
 
-#include <MantleAPI/Common/dimension.h>
+#include <MantleAPI/Common/bounding_box.h>
 #include <MantleAPI/Common/floating_point_helper.h>
 #include <MantleAPI/Common/vector.h>
 
@@ -41,14 +40,14 @@ struct EntityProperties
 {
     virtual ~EntityProperties() = default;
 
-    Dimension3d dimension{0.0, 0.0, 0.0};
+    BoundingBox bounding_box{Vec3d{}, Dimension3d{}};
     EntityType type{EntityType::kOther};
     std::string model{};
 };
 
 inline bool operator==(const EntityProperties& lhs, const EntityProperties& rhs) noexcept
 {
-    return lhs.dimension == rhs.dimension && lhs.type == rhs.type && lhs.model == rhs.model;
+    return lhs.bounding_box == rhs.bounding_box && lhs.type == rhs.type && lhs.model == rhs.model;
 }
 
 enum class VehicleClass
@@ -107,6 +106,14 @@ enum class IndicatorState
     kWarning = 5
 };
 
+enum class ExternalControlState
+{
+    kOff = 0,
+    kFull = 1,
+    kLateralOnly = 2,
+    kLongitudinalOnly = 3
+};
+
 struct VehicleProperties : public EntityProperties
 {
     VehicleClass classification{VehicleClass::kOther};
@@ -119,7 +126,7 @@ struct VehicleProperties : public EntityProperties
 
 inline bool operator==(const VehicleProperties& lhs, const VehicleProperties& rhs) noexcept
 {
-    return lhs.dimension == rhs.dimension && lhs.type == rhs.type && lhs.model == rhs.model &&
+    return lhs.bounding_box == rhs.bounding_box && lhs.type == rhs.type && lhs.model == rhs.model &&
            lhs.classification == rhs.classification && lhs.bb_center_to_front == rhs.bb_center_to_front &&
            lhs.bb_center_to_rear == rhs.bb_center_to_rear &&
            IsEqual(lhs.front_wheel_diameter, rhs.front_wheel_diameter) &&
diff --git a/MantleAPI/include/MantleAPI/Traffic/i_controller_config.h b/MantleAPI/include/MantleAPI/Traffic/i_controller_config.h
index 6e4ca6d2..81d0ef00 100644
--- a/MantleAPI/include/MantleAPI/Traffic/i_controller_config.h
+++ b/MantleAPI/include/MantleAPI/Traffic/i_controller_config.h
@@ -1,24 +1,27 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  i_controller_config.h */
 //-----------------------------------------------------------------------------
 
-
 #ifndef MANTLEAPI_TRAFFIC_ICONTROLLERCONFIG_H
 #define MANTLEAPI_TRAFFIC_ICONTROLLERCONFIG_H
 
+#include "control_strategy.h"
+
 #include <MantleAPI/Common/spline.h>
+#include <MantleAPI/Common/vector.h>
 #include <MantleAPI/Map/i_lane_location_query_service.h>
 
+#include <memory>
 #include <vector>
 
 namespace mantle_api
@@ -28,25 +31,73 @@ struct IControllerConfig
 {
     virtual ~IControllerConfig() = default;
 
+    // TODO: Remove copy constructor and then remove config as member of NoOpController and RouteController
+    IControllerConfig() {}
+    IControllerConfig(const IControllerConfig& controller_config)
+        : map_query_service(controller_config.map_query_service), id(controller_config.id)
+    {
+        for (const auto& control_strategy : controller_config.control_strategies)
+        {
+            control_strategies.push_back(std::make_unique<mantle_api::ControlStrategy>(*control_strategy));
+        }
+    }
+
+    // TODO: Check why map_query_service is part of the interface because it is not set from engine side but only in the
+    // environment on calling AddController()
     ILaneLocationQueryService* map_query_service{nullptr};
     std::uint64_t id{0};
+    std::vector<std::unique_ptr<mantle_api::ControlStrategy>> control_strategies;
 };
 
-struct NoOpControllerConfig : public IControllerConfig
+inline bool operator==(const IControllerConfig& lhs, const IControllerConfig& rhs) noexcept
 {
-};
+    bool control_strategies_equal = true;
+    if (lhs.control_strategies.size() != rhs.control_strategies.size())
+    {
+        control_strategies_equal = false;
+    }
+    else
+    {
+        for (unsigned int i = 0; i < lhs.control_strategies.size(); i++)
+        {
+            if (*(lhs.control_strategies[i]) != *(rhs.control_strategies[i]))
+            {
+                control_strategies_equal = false;
+                break;
+            }
+        }
+    }
+    return lhs.id == rhs.id && control_strategies_equal;
+}
 
+// TODO: Remove and use FollowRoute (lat) and FollowSpline (lon) control strategy instead
 struct PathControllerConfig : public IControllerConfig
 {
-    std::vector<mantle_api::Vec3d> waypoints{};
+    std::vector<mantle_api::Vec3d> waypoints;
+    std::vector<mantle_api::SplineSection> velocity_splines;
+    double default_velocity;
 };
 
+// TODO: Remove and use FollowSpline (lat) and FollowSpline (lon) control strategy instead
 struct TrajectoryControllerConfig : public IControllerConfig
 {
     std::vector<mantle_api::SplineSection> heading_splines;
     std::vector<mantle_api::SplineSection> velocity_splines;
 };
 
+struct NoOpControllerConfig : public IControllerConfig
+{
+};
+
+struct InternalControllerConfig : public IControllerConfig
+{
+};
+
+struct ExternalControllerConfig : public IControllerConfig
+{
+    std::string name;
+};
+
 }  // namespace mantle_api
 
 #endif  // MANTLEAPI_TRAFFIC_ICONTROLLERCONFIG_H
diff --git a/MantleAPI/include/MantleAPI/Traffic/i_entity.h b/MantleAPI/include/MantleAPI/Traffic/i_entity.h
index ba688c17..1d25f1bd 100644
--- a/MantleAPI/include/MantleAPI/Traffic/i_entity.h
+++ b/MantleAPI/include/MantleAPI/Traffic/i_entity.h
@@ -1,18 +1,17 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  i_entity.h */
 //-----------------------------------------------------------------------------
 
-
 #ifndef MANTLEAPI_TRAFFIC_IENTITY_H
 #define MANTLEAPI_TRAFFIC_IENTITY_H
 
@@ -34,22 +33,25 @@ class IEntity : public IIdentifiable
     virtual void SetPosition(const Vec3d& inert_pos) = 0;
     virtual Vec3d GetPosition() const = 0;
 
-    virtual void SetOrientation(const Orientation3d& orientation) = 0;
-    virtual Orientation3d GetOrientation() const = 0;
-
-    virtual void SetBoundingBox(const BoundingBox& bounding_box) = 0;
-    virtual BoundingBox GetBoundingBox() const = 0;
-
     virtual void SetVelocity(const Vec3d& velocity) = 0;
     virtual Vec3d GetVelocity() const = 0;
 
     virtual void SetAcceleration(const Vec3d& acceleration) = 0;
     virtual Vec3d GetAcceleration() const = 0;
 
+    virtual void SetOrientation(const Orientation3d& orientation) = 0;
+    virtual Orientation3d GetOrientation() const = 0;
+
+    virtual void SetOrientationRate(const Orientation3d& orientation_rate) = 0;
+    virtual Orientation3d GetOrientationRate() const = 0;
+
+    virtual void SetOrientationAcceleration(const Orientation3d& orientation_acceleration) = 0;
+    virtual Orientation3d GetOrientationAcceleration() const = 0;
+
     virtual void SetProperties(std::unique_ptr<mantle_api::EntityProperties> properties) = 0;
     virtual EntityProperties* GetProperties() const = 0;
 
-    // TODO: evaluate if this will be part of the final interface or if this for simulator only (= defined in Vehicle entity)
+    // TODO: evaluate if this will be part of the final interface
     virtual void SetAssignedLaneIds(const std::vector<std::uint64_t>& assigned_lane_ids) = 0;
     virtual std::vector<std::uint64_t> GetAssignedLaneIds() const = 0;
 };
diff --git a/MantleAPI/include/MantleAPI/Traffic/i_entity_repository.h b/MantleAPI/include/MantleAPI/Traffic/i_entity_repository.h
index c547f80e..38e865e3 100644
--- a/MantleAPI/include/MantleAPI/Traffic/i_entity_repository.h
+++ b/MantleAPI/include/MantleAPI/Traffic/i_entity_repository.h
@@ -1,18 +1,17 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  i_entity_repository.h */
 //-----------------------------------------------------------------------------
 
-
 #ifndef MANTLEAPI_TRAFFIC_IENTITYREPOSITORY_H
 #define MANTLEAPI_TRAFFIC_IENTITYREPOSITORY_H
 
diff --git a/MantleAPI/test/MantleAPI/Test/test_utils.h b/MantleAPI/test/MantleAPI/Test/test_utils.h
index 36eb1d81..a72d175a 100644
--- a/MantleAPI/test/MantleAPI/Test/test_utils.h
+++ b/MantleAPI/test/MantleAPI/Test/test_utils.h
@@ -1,12 +1,12 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  test_utils.h */
@@ -34,11 +34,7 @@ namespace mantle_api
 class MockConverter : public mantle_api::ICoordConverter
 {
   public:
-    mantle_api::Vec3d Convert(mantle_api::Position position) const override
-    {
-        std::ignore = position;
-        return mantle_api::Vec3d();
-    }
+    MOCK_METHOD(mantle_api::Vec3d, Convert, (mantle_api::Position position), (const override));
 
     mantle_api::Position Convert(mantle_api::Vec3d vec) const override
     {
@@ -55,23 +51,29 @@ class MockVehicle : public mantle_api::IVehicle
     void SetName(const std::string& name) override { name_ = name; }
     const std::string& GetName() const override { return name_; }
 
-    void SetPosition(const mantle_api::Vec3d& inert_pos) override { std::ignore = inert_pos; }
-    mantle_api::Vec3d GetPosition() const override { return mantle_api::Vec3d(); }
+    MOCK_METHOD(void, SetPosition, (const mantle_api::Vec3d& inert_pos), (override));
+    MOCK_METHOD(mantle_api::Vec3d, GetPosition, (), (const, override));
 
-    void SetOrientation(const mantle_api::Orientation3d& orientation) override { std::ignore = orientation; }
-    mantle_api::Orientation3d GetOrientation() const override { return mantle_api::Orientation3d(); }
+    MOCK_METHOD(void, SetVelocity, (const mantle_api::Vec3d& velocity), (override));
+    MOCK_METHOD(mantle_api::Vec3d, GetVelocity, (), (const, override));
 
-    void SetBoundingBox(const mantle_api::BoundingBox& bounding_box) override { std::ignore = bounding_box; }
-    mantle_api::BoundingBox GetBoundingBox() const override { return mantle_api::BoundingBox(); }
+    MOCK_METHOD(void, SetAcceleration, (const mantle_api::Vec3d& acceleration), (override));
+    MOCK_METHOD(mantle_api::Vec3d, GetAcceleration, (), (const, override));
 
-    void SetVelocity(const mantle_api::Vec3d& velocity) override { std::ignore = velocity; }
-    mantle_api::Vec3d GetVelocity() const override { return {}; }
+    MOCK_METHOD(void, SetOrientation, (const mantle_api::Orientation3d& orientation), (override));
+    MOCK_METHOD(mantle_api::Orientation3d, GetOrientation, (), (const, override));
 
-    void SetAcceleration(const mantle_api::Vec3d& acceleration) override { std::ignore = acceleration; }
-    mantle_api::Vec3d GetAcceleration() const override { return {}; }
+    MOCK_METHOD(void, SetOrientationRate, (const mantle_api::Orientation3d& orientation_rate), (override));
+    MOCK_METHOD(mantle_api::Orientation3d, GetOrientationRate, (), (const, override));
 
-    void SetAssignedLaneIds(const std::vector<std::uint64_t>& ids) override { std::ignore = ids; }
-    std::vector<std::uint64_t> GetAssignedLaneIds() const override { return {}; }
+    MOCK_METHOD(void,
+                SetOrientationAcceleration,
+                (const mantle_api::Orientation3d& orientation_acceleration),
+                (override));
+    MOCK_METHOD(mantle_api::Orientation3d, GetOrientationAcceleration, (), (const, override));
+
+    MOCK_METHOD(void, SetAssignedLaneIds, (const std::vector<std::uint64_t>& ids), (override));
+    MOCK_METHOD(std::vector<std::uint64_t>, GetAssignedLaneIds, (), (const, override));
 
     void SetProperties(std::unique_ptr<mantle_api::EntityProperties> properties) override { std::ignore = properties; }
     mantle_api::VehicleProperties* GetProperties() const override
@@ -90,11 +92,22 @@ class MockVehicle : public mantle_api::IVehicle
 class MockQueryService : public mantle_api::ILaneLocationQueryService
 {
   public:
-    /// TODO: cleanup once the IQueryService interface is properly defined
-    const mantle_api::IIdentifiable& GetMapObjectById(mantle_api::UniqueId id)
+    Orientation3d GetLaneOrientation(const Vec3d& position) const override
     {
-        std::ignore = id;
-        return test_vehicle_;
+        std::ignore = position;
+        return {};
+    }
+
+    Vec3d GetUpwardsShiftedLanePosition(const Vec3d& position, double upwards_shift) const override
+    {
+        std::ignore = position;
+        std::ignore = upwards_shift;
+        return mantle_api::Vec3d();
+    }
+    bool IsPositionOnLane(const Vec3d& position) const override
+    {
+        std::ignore = position;
+        return false;
     }
 
   private:
@@ -109,23 +122,29 @@ class MockPedestrian : public mantle_api::IPedestrian
     void SetName(const std::string& name) override { name_ = name; }
     const std::string& GetName() const override { return name_; }
 
-    void SetPosition(const mantle_api::Vec3d& inert_pos) override { std::ignore = inert_pos; }
-    mantle_api::Vec3d GetPosition() const override { return mantle_api::Vec3d(); }
+    MOCK_METHOD(void, SetPosition, (const mantle_api::Vec3d& inert_pos), (override));
+    MOCK_METHOD(mantle_api::Vec3d, GetPosition, (), (const, override));
+
+    MOCK_METHOD(void, SetVelocity, (const mantle_api::Vec3d& velocity), (override));
+    MOCK_METHOD(mantle_api::Vec3d, GetVelocity, (), (const, override));
 
-    void SetOrientation(const mantle_api::Orientation3d& orientation) override { std::ignore = orientation; }
-    mantle_api::Orientation3d GetOrientation() const override { return mantle_api::Orientation3d(); }
+    MOCK_METHOD(void, SetAcceleration, (const mantle_api::Vec3d& acceleration), (override));
+    MOCK_METHOD(mantle_api::Vec3d, GetAcceleration, (), (const, override));
 
-    void SetBoundingBox(const mantle_api::BoundingBox& bounding_box) override { std::ignore = bounding_box; }
-    mantle_api::BoundingBox GetBoundingBox() const override { return mantle_api::BoundingBox(); }
+    MOCK_METHOD(void, SetOrientation, (const mantle_api::Orientation3d& orientation), (override));
+    MOCK_METHOD(mantle_api::Orientation3d, GetOrientation, (), (const, override));
 
-    void SetVelocity(const mantle_api::Vec3d& velocity) override { std::ignore = velocity; }
-    mantle_api::Vec3d GetVelocity() const override { return {}; }
+    MOCK_METHOD(void, SetOrientationRate, (const mantle_api::Orientation3d& orientation_rate), (override));
+    MOCK_METHOD(mantle_api::Orientation3d, GetOrientationRate, (), (const, override));
 
-    void SetAcceleration(const mantle_api::Vec3d& acceleration) override { std::ignore = acceleration; }
-    mantle_api::Vec3d GetAcceleration() const override { return {}; }
+    MOCK_METHOD(void,
+                SetOrientationAcceleration,
+                (const mantle_api::Orientation3d& orientation_acceleration),
+                (override));
+    MOCK_METHOD(mantle_api::Orientation3d, GetOrientationAcceleration, (), (const, override));
 
-    void SetAssignedLaneIds(const std::vector<std::uint64_t>& ids) override { std::ignore = ids; }
-    std::vector<std::uint64_t> GetAssignedLaneIds() const override { return {}; }
+    MOCK_METHOD(void, SetAssignedLaneIds, (const std::vector<std::uint64_t>& ids), (override));
+    MOCK_METHOD(std::vector<std::uint64_t>, GetAssignedLaneIds, (), (const, override));
 
     void SetProperties(std::unique_ptr<mantle_api::EntityProperties> properties) override { std::ignore = properties; }
     mantle_api::PedestrianProperties* GetProperties() const override
@@ -146,23 +165,29 @@ class MockStaticObject : public mantle_api::IStaticObject
     void SetName(const std::string& name) override { name_ = name; }
     const std::string& GetName() const override { return name_; }
 
-    void SetPosition(const mantle_api::Vec3d& inert_pos) override { std::ignore = inert_pos; }
-    mantle_api::Vec3d GetPosition() const override { return mantle_api::Vec3d(); }
+    MOCK_METHOD(void, SetPosition, (const mantle_api::Vec3d& inert_pos), (override));
+    MOCK_METHOD(mantle_api::Vec3d, GetPosition, (), (const, override));
 
-    void SetOrientation(const mantle_api::Orientation3d& orientation) override { std::ignore = orientation; }
-    mantle_api::Orientation3d GetOrientation() const override { return mantle_api::Orientation3d(); }
+    MOCK_METHOD(void, SetVelocity, (const mantle_api::Vec3d& velocity), (override));
+    MOCK_METHOD(mantle_api::Vec3d, GetVelocity, (), (const, override));
 
-    void SetBoundingBox(const mantle_api::BoundingBox& bounding_box) override { std::ignore = bounding_box; }
-    mantle_api::BoundingBox GetBoundingBox() const override { return mantle_api::BoundingBox(); }
+    MOCK_METHOD(void, SetAcceleration, (const mantle_api::Vec3d& acceleration), (override));
+    MOCK_METHOD(mantle_api::Vec3d, GetAcceleration, (), (const, override));
 
-    void SetVelocity(const mantle_api::Vec3d& velocity) override { std::ignore = velocity; }
-    mantle_api::Vec3d GetVelocity() const override { return {}; }
+    MOCK_METHOD(void, SetOrientation, (const mantle_api::Orientation3d& orientation), (override));
+    MOCK_METHOD(mantle_api::Orientation3d, GetOrientation, (), (const, override));
 
-    void SetAcceleration(const mantle_api::Vec3d& acceleration) override { std::ignore = acceleration; }
-    mantle_api::Vec3d GetAcceleration() const override { return {}; }
+    MOCK_METHOD(void, SetOrientationRate, (const mantle_api::Orientation3d& orientation_rate), (override));
+    MOCK_METHOD(mantle_api::Orientation3d, GetOrientationRate, (), (const, override));
 
-    void SetAssignedLaneIds(const std::vector<std::uint64_t>& ids) override { std::ignore = ids; }
-    std::vector<std::uint64_t> GetAssignedLaneIds() const override { return {}; }
+    MOCK_METHOD(void,
+                SetOrientationAcceleration,
+                (const mantle_api::Orientation3d& orientation_acceleration),
+                (override));
+    MOCK_METHOD(mantle_api::Orientation3d, GetOrientationAcceleration, (), (const, override));
+
+    MOCK_METHOD(void, SetAssignedLaneIds, (const std::vector<std::uint64_t>& ids), (override));
+    MOCK_METHOD(std::vector<std::uint64_t>, GetAssignedLaneIds, (), (const, override));
 
     void SetProperties(std::unique_ptr<mantle_api::EntityProperties> properties) override { std::ignore = properties; }
     mantle_api::StaticObjectProperties* GetProperties() const override
@@ -240,7 +265,11 @@ class MockEntityRepository : public mantle_api::IEntityRepository
     const std::vector<std::unique_ptr<mantle_api::IEntity>>& GetEntities() const override { return entities_; }
 
     void Delete(const std::string& name) override { std::ignore = name; }
-    bool Contains(UniqueId id) const override { return false; }
+    bool Contains(UniqueId id) const override
+    {
+        std::ignore = id;
+        return false;
+    }
     void Delete(UniqueId id) override { std::ignore = id; }
 
     //    const std::vector<mantle_api::IEntity>& GetEntities() const override { return <#initializer #>{}; }
@@ -275,6 +304,14 @@ class MockEnvironment : public mantle_api::IEnvironment
 
     );
 
+    MOCK_METHOD(void, RemoveControllerFromEntity, (std::uint64_t entity_id), (override));
+
+    MOCK_METHOD(void,
+                UpdateControlStrategies,
+                (std::uint64_t controller_id,
+                 std::vector<std::unique_ptr<mantle_api::ControlStrategy>>& control_strategies),
+                (override));
+
     const mantle_api::ILaneLocationQueryService& GetQueryService() const override { return query_service_; }
 
     const mantle_api::ICoordConverter* GetConverter() const override { return &converter_; }
@@ -290,12 +327,9 @@ class MockEnvironment : public mantle_api::IEnvironment
         std::ignore = friction_patches;
     }
 
-    void SetDateTime(std::chrono::duration<std::int64_t, std::milli> date_time) override { std::ignore = date_time; }
+    void SetDateTime(mantle_api::DateTime date_time) override { std::ignore = date_time; }
 
-    std::chrono::duration<std::int64_t, std::milli> GetDateTime() override
-    {
-        return std::chrono::duration<std::int64_t, std::milli>();
-    }
+    mantle_api::DateTime GetDateTime() override { return mantle_api::DateTime(); }
 
   private:
     MockQueryService query_service_{};
diff --git a/MantleAPI/test/interface_test.cpp b/MantleAPI/test/interface_test.cpp
index c98b7083..c3e51cf4 100644
--- a/MantleAPI/test/interface_test.cpp
+++ b/MantleAPI/test/interface_test.cpp
@@ -1,19 +1,18 @@
 /*******************************************************************************
-* Copyright (c) 2021, 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
-* which is available at https://www.eclipse.org/legal/epl-2.0/
-*
-* SPDX-License-Identifier: EPL-2.0
-*******************************************************************************/
+ * Copyright (c) 2021, 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
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
 
 //-----------------------------------------------------------------------------
 /** @file  interface_test.cpp */
 //-----------------------------------------------------------------------------
 
-
-#include <MantleAPI/Test/test_utils.h>
+#include "MantleAPI/Test/test_utils.h"
 
 TEST(InterfaceTest, GivenTeleportAction_When_ThenHostVehicleIsPlaced)
 {
-- 
GitLab