Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eclipse Projects
Eclipse simopenpass
MantleAPI
Commits
7286c440
Commit
7286c440
authored
Oct 06, 2021
by
Andreas Rauschert
Browse files
Update after review and fix test build
parent
f84797ea
Changes
7
Hide whitespace changes
Inline
Side-by-side
MantleAPI/BUILD.bazel
View file @
7286c440
...
...
@@ -19,6 +19,9 @@ cc_library(
visibility
=
[
"//visibility:public"
,
],
deps
=
[
"@units"
,
],
)
cc_library
(
...
...
MantleAPI/include/MantleAPI/Common/simulation_time.h
deleted
100644 → 0
View file @
f84797ea
/*******************************************************************************
* 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 MANTLEAPI_COMMON_SIMULATION_TIME_H
#define MANTLEAPI_COMMON_SIMULATION_TIME_H
#include <MantleAPI/Common/time_utils.h>
namespace
mantle_api
{
struct
SimulationTime
{
Time
current_sim_time
{
0
};
Time
last_delta_time
{
0
};
};
}
// namespace mantle_api
#endif // MANTLEAPI_COMMON_SIMULATION_TIME_H
MantleAPI/include/MantleAPI/Execution/i_environment.h
View file @
7286c440
...
...
@@ -15,7 +15,6 @@
#ifndef MANTLEAPI_EXECUTION_IENVIRONMENT_H
#define MANTLEAPI_EXECUTION_IENVIRONMENT_H
#include <MantleAPI/Common/simulation_time.h>
#include <MantleAPI/Common/time_utils.h>
#include <MantleAPI/EnvironmentalConditions/road_condition.h>
#include <MantleAPI/EnvironmentalConditions/weather.h>
...
...
@@ -77,7 +76,7 @@ public:
virtual
void
SetDateTime
(
mantle_api
::
Time
time
)
=
0
;
virtual
mantle_api
::
Time
GetDateTime
()
=
0
;
/// @brief Time since start of simulation
and delta time to previous step
/// @brief Time since start of simulation
virtual
mantle_api
::
Time
GetSimulationTime
()
=
0
;
virtual
void
SetWeather
(
Weather
weather
)
=
0
;
...
...
MantleAPI/include/MantleAPI/Traffic/entity_properties.h
View file @
7286c440
...
...
@@ -176,7 +176,7 @@ struct PedestrianProperties : public EntityProperties
struct
StaticObjectProperties
:
public
EntityProperties
{
units
::
length
::
meter_t
upwards_shif
t
{
0.0
};
units
::
length
::
meter_t
z_placement_offse
t
{
0.0
};
};
}
// namespace mantle_api
...
...
MantleAPI/test/MantleAPI/Test/test_utils.h
View file @
7286c440
...
...
@@ -35,7 +35,7 @@ class MockConverter : public mantle_api::ICoordConverter
public:
MOCK_METHOD
(
mantle_api
::
Vec3
<
units
::
length
::
meter_t
>
,
Convert
,
(
mantle_api
::
Position
position
),
(
const
override
));
mantle_api
::
Position
Convert
(
mantle_api
::
Vec3
<
units
::
length
::
meter_t
>
vec
)
const
override
mantle_api
::
Position
Convert
(
const
mantle_api
::
Vec3
<
units
::
length
::
meter_t
>
&
vec
)
const
override
{
std
::
ignore
=
vec
;
return
mantle_api
::
Position
{};
...
...
@@ -270,13 +270,13 @@ public:
CreateStaticObjectProxy
,
(
const
std
::
string
&
name
,
const
mantle_api
::
StaticObjectProperties
&
properties
),
());
mantle_api
::
IEntity
&
Get
(
const
std
::
string
&
name
)
override
std
::
optional
<
std
::
reference_wrapper
<
IEntity
>>
Get
(
const
std
::
string
&
name
)
override
{
std
::
ignore
=
name
;
return
test_vehicle_
;
}
mantle_api
::
IEntity
&
Get
(
mantle_api
::
UniqueId
id
)
override
std
::
optional
<
std
::
reference_wrapper
<
IEntity
>>
Get
(
mantle_api
::
UniqueId
id
)
override
{
std
::
ignore
=
id
;
return
test_vehicle_
;
...
...
@@ -294,8 +294,9 @@ public:
}
void
Delete
(
UniqueId
id
)
override
{
std
::
ignore
=
id
;
}
// const std::vector<mantle_api::IEntity>& GetEntities() const override { return <#initializer #>{}; }
// std::vector<mantle_api::IEntity>& GetEntities() override { return <#initializer #>; }
void
RegisterEntityCreatedCallback
(
const
std
::
function
<
void
(
IEntity
&
)
>&
callback
)
override
{
std
::
ignore
=
callback
;
}
void
RegisterEntityDeletedCallback
(
const
std
::
function
<
void
(
const
std
::
string
&
)
>&
callback
)
override
{
std
::
ignore
=
callback
;
}
void
RegisterEntityDeletedCallback
(
const
std
::
function
<
void
(
UniqueId
)
>&
callback
)
override
{
std
::
ignore
=
callback
;
}
private:
MockVehicle
test_vehicle_
{};
...
...
MantleAPI/test/interface_test.cpp
View file @
7286c440
...
...
@@ -17,7 +17,7 @@
TEST
(
InterfaceTest
,
GivenTeleportAction_When_ThenHostVehicleIsPlaced
)
{
mantle_api
::
Position
inert_pos
{};
inert_pos
=
mantle_api
::
OpenDrivePosition
{{
0
,
0
},
0
,
0
};
inert_pos
=
mantle_api
::
OpenDrivePosition
{{
0
,
0
},
units
::
length
::
meter_t
{
0
},
units
::
length
::
meter_t
{
0
}
};
mantle_api
::
MockEnvironment
env
{};
env
.
CreateMap
(
"dummy_map_path"
,
{});
...
...
README.md
View file @
7286c440
...
...
@@ -4,3 +4,10 @@ A collection of interfaces for abstraction between a scenario engine and an envi
It is intended to be usable with a wide variety of scenario description languages by implementing according scenario engines.
Remark: This is currently work in progress and no stable state is reached yet.
## Used libraries
### Units
License: MIT License
URL: https://github.com/nholthaus/units
Version: v2.3.1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment