Commit 778590f9 authored by Andreas Rauschert's avatar Andreas Rauschert
Browse files

Update entity visibility config

parent 548c65d8
...@@ -27,17 +27,24 @@ ...@@ -27,17 +27,24 @@
namespace mantle_api namespace mantle_api
{ {
struct SensorVisibilityConfig
{
std::string name{"sensor"};
bool visibility{true};
};
struct EntityVisibilityConfig struct EntityVisibilityConfig
{ {
/// The "graphics" flag determines, if the entity shall be shown in visualizations of the simulated environment
bool graphics{true}; 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}; 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. /// Base interface for all static and dynamic scenario entities.
......
...@@ -30,4 +30,5 @@ TEST(InterfaceTest, GivenTeleportAction_When_ThenHostVehicleIsPlaced) ...@@ -30,4 +30,5 @@ TEST(InterfaceTest, GivenTeleportAction_When_ThenHostVehicleIsPlaced)
const auto* const converter = env.GetConverter(); const auto* const converter = env.GetConverter();
auto world_pos = converter->Convert(inert_pos); auto world_pos = converter->Convert(inert_pos);
host_vehicle.SetPosition(world_pos); host_vehicle.SetPosition(world_pos);
host_vehicle.SetVisibility(mantle_api::EntityVisibilityConfig{true, false, true, {"radar"}});
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment