Skip to content
Snippets Groups Projects
Commit 778590f9 authored by Andreas Rauschert's avatar Andreas Rauschert
Browse files

Update entity visibility config

parent 548c65d8
No related branches found
No related tags found
1 merge request!16BMW Dev-branch
......@@ -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
......
......@@ -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"}});
}
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