Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eclipse Projects
Eclipse simopenpass
MantleAPI
Commits
778590f9
Commit
778590f9
authored
Sep 29, 2021
by
Andreas Rauschert
Browse files
Update entity visibility config
parent
548c65d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
MantleAPI/include/MantleAPI/Traffic/i_entity.h
View file @
778590f9
...
...
@@ -27,17 +27,24 @@
namespace
mantle_api
{
struct
SensorVisibilityConfig
{
std
::
string
name
{
"sensor"
};
bool
visibility
{
true
};
};
struct
EntityVisibilityConfig
{
/// The "graphics" flag determines, if the entity shall be shown in visualizations of the simulated environment
bool
graphics
{
true
};
/// The "traffic" flag determines, if the entity is contained in the common simulator output (e.g. OSI Ground Truth)
/// for all traffic participants
bool
traffic
{
true
};
std
::
vector
<
SensorVisibilityConfig
>
sensors
{};
/// The "sensors" flag can be used to simulate sensor errors (false positives / false negatives). For this the
/// "sensors" flag value has to diverge from the "traffic" flag value (e.g. false positive: traffic=false,
/// sensors=true)
bool
sensors
{
true
};
/// - Sensor errors can be specified for single sensors only. E.g. a false positive for a radar sensor would be
/// specified with traffic="false", sensors="true", sensor_names={"radar"}.
/// - For the other not named sensors implicitly the opposite applies. So in the above example e.g. for a camera
/// sensor the entity would be not visible / not contained in its OSI Sensor View.
/// - When "sensor_names" is not specified (empty vector) then the "sensors" flag applies to
/// all sensors.
std
::
vector
<
std
::
string
>
sensor_names
{};
};
/// Base interface for all static and dynamic scenario entities.
...
...
@@ -69,8 +76,8 @@ class IEntity : public IIdentifiable
virtual
void
SetAssignedLaneIds
(
const
std
::
vector
<
std
::
uint64_t
>&
assigned_lane_ids
)
=
0
;
virtual
std
::
vector
<
std
::
uint64_t
>
GetAssignedLaneIds
()
const
=
0
;
virtual
void
SetVisibility
(
const
EntityVisibilityConfig
&
visibility
)
=
0
;
virtual
EntityVisibilityConfig
GetVisibility
()
const
=
0
;
virtual
void
SetVisibility
(
const
EntityVisibilityConfig
&
visibility
)
=
0
;
virtual
EntityVisibilityConfig
GetVisibility
()
const
=
0
;
};
class
IVehicle
:
public
virtual
IEntity
...
...
MantleAPI/test/interface_test.cpp
View file @
778590f9
...
...
@@ -30,4 +30,5 @@ TEST(InterfaceTest, GivenTeleportAction_When_ThenHostVehicleIsPlaced)
const
auto
*
const
converter
=
env
.
GetConverter
();
auto
world_pos
=
converter
->
Convert
(
inert_pos
);
host_vehicle
.
SetPosition
(
world_pos
);
host_vehicle
.
SetVisibility
(
mantle_api
::
EntityVisibilityConfig
{
true
,
false
,
true
,
{
"radar"
}});
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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