Skip to content
Snippets Groups Projects
Commit 29cd6e6b authored by Reinhard Biegel's avatar Reinhard Biegel
Browse files

Merge branch 'update' into 'master'

Update interface

See merge request eclipse/simopenpass/scenario_api!2
parents b2c3511a 694abe44
No related branches found
No related tags found
1 merge request!2Update interface
/*******************************************************************************
* 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
/*******************************************************************************
* 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) &&
......
/*******************************************************************************
* 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
/*******************************************************************************
* 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;
};
......
/*******************************************************************************
* 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
......
/*******************************************************************************
* 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_{};
......
/*******************************************************************************
* 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)
{
......
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