Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWeiss David2020-09-10 09:10:18 +0000
committerBiegel Reinhard2020-09-25 10:19:01 +0000
commit1f042e4c2d57d15094cc8ec7f88d724b9d35afb5 (patch)
treef3f0008cc2993fc8b66d80fb43a8b088a53a1c09
parenta3a70eac88180db29f4633c30f98a2fa62baf0c7 (diff)
downloadsimopenpass-1f042e4c2d57d15094cc8ec7f88d724b9d35afb5.tar.gz
simopenpass-1f042e4c2d57d15094cc8ec7f88d724b9d35afb5.tar.xz
simopenpass-1f042e4c2d57d15094cc8ec7f88d724b9d35afb5.zip
refactor(SensorFusion): Change name to SensorAggregation and add SensorFusionErrorless
-rwxr-xr-xsim/contrib/examples/AEB/configs/systemConfigBlueprint.xml50
-rwxr-xr-xsim/contrib/examples/Static AgentProfiles/configs/systemConfigBlueprint.xml50
-rw-r--r--sim/contrib/examples/StaticAgentCollision/configs/systemConfigBlueprint.xml84
-rw-r--r--sim/doc/DoxyGen/Function/ExampleFiles/systemConfigBlueprint.xml73
-rw-r--r--sim/doc/DoxyGen/Function/Markdown/Simulation/Input_Output/Input_Output.md6
-rw-r--r--sim/src/common/sensorFusionQuery.h (renamed from sim/src/components/SensorFusion_OSI/src/sensorFusionQuery.h)26
-rw-r--r--sim/src/components/Algorithm_AEB/src/autonomousEmergencyBraking.cpp2
-rw-r--r--sim/src/components/CMakeLists.txt3
-rw-r--r--sim/src/components/SensorAggregation_OSI/CMakeLists.txt21
-rw-r--r--sim/src/components/SensorAggregation_OSI/SensorAggregation_OSI.pro40
-rw-r--r--sim/src/components/SensorAggregation_OSI/sensorAggregation.cpp172
-rw-r--r--sim/src/components/SensorAggregation_OSI/sensorAggregation.h30
-rw-r--r--sim/src/components/SensorAggregation_OSI/src/sensorAggregationImpl.cpp (renamed from sim/src/components/SensorFusion_OSI/src/sensorFusionImpl.cpp)12
-rw-r--r--sim/src/components/SensorAggregation_OSI/src/sensorAggregationImpl.h (renamed from sim/src/components/SensorFusion_OSI/src/sensorFusionImpl.h)26
-rw-r--r--sim/src/components/SensorFusionErrorless_OSI/CMakeLists.txt (renamed from sim/src/components/SensorFusion_OSI/CMakeLists.txt)7
-rw-r--r--sim/src/components/SensorFusionErrorless_OSI/SensorFusionErrorless_OSI.pro (renamed from sim/src/components/SensorFusion_OSI/SensorFusion_OSI.pro)8
-rw-r--r--sim/src/components/SensorFusionErrorless_OSI/sensorFusionErrorless_OSI.cpp (renamed from sim/src/components/SensorFusion_OSI/sensorFusion.cpp)6
-rw-r--r--sim/src/components/SensorFusionErrorless_OSI/sensorFusionErrorless_OSI.h (renamed from sim/src/components/SensorFusion_OSI/sensorFusion.h)0
-rw-r--r--sim/src/components/SensorFusionErrorless_OSI/src/sensorFusionImpl.cpp127
-rw-r--r--sim/src/components/SensorFusionErrorless_OSI/src/sensorFusionImpl.h94
-rw-r--r--sim/src/core/slave/framework/dynamicAgentTypeGenerator.cpp12
-rw-r--r--sim/src/core/slave/framework/dynamicAgentTypeGenerator.h3
-rw-r--r--sim/src/sim.pro3
-rw-r--r--sim/tests/unitTests/CMakeLists.txt3
-rw-r--r--sim/tests/unitTests/components/SensorAggregation_OSI/CMakeLists.txt22
-rw-r--r--sim/tests/unitTests/components/SensorAggregation_OSI/sensorAggregationOSI_Tests.cpp (renamed from sim/tests/unitTests/components/SensorFusion_OSI/sensorFusionOSI_Tests.cpp)12
-rw-r--r--sim/tests/unitTests/components/SensorAggregation_OSI/sensorAggregationOSI_Tests.pro32
-rw-r--r--sim/tests/unitTests/components/SensorFusionErrorless_OSI/CMakeLists.txt (renamed from sim/tests/unitTests/components/SensorFusion_OSI/CMakeLists.txt)11
-rw-r--r--sim/tests/unitTests/components/SensorFusionErrorless_OSI/sensorFusionErrorless_Tests.cpp168
-rw-r--r--sim/tests/unitTests/components/SensorFusionErrorless_OSI/sensorFusionErrorless_Tests.pro (renamed from sim/tests/unitTests/components/SensorFusion_OSI/sensorFusionOSI_Tests.pro)4
-rw-r--r--sim/tests/unitTests/core/slave/agentSampler_Tests.cpp18
-rw-r--r--sim/tests/unitTests/unitTests.pro10
32 files changed, 964 insertions, 171 deletions
diff --git a/sim/contrib/examples/AEB/configs/systemConfigBlueprint.xml b/sim/contrib/examples/AEB/configs/systemConfigBlueprint.xml
index fcbdac7c..0c84330e 100755
--- a/sim/contrib/examples/AEB/configs/systemConfigBlueprint.xml
+++ b/sim/contrib/examples/AEB/configs/systemConfigBlueprint.xml
@@ -37,14 +37,25 @@
<parameters/>
</component>
<component>
- <id>SensorFusion</id>
+ <id>SensorAggregation</id>
+ <schedule>
+ <priority>351</priority>
+ <offset>0</offset>
+ <cycle>100</cycle>
+ <response>0</response>
+ </schedule>
+ <library>SensorAggregation_OSI</library>
+ <parameters/>
+ </component>
+ <component>
+ <id>SensorFusionErrorless</id>
<schedule>
<priority>350</priority>
<offset>0</offset>
<cycle>100</cycle>
<response>0</response>
</schedule>
- <library>SensorFusion_OSI</library>
+ <library>SensorFusionErrorless_OSI</library>
<parameters/>
</component>
<component>
@@ -551,17 +562,6 @@
</target>
</connection>
<connection>
- <id>9190</id>
- <source>
- <component>SensorFusion</component>
- <output>0</output>
- </source>
- <target>
- <component>AEB</component>
- <input>0</input>
- </target>
- </connection>
- <connection>
<id>9292</id>
<source>
<component>Parameters_Vehicle</component>
@@ -589,6 +589,28 @@
</target>
</connection>
<connection>
+ <id>9390</id>
+ <source>
+ <component>SensorAggregation</component>
+ <output>0</output>
+ </source>
+ <target>
+ <component>SensorFusionErrorless</component>
+ <input>0</input>
+ </target>
+ </connection>
+ <connection>
+ <id>9490</id>
+ <source>
+ <component>SensorFusionErrorless</component>
+ <output>0</output>
+ </source>
+ <target>
+ <component>AEB</component>
+ <input>0</input>
+ </target>
+ </connection>
+ <connection>
<id>9581</id>
<source>
<component>Sensor_Driver</component>
@@ -618,7 +640,7 @@
<output>0</output>
</source>
<target>
- <component>SensorFusion</component>
+ <component>SensorAggregation</component>
<input>0</input>
</target>
</connection>
diff --git a/sim/contrib/examples/Static AgentProfiles/configs/systemConfigBlueprint.xml b/sim/contrib/examples/Static AgentProfiles/configs/systemConfigBlueprint.xml
index fcbdac7c..0c84330e 100755
--- a/sim/contrib/examples/Static AgentProfiles/configs/systemConfigBlueprint.xml
+++ b/sim/contrib/examples/Static AgentProfiles/configs/systemConfigBlueprint.xml
@@ -37,14 +37,25 @@
<parameters/>
</component>
<component>
- <id>SensorFusion</id>
+ <id>SensorAggregation</id>
+ <schedule>
+ <priority>351</priority>
+ <offset>0</offset>
+ <cycle>100</cycle>
+ <response>0</response>
+ </schedule>
+ <library>SensorAggregation_OSI</library>
+ <parameters/>
+ </component>
+ <component>
+ <id>SensorFusionErrorless</id>
<schedule>
<priority>350</priority>
<offset>0</offset>
<cycle>100</cycle>
<response>0</response>
</schedule>
- <library>SensorFusion_OSI</library>
+ <library>SensorFusionErrorless_OSI</library>
<parameters/>
</component>
<component>
@@ -551,17 +562,6 @@
</target>
</connection>
<connection>
- <id>9190</id>
- <source>
- <component>SensorFusion</component>
- <output>0</output>
- </source>
- <target>
- <component>AEB</component>
- <input>0</input>
- </target>
- </connection>
- <connection>
<id>9292</id>
<source>
<component>Parameters_Vehicle</component>
@@ -589,6 +589,28 @@
</target>
</connection>
<connection>
+ <id>9390</id>
+ <source>
+ <component>SensorAggregation</component>
+ <output>0</output>
+ </source>
+ <target>
+ <component>SensorFusionErrorless</component>
+ <input>0</input>
+ </target>
+ </connection>
+ <connection>
+ <id>9490</id>
+ <source>
+ <component>SensorFusionErrorless</component>
+ <output>0</output>
+ </source>
+ <target>
+ <component>AEB</component>
+ <input>0</input>
+ </target>
+ </connection>
+ <connection>
<id>9581</id>
<source>
<component>Sensor_Driver</component>
@@ -618,7 +640,7 @@
<output>0</output>
</source>
<target>
- <component>SensorFusion</component>
+ <component>SensorAggregation</component>
<input>0</input>
</target>
</connection>
diff --git a/sim/contrib/examples/StaticAgentCollision/configs/systemConfigBlueprint.xml b/sim/contrib/examples/StaticAgentCollision/configs/systemConfigBlueprint.xml
index 395ddccf..0c84330e 100644
--- a/sim/contrib/examples/StaticAgentCollision/configs/systemConfigBlueprint.xml
+++ b/sim/contrib/examples/StaticAgentCollision/configs/systemConfigBlueprint.xml
@@ -37,14 +37,25 @@
<parameters/>
</component>
<component>
- <id>SensorFusion</id>
+ <id>SensorAggregation</id>
+ <schedule>
+ <priority>351</priority>
+ <offset>0</offset>
+ <cycle>100</cycle>
+ <response>0</response>
+ </schedule>
+ <library>SensorAggregation_OSI</library>
+ <parameters/>
+ </component>
+ <component>
+ <id>SensorFusionErrorless</id>
<schedule>
<priority>350</priority>
<offset>0</offset>
<cycle>100</cycle>
<response>0</response>
</schedule>
- <library>SensorFusion_OSI</library>
+ <library>SensorFusionErrorless_OSI</library>
<parameters/>
</component>
<component>
@@ -110,7 +121,7 @@
</parameters>
</component>
<component>
- <id>PrioritizerLateralVehicleComponents</id>
+ <id>PrioritizerSteeringVehicleComponents</id>
<schedule>
<priority>150</priority>
<offset>0</offset>
@@ -155,17 +166,6 @@
<parameters/>
</component>
<component>
- <id>Algorithm_LateralVehicleComponents</id>
- <schedule>
- <priority>100</priority>
- <offset>0</offset>
- <cycle>100</cycle>
- <response>0</response>
- </schedule>
- <library>Algorithm_Lateral</library>
- <parameters/>
- </component>
- <component>
<id>Algorithm_LateralAfdm</id>
<schedule>
<priority>100</priority>
@@ -418,17 +418,6 @@
</target>
</connection>
<connection>
- <id>1412</id>
- <source>
- <component>Algorithm_LateralVehicleComponents</component>
- <output>0</output>
- </source>
- <target>
- <component>PrioritizerSteering</component>
- <input>0</input>
- </target>
- </connection>
- <connection>
<id>1512</id>
<source>
<component>Algorithm_LateralAfdm</component>
@@ -494,11 +483,11 @@
<connection>
<id>2414</id>
<source>
- <component>PrioritizerLateralVehicleComponents</component>
+ <component>PrioritizerSteeringVehicleComponents</component>
<output>0</output>
</source>
<target>
- <component>Algorithm_LateralVehicleComponents</component>
+ <component>PrioritizerSteering</component>
<input>0</input>
</target>
<target>
@@ -573,17 +562,6 @@
</target>
</connection>
<connection>
- <id>9190</id>
- <source>
- <component>SensorFusion</component>
- <output>0</output>
- </source>
- <target>
- <component>AEB</component>
- <input>0</input>
- </target>
- </connection>
- <connection>
<id>9292</id>
<source>
<component>Parameters_Vehicle</component>
@@ -606,12 +584,30 @@
<input>100</input>
</target>
<target>
- <component>Algorithm_LateralVehicleComponents</component>
+ <component>Dynamics_RegularDriving</component>
<input>100</input>
</target>
+ </connection>
+ <connection>
+ <id>9390</id>
+ <source>
+ <component>SensorAggregation</component>
+ <output>0</output>
+ </source>
<target>
- <component>Dynamics_RegularDriving</component>
- <input>100</input>
+ <component>SensorFusionErrorless</component>
+ <input>0</input>
+ </target>
+ </connection>
+ <connection>
+ <id>9490</id>
+ <source>
+ <component>SensorFusionErrorless</component>
+ <output>0</output>
+ </source>
+ <target>
+ <component>AEB</component>
+ <input>0</input>
</target>
</connection>
<connection>
@@ -636,10 +632,6 @@
<component>Algorithm_LateralAfdm</component>
<input>101</input>
</target>
- <target>
- <component>Algorithm_LateralVehicleComponents</component>
- <input>101</input>
- </target>
</connection>
<connection>
<id>9900</id>
@@ -648,7 +640,7 @@
<output>0</output>
</source>
<target>
- <component>SensorFusion</component>
+ <component>SensorAggregation</component>
<input>0</input>
</target>
</connection>
diff --git a/sim/doc/DoxyGen/Function/ExampleFiles/systemConfigBlueprint.xml b/sim/doc/DoxyGen/Function/ExampleFiles/systemConfigBlueprint.xml
index d1e45a7c..f80f9981 100644
--- a/sim/doc/DoxyGen/Function/ExampleFiles/systemConfigBlueprint.xml
+++ b/sim/doc/DoxyGen/Function/ExampleFiles/systemConfigBlueprint.xml
@@ -17,7 +17,7 @@
<component>
<id>Sensor_Driver</id>
<schedule>
- <priority>490</priority>
+ <priority>390</priority>
<offset>0</offset>
<cycle>100</cycle>
<response>0</response>
@@ -37,14 +37,25 @@
<parameters/>
</component>
<component>
- <id>SensorFusion</id>
+ <id>SensorAggregation</id>
+ <schedule>
+ <priority>351</priority>
+ <offset>0</offset>
+ <cycle>100</cycle>
+ <response>0</response>
+ </schedule>
+ <library>SensorAggregation_OSI</library>
+ <parameters/>
+ </component>
+ <component>
+ <id>SensorFusionErrorless</id>
<schedule>
<priority>350</priority>
<offset>0</offset>
<cycle>100</cycle>
<response>0</response>
</schedule>
- <library>SensorFusion_OSI</library>
+ <library>SensorFusionErrorless_OSI</library>
<parameters/>
</component>
<component>
@@ -61,7 +72,7 @@
<component>
<id>ComponentController</id>
<schedule>
- <priority>1</priority>
+ <priority>200</priority>
<offset>0</offset>
<cycle>100</cycle>
<response>0</response>
@@ -70,6 +81,17 @@
<parameters/>
</component>
<component>
+ <id>OpenScenarioActions</id>
+ <schedule>
+ <priority>400</priority>
+ <offset>0</offset>
+ <cycle>100</cycle>
+ <response>0</response>
+ </schedule>
+ <library>OpenScenarioActions</library>
+ <parameters/>
+ </component>
+ <component>
<id>AEB</id>
<schedule>
<priority>250</priority>
@@ -341,17 +363,6 @@
</target>
</connection>
<connection>
- <id>283</id>
- <source>
- <component>Dynamics_TrajectoryFollower</component>
- <output>83</output>
- </source>
- <target>
- <component>ComponentController</component>
- <input>100</input>
- </target>
- </connection>
- <connection>
<id>301</id>
<source>
<component>Dynamics_RegularDriving</component>
@@ -540,14 +551,14 @@
</target>
</connection>
<connection>
- <id>9190</id>
+ <id>8471</id>
<source>
- <component>SensorFusion</component>
+ <component>OpenScenarioActions</component>
<output>0</output>
</source>
<target>
- <component>AEB</component>
- <input>0</input>
+ <component>Dynamics_TrajectoryFollower</component>
+ <input>2</input>
</target>
</connection>
<connection>
@@ -578,6 +589,28 @@
</target>
</connection>
<connection>
+ <id>9390</id>
+ <source>
+ <component>SensorAggregation</component>
+ <output>0</output>
+ </source>
+ <target>
+ <component>SensorFusionErrorless</component>
+ <input>0</input>
+ </target>
+ </connection>
+ <connection>
+ <id>9490</id>
+ <source>
+ <component>SensorFusionErrorless</component>
+ <output>0</output>
+ </source>
+ <target>
+ <component>AEB</component>
+ <input>0</input>
+ </target>
+ </connection>
+ <connection>
<id>9581</id>
<source>
<component>Sensor_Driver</component>
@@ -607,7 +640,7 @@
<output>0</output>
</source>
<target>
- <component>SensorFusion</component>
+ <component>SensorAggregation</component>
<input>0</input>
</target>
</connection>
diff --git a/sim/doc/DoxyGen/Function/Markdown/Simulation/Input_Output/Input_Output.md b/sim/doc/DoxyGen/Function/Markdown/Simulation/Input_Output/Input_Output.md
index 54f3aa44..2469b846 100644
--- a/sim/doc/DoxyGen/Function/Markdown/Simulation/Input_Output/Input_Output.md
+++ b/sim/doc/DoxyGen/Function/Markdown/Simulation/Input_Output/Input_Output.md
@@ -97,6 +97,9 @@ The table below can be used as orientation when a new module is introduced.
|---|-----------|-----------|-----------|-----------|
| ParametersAgentModules| ParametersAgent| 500 | Parameters | Sets all init-data and is updated cyclically |
| OpenScenarioActions | OpenScenarioActions | 400 | ADAS | Reads events from OpenScenario Actions and forwards them to other components |
+| SensorObjectDetector | Sensor_OSI | 398 | Sensor | Gets instantiated multiple time (one time per sensor) |
+| SensorAggregation | SensorAggregation_OSI | 351 | Sensor | - |
+| SensorFusionErrorless | SensorFusionErrorless_OSI | 350 | Sensor | - |
| AlgorithmAgentFollowingDriverModel | AlgorithmAgentFollowingDriverModel | 310 | DriverModels | - |
| AEB | AlgorithmAutonomousEmergencyBraking | 250 | ADAS | - |
| ComponentController | ComponentController | 200 | ADAS | Manages vehicle component states with regard to other vehicle component states and conditions and in response to events. |
@@ -179,6 +182,8 @@ With corresponding defined indices :
| ComponentController | Special | 83 |
| OpenScenarioActions | Special | 84 |
| Parameter_Vehicle | Sensor | 92 |
+| SensorAggregation | Sensor | 93 |
+| SensorFusion | Sensor | 94 |
| Sensor_Driver | Sensor | 95 |
**Ids for Signals (last two digits)**
@@ -206,6 +211,7 @@ With corresponding defined indices :
| SecondaryDriverTasks | Algorithm | 19 |
| Trajectory | OpenScenarioActions | 71 |
| SensorDriver | Sensor | 81 |
+| SensorData | Sensor | 90 |
| ParametersVehicle | Parameters | 92 |
\subsubsection io_input_systemconfigblueprint_paramters Parameters
diff --git a/sim/src/components/SensorFusion_OSI/src/sensorFusionQuery.h b/sim/src/common/sensorFusionQuery.h
index d836532f..4ac4f245 100644
--- a/sim/src/components/SensorFusion_OSI/src/sensorFusionQuery.h
+++ b/sim/src/common/sensorFusionQuery.h
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2018, 2019 in-tech GmbH
+* Copyright (c) 2018, 2019, 2020 in-tech GmbH
* Copyright (c) 2020 HLRS, University of Stuttgart.
*
* This program and the accompanying materials are made
@@ -22,33 +22,39 @@
#include "osi3/osi_sensordata.pb.h"
-class SensorFusionHelperFunctions
+namespace SensorFusionHelperFunctions
{
-public:
- static std::vector<osi3::DetectedMovingObject> RetrieveMovingObjectsBySensorId(std::vector<int> sensorIds, const osi3::SensorData &sensorData)
+ std::vector<osi3::DetectedMovingObject> RetrieveMovingObjectsBySensorId(std::vector<int> sensorIds, const osi3::SensorData &sensorData)
{
std::vector<osi3::DetectedMovingObject> result;
auto detectedMovingObjects = sensorData.moving_object();
for (const auto& object : detectedMovingObjects)
{
- if(std::count(sensorIds.cbegin(), sensorIds.cend(), object.header().sensor_id(0).value()) > 0)
+ for (auto sensorId : object.header().sensor_id())
{
- result.push_back(object);
+ if(std::count(sensorIds.cbegin(), sensorIds.cend(), sensorId.value()) > 0)
+ {
+ result.push_back(object);
+ break;
+ }
}
}
return result;
}
-
- static std::vector<osi3::DetectedStationaryObject> RetrieveStationaryObjectsBySensorId(std::vector<int> sensorIds, const osi3::SensorData &sensorData)
+ std::vector<osi3::DetectedStationaryObject> RetrieveStationaryObjectsBySensorId(std::vector<int> sensorIds, const osi3::SensorData &sensorData)
{
std::vector<osi3::DetectedStationaryObject> result;
auto detectedStationaryObjects = sensorData.stationary_object();
for (const auto& object : detectedStationaryObjects)
{
- if(std::count(sensorIds.cbegin(), sensorIds.cend(), object.header().sensor_id(0).value()) > 0)
+ for (auto sensorId : object.header().sensor_id())
{
- result.push_back(object);
+ if(std::count(sensorIds.cbegin(), sensorIds.cend(), sensorId.value()) > 0)
+ {
+ result.push_back(object);
+ break;
+ }
}
}
return result;
diff --git a/sim/src/components/Algorithm_AEB/src/autonomousEmergencyBraking.cpp b/sim/src/components/Algorithm_AEB/src/autonomousEmergencyBraking.cpp
index 450d7039..1d4a4205 100644
--- a/sim/src/components/Algorithm_AEB/src/autonomousEmergencyBraking.cpp
+++ b/sim/src/components/Algorithm_AEB/src/autonomousEmergencyBraking.cpp
@@ -19,7 +19,7 @@
#include "common/commonTools.h"
#include "common/eventTypes.h"
-#include "components/SensorFusion_OSI/src/sensorFusionQuery.h"
+#include "common/sensorFusionQuery.h"
#include "boundingBoxCalculation.h"
AlgorithmAutonomousEmergencyBrakingImplementation::AlgorithmAutonomousEmergencyBrakingImplementation(
diff --git a/sim/src/components/CMakeLists.txt b/sim/src/components/CMakeLists.txt
index b59e9c4c..93c655cc 100644
--- a/sim/src/components/CMakeLists.txt
+++ b/sim/src/components/CMakeLists.txt
@@ -31,7 +31,8 @@ add_subdirectory(Dynamics_TF)
add_subdirectory(LimiterAccVehComp)
add_subdirectory(OpenScenarioActions)
add_subdirectory(Parameters_Vehicle)
-add_subdirectory(SensorFusion_OSI)
+add_subdirectory(SensorAggregation_OSI)
+add_subdirectory(SensorFusionErrorless_OSI)
#add_subdirectory(Sensor_Distance)
add_subdirectory(Sensor_Driver)
add_subdirectory(Sensor_OSI)
diff --git a/sim/src/components/SensorAggregation_OSI/CMakeLists.txt b/sim/src/components/SensorAggregation_OSI/CMakeLists.txt
new file mode 100644
index 00000000..17e86e63
--- /dev/null
+++ b/sim/src/components/SensorAggregation_OSI/CMakeLists.txt
@@ -0,0 +1,21 @@
+set(COMPONENT_NAME SensorAggregation_OSI)
+
+add_compile_definitions(SENSOR_AGGREGATION_LIBRARY)
+
+add_openpass_target(
+ NAME ${COMPONENT_NAME} TYPE library LINKAGE shared COMPONENT core
+
+ HEADERS
+ sensorAggregation.h
+ src/sensorAggregationImpl.h
+
+ SOURCES
+ sensorAggregation.cpp
+ src/sensorAggregationImpl.cpp
+
+ LIBRARIES
+ Qt5::Core
+ Common
+
+ LINKOSI
+)
diff --git a/sim/src/components/SensorAggregation_OSI/SensorAggregation_OSI.pro b/sim/src/components/SensorAggregation_OSI/SensorAggregation_OSI.pro
new file mode 100644
index 00000000..bd80d9db
--- /dev/null
+++ b/sim/src/components/SensorAggregation_OSI/SensorAggregation_OSI.pro
@@ -0,0 +1,40 @@
+# /*********************************************************************
+# * Copyright (c) 2017, 2018, 2019 in-tech GmbH
+# *
+# * 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 SensorAggregation_OSI.pro
+# \brief This file contains the information for the QtCreator-project of the
+# module SensorAggregation_OSI
+#-----------------------------------------------------------------------------/
+
+DEFINES += SENSOR_AGGREGATION_LIBRARY
+CONFIG += OPENPASS_LIBRARY
+include(../../../global.pri)
+
+
+SUBDIRS += .\
+ src
+
+INCLUDEPATH += \
+ $$SUBDIRS \
+ ../../.. \
+ ../..
+
+SOURCES += \
+ sensorAggregation.cpp \
+ src/sensorAggregationImpl.cpp
+
+HEADERS += \
+ sensorAggregation.h \
+ src/sensorAggregationImpl.h
+
+LIBS += \
+ -lopen_simulation_interface \
+ -lprotobuf
diff --git a/sim/src/components/SensorAggregation_OSI/sensorAggregation.cpp b/sim/src/components/SensorAggregation_OSI/sensorAggregation.cpp
new file mode 100644
index 00000000..55d1941a
--- /dev/null
+++ b/sim/src/components/SensorAggregation_OSI/sensorAggregation.cpp
@@ -0,0 +1,172 @@
+/*******************************************************************************
+* Copyright (c) 2017, 2018, 2019, 2020 in-tech GmbH
+*
+* 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 SensorAggregation.cpp */
+//-----------------------------------------------------------------------------
+
+#include "sensorAggregation.h"
+#include "src/sensorAggregationImpl.h"
+
+const std::string Version = "0.0.1";
+static const CallbackInterface *Callbacks = nullptr;
+
+extern "C" SENSOR_AGGREGATION_SHARED_EXPORT const std::string &OpenPASS_GetVersion()
+{
+ return Version;
+}
+
+extern "C" SENSOR_AGGREGATION_SHARED_EXPORT ModelInterface *OpenPASS_CreateInstance(
+ std::string componentName,
+ bool isInit,
+ int priority,
+ int offsetTime,
+ int responseTime,
+ int cycleTime,
+ StochasticsInterface *stochastics,
+ WorldInterface *world,
+ const ParameterInterface *parameters,
+ PublisherInterface * const publisher,
+ AgentInterface *agent,
+ const CallbackInterface *callbacks)
+{
+ Callbacks = callbacks;
+
+ try
+ {
+ return (ModelInterface*)(new (std::nothrow) SensorAggregationImplementation(
+ componentName,
+ isInit,
+ priority,
+ offsetTime,
+ responseTime,
+ cycleTime,
+ stochastics,
+ world,
+ parameters,
+ publisher,
+ callbacks,
+ agent));
+ }
+ catch(const std::runtime_error &ex)
+ {
+ if(Callbacks != nullptr)
+ {
+ Callbacks->Log(CbkLogLevel::Error, __FILE__, __LINE__, ex.what());
+ }
+
+ return nullptr;
+ }
+ catch(...)
+ {
+ if(Callbacks != nullptr)
+ {
+ Callbacks->Log(CbkLogLevel::Error, __FILE__, __LINE__, "unexpected exception");
+ }
+
+ return nullptr;
+ }
+}
+
+extern "C" SENSOR_AGGREGATION_SHARED_EXPORT void OpenPASS_DestroyInstance(ModelInterface *implementation)
+{
+ delete (SensorAggregationImplementation*)implementation;
+}
+
+extern "C" SENSOR_AGGREGATION_SHARED_EXPORT bool OpenPASS_UpdateInput(ModelInterface *implementation,
+ int localLinkId,
+ const std::shared_ptr<SignalInterface const> &data,
+ int time)
+{
+ try
+ {
+ implementation->UpdateInput(localLinkId, data, time);
+ }
+ catch(const std::runtime_error &ex)
+ {
+ if(Callbacks != nullptr)
+ {
+ Callbacks->Log(CbkLogLevel::Error, __FILE__, __LINE__, ex.what());
+ }
+
+ return false;
+ }
+ catch(...)
+ {
+ if(Callbacks != nullptr)
+ {
+ Callbacks->Log(CbkLogLevel::Error, __FILE__, __LINE__, "unexpected exception");
+ }
+
+ return false;
+ }
+
+ return true;
+}
+
+extern "C" SENSOR_AGGREGATION_SHARED_EXPORT bool OpenPASS_UpdateOutput(ModelInterface *implementation,
+ int localLinkId,
+ std::shared_ptr<SignalInterface const> &data,
+ int time)
+{
+ try
+ {
+ implementation->UpdateOutput(localLinkId, data, time);
+ }
+ catch(const std::runtime_error &ex)
+ {
+ if(Callbacks != nullptr)
+ {
+ Callbacks->Log(CbkLogLevel::Error, __FILE__, __LINE__, ex.what());
+ }
+
+ return false;
+ }
+ catch(...)
+ {
+ if(Callbacks != nullptr)
+ {
+ Callbacks->Log(CbkLogLevel::Error, __FILE__, __LINE__, "unexpected exception");
+ }
+
+ return false;
+ }
+
+ return true;
+}
+
+extern "C" SENSOR_AGGREGATION_SHARED_EXPORT bool OpenPASS_Trigger(ModelInterface *implementation,
+ int time)
+{
+ try
+ {
+ implementation->Trigger(time);
+ }
+ catch(const std::runtime_error &ex)
+ {
+ if(Callbacks != nullptr)
+ {
+ Callbacks->Log(CbkLogLevel::Error, __FILE__, __LINE__, ex.what());
+ }
+
+ return false;
+ }
+ catch(...)
+ {
+ if(Callbacks != nullptr)
+ {
+ Callbacks->Log(CbkLogLevel::Error, __FILE__, __LINE__, "unexpected exception");
+ }
+
+ return false;
+ }
+
+ return true;
+}
diff --git a/sim/src/components/SensorAggregation_OSI/sensorAggregation.h b/sim/src/components/SensorAggregation_OSI/sensorAggregation.h
new file mode 100644
index 00000000..18f703a4
--- /dev/null
+++ b/sim/src/components/SensorAggregation_OSI/sensorAggregation.h
@@ -0,0 +1,30 @@
+/*******************************************************************************
+* Copyright (c) 2017, 2019, 2020 in-tech GmbH
+*
+* 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 SensorAggregation.h
+* @brief This file provides the exported methods.
+*
+* This file provides the exported methods which are available outside of the library. */
+//-----------------------------------------------------------------------------
+
+#pragma once
+
+#include <QtCore/qglobal.h>
+
+#if defined(SENSOR_AGGREGATION_LIBRARY)
+# define SENSOR_AGGREGATION_SHARED_EXPORT Q_DECL_EXPORT
+#else
+# define SENSOR_AGGREGATION_SHARED_EXPORT Q_DECL_IMPORT
+#endif
+
+#include "include/modelInterface.h"
+
+
diff --git a/sim/src/components/SensorFusion_OSI/src/sensorFusionImpl.cpp b/sim/src/components/SensorAggregation_OSI/src/sensorAggregationImpl.cpp
index a8bc50c9..37654892 100644
--- a/sim/src/components/SensorFusion_OSI/src/sensorFusionImpl.cpp
+++ b/sim/src/components/SensorAggregation_OSI/src/sensorAggregationImpl.cpp
@@ -9,13 +9,13 @@
*******************************************************************************/
//-----------------------------------------------------------------------------
-/** \brief SensorFusion.cpp */
+/** \brief sensorAggregationImpl.cpp */
//-----------------------------------------------------------------------------
-#include "sensorFusionImpl.h"
+#include "sensorAggregationImpl.h"
#include <qglobal.h>
-SensorFusionImplementation::SensorFusionImplementation(
+SensorAggregationImplementation::SensorAggregationImplementation(
std::string componentName,
bool isInit,
int priority,
@@ -44,7 +44,7 @@ SensorFusionImplementation::SensorFusionImplementation(
{
}
-void SensorFusionImplementation::UpdateInput(int localLinkId, const std::shared_ptr<SignalInterface const> &data, int time)
+void SensorAggregationImplementation::UpdateInput(int localLinkId, const std::shared_ptr<SignalInterface const> &data, int time)
{
if(time != previousTimeStamp) {
out_sensorData.Clear();
@@ -66,7 +66,7 @@ void SensorFusionImplementation::UpdateInput(int localLinkId, const std::shared_
out_sensorData.MergeFrom(signal->sensorData);
}
-void SensorFusionImplementation::UpdateOutput(int localLinkId, std::shared_ptr<SignalInterface const> &data, int time)
+void SensorAggregationImplementation::UpdateOutput(int localLinkId, std::shared_ptr<SignalInterface const> &data, int time)
{
Q_UNUSED(time);
@@ -98,7 +98,7 @@ void SensorFusionImplementation::UpdateOutput(int localLinkId, std::shared_ptr<S
}
}
-void SensorFusionImplementation::Trigger(int time)
+void SensorAggregationImplementation::Trigger(int time)
{
Q_UNUSED(time);
}
diff --git a/sim/src/components/SensorFusion_OSI/src/sensorFusionImpl.h b/sim/src/components/SensorAggregation_OSI/src/sensorAggregationImpl.h
index 3946842f..83f1ae9d 100644
--- a/sim/src/components/SensorFusion_OSI/src/sensorFusionImpl.h
+++ b/sim/src/components/SensorAggregation_OSI/src/sensorAggregationImpl.h
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2017, 2018, 2019 in-tech GmbH
+* Copyright (c) 2017, 2018, 2019, 2020 in-tech GmbH
* Copyright (c) 2020 HLRS, University of Stuttgart.
*
* This program and the accompanying materials are made
@@ -9,11 +9,11 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-/** \addtogroup SensorFusion
+/** \addtogroup SensorAggregation
* @{
-* \brief This file models the SensorFusion.
+* \brief This file models the SensorAggregation.
*
-* \details This file models the SensorFusion which can be part of an agent.
+* \details This file models the SensorAggregation which can be part of an agent.
* This module gets OSI SensorData of all sensors of the vehicle and forwards a combined
* SensorData to the driver assistance systems.
*
@@ -48,18 +48,18 @@
#include "osi3/osi_sensordata.pb.h"
//-----------------------------------------------------------------------------
-/** \brief This class is the SensorFusion module.
+/** \brief This class is the SensorAggregation module.
* \details This class contains all logic regarding the sensor fusion.
*
-* \ingroup SensorFusion
+* \ingroup SensorAggregation
*/
//-----------------------------------------------------------------------------
-class SensorFusionImplementation : public UnrestrictedModelInterface
+class SensorAggregationImplementation : public UnrestrictedModelInterface
{
public:
const std::string COMPONENTNAME = "SensorFusion";
- SensorFusionImplementation(
+ SensorAggregationImplementation(
std::string componentName,
bool isInit,
int priority,
@@ -73,11 +73,11 @@ public:
const CallbackInterface *callbacks,
AgentInterface *agent);
- SensorFusionImplementation(const SensorFusionImplementation&) = delete;
- SensorFusionImplementation(SensorFusionImplementation&&) = delete;
- SensorFusionImplementation& operator=(const SensorFusionImplementation&) = delete;
- SensorFusionImplementation& operator=(SensorFusionImplementation&&) = delete;
- virtual ~SensorFusionImplementation() = default;
+ SensorAggregationImplementation(const SensorAggregationImplementation&) = delete;
+ SensorAggregationImplementation(SensorAggregationImplementation&&) = delete;
+ SensorAggregationImplementation& operator=(const SensorAggregationImplementation&) = delete;
+ SensorAggregationImplementation& operator=(SensorAggregationImplementation&&) = delete;
+ virtual ~SensorAggregationImplementation() = default;
/*!
* \brief Update Inputs
diff --git a/sim/src/components/SensorFusion_OSI/CMakeLists.txt b/sim/src/components/SensorFusionErrorless_OSI/CMakeLists.txt
index e07d54f0..20b37f3d 100644
--- a/sim/src/components/SensorFusion_OSI/CMakeLists.txt
+++ b/sim/src/components/SensorFusionErrorless_OSI/CMakeLists.txt
@@ -1,4 +1,4 @@
-set(COMPONENT_NAME SensorFusion_OSI)
+set(COMPONENT_NAME SensorFusionErrorless_OSI)
add_compile_definitions(SENSOR_FUSION_LIBRARY)
@@ -6,12 +6,11 @@ add_openpass_target(
NAME ${COMPONENT_NAME} TYPE library LINKAGE shared COMPONENT core
HEADERS
- sensorFusion.h
+ sensorFusionErrorless_OSI.h
src/sensorFusionImpl.h
- src/sensorFusionQuery.h
SOURCES
- sensorFusion.cpp
+ sensorFusionErrorless_OSI.cpp
src/sensorFusionImpl.cpp
LIBRARIES
diff --git a/sim/src/components/SensorFusion_OSI/SensorFusion_OSI.pro b/sim/src/components/SensorFusionErrorless_OSI/SensorFusionErrorless_OSI.pro
index a1c21b8f..866637e7 100644
--- a/sim/src/components/SensorFusion_OSI/SensorFusion_OSI.pro
+++ b/sim/src/components/SensorFusionErrorless_OSI/SensorFusionErrorless_OSI.pro
@@ -9,9 +9,9 @@
# **********************************************************************/
#-----------------------------------------------------------------------------
-# \file SensorFusion_OSI.pro
+# \file SensorAggregation_OSI.pro
# \brief This file contains the information for the QtCreator-project of the
-# module SensorFusion_OSI
+# module SensorAggregation_OSI
#-----------------------------------------------------------------------------/
DEFINES += SENSOR_FUSION_LIBRARY
@@ -28,11 +28,11 @@ INCLUDEPATH += \
../..
SOURCES += \
- sensorFusion.cpp \
+ sensorFusionErrorless_OSI.cpp \
src/sensorFusionImpl.cpp
HEADERS += \
- sensorFusion.h \
+ sensorFusionErrorless_OSI.h \
src/sensorFusionImpl.h
LIBS += \
diff --git a/sim/src/components/SensorFusion_OSI/sensorFusion.cpp b/sim/src/components/SensorFusionErrorless_OSI/sensorFusionErrorless_OSI.cpp
index b3c88fdb..7178e3f4 100644
--- a/sim/src/components/SensorFusion_OSI/sensorFusion.cpp
+++ b/sim/src/components/SensorFusionErrorless_OSI/sensorFusionErrorless_OSI.cpp
@@ -12,7 +12,7 @@
/** \file SensorFusion.cpp */
//-----------------------------------------------------------------------------
-#include "sensorFusion.h"
+#include "sensorFusionErrorless_OSI.h"
#include "src/sensorFusionImpl.h"
const std::string Version = "0.0.1";
@@ -41,7 +41,7 @@ extern "C" SENSOR_FUSION_SHARED_EXPORT ModelInterface *OpenPASS_CreateInstance(
try
{
- return (ModelInterface*)(new (std::nothrow) SensorFusionImplementation(
+ return (ModelInterface*)(new (std::nothrow) SensorFusionErrorlessImplementation(
componentName,
isInit,
priority,
@@ -77,7 +77,7 @@ extern "C" SENSOR_FUSION_SHARED_EXPORT ModelInterface *OpenPASS_CreateInstance(
extern "C" SENSOR_FUSION_SHARED_EXPORT void OpenPASS_DestroyInstance(ModelInterface *implementation)
{
- delete (SensorFusionImplementation*)implementation;
+ delete (SensorFusionErrorlessImplementation*)implementation;
}
extern "C" SENSOR_FUSION_SHARED_EXPORT bool OpenPASS_UpdateInput(ModelInterface *implementation,
diff --git a/sim/src/components/SensorFusion_OSI/sensorFusion.h b/sim/src/components/SensorFusionErrorless_OSI/sensorFusionErrorless_OSI.h
index 8742ac56..8742ac56 100644
--- a/sim/src/components/SensorFusion_OSI/sensorFusion.h
+++ b/sim/src/components/SensorFusionErrorless_OSI/sensorFusionErrorless_OSI.h
diff --git a/sim/src/components/SensorFusionErrorless_OSI/src/sensorFusionImpl.cpp b/sim/src/components/SensorFusionErrorless_OSI/src/sensorFusionImpl.cpp
new file mode 100644
index 00000000..2d639d4b
--- /dev/null
+++ b/sim/src/components/SensorFusionErrorless_OSI/src/sensorFusionImpl.cpp
@@ -0,0 +1,127 @@
+/*******************************************************************************
+* Copyright (c) 2020 in-tech GmbH
+*
+* 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
+*******************************************************************************/
+
+//-----------------------------------------------------------------------------
+/** \brief sensorFusionImpl.cpp */
+//-----------------------------------------------------------------------------
+
+#include "sensorFusionImpl.h"
+#include <qglobal.h>
+
+SensorFusionErrorlessImplementation::SensorFusionErrorlessImplementation(
+ std::string componentName,
+ bool isInit,
+ int priority,
+ int offsetTime,
+ int responseTime,
+ int cycleTime,
+ StochasticsInterface *stochastics,
+ WorldInterface *world,
+ const ParameterInterface *parameters,
+ PublisherInterface * const publisher,
+ const CallbackInterface *callbacks,
+ AgentInterface *agent) :
+ UnrestrictedModelInterface(
+ componentName,
+ isInit,
+ priority,
+ offsetTime,
+ responseTime,
+ cycleTime,
+ stochastics,
+ world,
+ parameters,
+ publisher,
+ callbacks,
+ agent)
+{
+}
+
+void SensorFusionErrorlessImplementation::UpdateInput(int localLinkId, const std::shared_ptr<SignalInterface const> &data, [[maybe_unused]] int time)
+{
+ std::stringstream log;
+ log << COMPONENTNAME << " (component " << GetComponentName() << ", agent " << GetAgent()->GetId() << ", input data for local link " << localLinkId << ": ";
+ LOG(CbkLogLevel::Debug, log.str());
+
+ const std::shared_ptr<SensorDataSignal const> signal = std::dynamic_pointer_cast<SensorDataSignal const>(data);
+ if(!signal)
+ {
+ const std::string msg = COMPONENTNAME + " invalid signaltype";
+ LOG(CbkLogLevel::Debug, msg);
+ throw std::runtime_error(msg);
+ }
+
+ MergeSensorData(signal->sensorData);
+}
+
+void SensorFusionErrorlessImplementation::UpdateOutput(int localLinkId, std::shared_ptr<SignalInterface const> &data, [[maybe_unused]] int time)
+{
+ std::stringstream log;
+ log << COMPONENTNAME << " (component " << GetComponentName() << ", agent " << GetAgent()->GetId() << ", output data for local link " << localLinkId << ": ";
+ LOG(CbkLogLevel::Debug, log.str());
+
+
+ if(localLinkId == 0)
+ {
+ // to any ADAS
+ try
+ {
+ data = std::make_shared<SensorDataSignal const>(
+ out_sensorData);
+ }
+ catch(const std::bad_alloc&)
+ {
+ const std::string msg = COMPONENTNAME + " could not instantiate signal";
+ LOG(CbkLogLevel::Debug, msg);
+ throw std::runtime_error(msg);
+ }
+ }
+ else
+ {
+ const std::string msg = COMPONENTNAME + " invalid link";
+ LOG(CbkLogLevel::Debug, msg);
+ throw std::runtime_error(msg);
+ }
+}
+
+void SensorFusionErrorlessImplementation::Trigger(int)
+{
+}
+
+void SensorFusionErrorlessImplementation::MergeSensorData(const osi3::SensorData& in_SensorData)
+{
+ out_sensorData = {};
+ for (auto& movingObject : in_SensorData.moving_object())
+ {
+ auto existingObject = std::find_if(out_sensorData.mutable_moving_object()->begin(), out_sensorData.mutable_moving_object()->end(),
+ [&](const auto& object){return movingObject.header().ground_truth_id(0).value() == object.header().ground_truth_id(0).value();});
+ if (existingObject != out_sensorData.mutable_moving_object()->end())
+ {
+ existingObject->mutable_header()->mutable_sensor_id()->MergeFrom(movingObject.header().sensor_id());
+ }
+ else
+ {
+ out_sensorData.add_moving_object()->CopyFrom(movingObject);
+ }
+ }
+ for (auto& stationaryObject : in_SensorData.stationary_object())
+ {
+ auto existingObject = std::find_if(out_sensorData.mutable_stationary_object()->begin(), out_sensorData.mutable_stationary_object()->end(),
+ [&](const auto& object){return stationaryObject.header().ground_truth_id(0).value() == object.header().ground_truth_id(0).value();});
+ if (existingObject != out_sensorData.mutable_stationary_object()->end())
+ {
+ existingObject->mutable_header()->mutable_sensor_id()->MergeFrom(stationaryObject.header().sensor_id());
+ }
+ else
+ {
+ out_sensorData.add_stationary_object()->CopyFrom(stationaryObject);
+ }
+ }
+}
diff --git a/sim/src/components/SensorFusionErrorless_OSI/src/sensorFusionImpl.h b/sim/src/components/SensorFusionErrorless_OSI/src/sensorFusionImpl.h
new file mode 100644
index 00000000..f382e5b9
--- /dev/null
+++ b/sim/src/components/SensorFusionErrorless_OSI/src/sensorFusionImpl.h
@@ -0,0 +1,94 @@
+/*******************************************************************************
+* Copyright (c) 2020 in-tech GmbH
+*
+* 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
+*******************************************************************************/
+
+/** \addtogroup SensorFusionErrorless
+* @{
+* \brief This file models the SensorFusionErrorless.
+*
+* \details This file models the SensorFusionErrorless which can be part of an agent.
+* This module gets OSI SensorData of the SensorAggregation and combines all
+* object with the same id into one.
+*
+* \section MODULENAME_Inputs Inputs
+* Input variables:
+* name | meaning
+* -----|------
+* sensorData | SensorData of a single sensor.
+*
+* Input channel IDs:
+* Input Id | signal class | contained variables
+* ----------|--------------|-------------
+* 0 | SensorDataSignal | sensorData
+*
+* \section MODULENAME_Outputs Outputs
+* Output variables:
+* name | meaning
+* -----|------
+* out_sensorData | Combined SensorData from all sensors.
+*
+* Output channel IDs:
+* Output Id | signal class | contained variables
+* ----------|--------------|-------------
+* 0 | SensorDataSignal | out_sensorData
+*
+* @} */
+
+#pragma once
+
+#include "include/modelInterface.h"
+#include "common/sensorDataSignal.h"
+#include "osi3/osi_sensordata.pb.h"
+
+//-----------------------------------------------------------------------------
+/** \brief This class is the SensorFusionErrorless module.
+* \details This class contains all logic regarding the sensor fusion.
+*
+* \ingroup SensorFusionErrorless
+*/
+//-----------------------------------------------------------------------------
+class SensorFusionErrorlessImplementation : public UnrestrictedModelInterface
+{
+public:
+ const std::string COMPONENTNAME = "SensorFusion";
+
+ SensorFusionErrorlessImplementation(
+ std::string componentName,
+ bool isInit,
+ int priority,
+ int offsetTime,
+ int responseTime,
+ int cycleTime,
+ StochasticsInterface *stochastics,
+ WorldInterface *world,
+ const ParameterInterface *parameters,
+ PublisherInterface * const publisher,
+ const CallbackInterface *callbacks,
+ AgentInterface *agent);
+
+ SensorFusionErrorlessImplementation(const SensorFusionErrorlessImplementation&) = delete;
+ SensorFusionErrorlessImplementation(SensorFusionErrorlessImplementation&&) = delete;
+ SensorFusionErrorlessImplementation& operator=(const SensorFusionErrorlessImplementation&) = delete;
+ SensorFusionErrorlessImplementation& operator=(SensorFusionErrorlessImplementation&&) = delete;
+ virtual ~SensorFusionErrorlessImplementation() = default;
+
+ virtual void UpdateInput(int localLinkId, const std::shared_ptr<SignalInterface const> &data, int time);
+
+ void UpdateOutput(int localLinkId, std::shared_ptr<SignalInterface const> &data, int time);
+
+ virtual void Trigger(int time);
+
+private:
+
+ void MergeSensorData(const osi3::SensorData& in_SensorData);
+
+ osi3::SensorData out_sensorData;
+};
+
+
diff --git a/sim/src/core/slave/framework/dynamicAgentTypeGenerator.cpp b/sim/src/core/slave/framework/dynamicAgentTypeGenerator.cpp
index e8a7b3fa..d6dfda27 100644
--- a/sim/src/core/slave/framework/dynamicAgentTypeGenerator.cpp
+++ b/sim/src/core/slave/framework/dynamicAgentTypeGenerator.cpp
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2019 in-tech GmbH
+* Copyright (c) 2019, 2020 in-tech GmbH
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
@@ -111,11 +111,11 @@ DynamicAgentTypeGenerator& DynamicAgentTypeGenerator::GatherVehicleComponents()
DynamicAgentTypeGenerator& DynamicAgentTypeGenerator::GatherSensors()
{
- const std::string sensorFusionModulName = "SensorFusion";
+ const std::string sensorAggregationModulName = "SensorAggregation";
- GatherComponent(sensorFusionModulName, agentBuildInformation.agentType);
+ GatherComponent(sensorAggregationModulName, agentBuildInformation.agentType);
- int inputIdSensorFusion = systemConfigBlueprint->GetSystems().at(0)->GetComponents().at(sensorFusionModulName)->GetInputLinks().at(0);
+ int inputIdSensorAggregation = systemConfigBlueprint->GetSystems().at(0)->GetComponents().at(sensorAggregationModulName)->GetInputLinks().at(0);
int sensorNumber = 0;
auto vehicleProfile = profiles->GetVehicleProfiles().at(sampledProfiles.vehicleProfileName);
@@ -144,8 +144,8 @@ DynamicAgentTypeGenerator& DynamicAgentTypeGenerator::GatherSensors()
if (sensorNumber > 0)
{
- agentBuildInformation.agentType->GetComponents().at(sensorFusionModulName)->AddInputLink(sensorNumber,
- inputIdSensorFusion + sensorNumber);
+ agentBuildInformation.agentType->GetComponents().at(sensorAggregationModulName)->AddInputLink(sensorNumber,
+ inputIdSensorAggregation + sensorNumber);
}
// clone sensor and set specific parameters
diff --git a/sim/src/core/slave/framework/dynamicAgentTypeGenerator.h b/sim/src/core/slave/framework/dynamicAgentTypeGenerator.h
index ab230cf9..35ee9dc8 100644
--- a/sim/src/core/slave/framework/dynamicAgentTypeGenerator.h
+++ b/sim/src/core/slave/framework/dynamicAgentTypeGenerator.h
@@ -52,7 +52,8 @@ struct DefaultComponents
"Algorithm_LongitudinalVehicleComponents",
"PrioritizerAccelerationVehicleComponents",
"PrioritizerSteeringVehicleComponents",
- "LimiterAccelerationVehicleComponents"
+ "LimiterAccelerationVehicleComponents",
+ "SensorFusionErrorless"
};
};
diff --git a/sim/src/sim.pro b/sim/src/sim.pro
index cd5b7f3f..0d8026b0 100644
--- a/sim/src/sim.pro
+++ b/sim/src/sim.pro
@@ -44,7 +44,8 @@ SUBDIRS = \
components/Sensor_Driver \
components/Sensor_OSI \
components/Sensor_RecordState \
- components/SensorFusion_OSI \
+ components/SensorAggregation_OSI \
+ components/SensorFusionErrorless_OSI \
components/SignalPrioritizer
slave.file = core/slave/OpenPassSlave.pro
diff --git a/sim/tests/unitTests/CMakeLists.txt b/sim/tests/unitTests/CMakeLists.txt
index 7c9c91f6..8450ff6f 100644
--- a/sim/tests/unitTests/CMakeLists.txt
+++ b/sim/tests/unitTests/CMakeLists.txt
@@ -10,7 +10,8 @@ add_subdirectory(components/Dynamics_Collision)
add_subdirectory(components/Dynamics_TF)
add_subdirectory(components/LimiterAccVehComp)
add_subdirectory(components/OpenScenarioActions)
-add_subdirectory(components/SensorFusion_OSI)
+add_subdirectory(components/SensorAggregation_OSI)
+add_subdirectory(components/SensorFusionErrorless_OSI)
add_subdirectory(components/Sensor_Driver)
add_subdirectory(components/Sensor_OSI)
add_subdirectory(components/SignalPrioritizer)
diff --git a/sim/tests/unitTests/components/SensorAggregation_OSI/CMakeLists.txt b/sim/tests/unitTests/components/SensorAggregation_OSI/CMakeLists.txt
new file mode 100644
index 00000000..dac9fd9e
--- /dev/null
+++ b/sim/tests/unitTests/components/SensorAggregation_OSI/CMakeLists.txt
@@ -0,0 +1,22 @@
+set(COMPONENT_TEST_NAME SensorAggregationOSI_Tests)
+set(COMPONENT_SOURCE_DIR ${OPENPASS_SIMCORE_DIR}/components/SensorAggregation_OSI/src)
+
+add_openpass_target(
+ NAME ${COMPONENT_TEST_NAME} TYPE test COMPONENT core
+ DEFAULT_MAIN
+ LINKOSI
+
+ SOURCES
+ sensorAggregationOSI_Tests.cpp
+ ${COMPONENT_SOURCE_DIR}/sensorAggregationImpl.cpp
+
+ HEADERS
+ ${COMPONENT_SOURCE_DIR}/sensorAggregationImpl.h
+
+ INCDIRS
+ ${COMPONENT_SOURCE_DIR}
+
+ LIBRARIES
+ Qt5::Core
+)
+
diff --git a/sim/tests/unitTests/components/SensorFusion_OSI/sensorFusionOSI_Tests.cpp b/sim/tests/unitTests/components/SensorAggregation_OSI/sensorAggregationOSI_Tests.cpp
index 561ef51b..cd430e0c 100644
--- a/sim/tests/unitTests/components/SensorFusion_OSI/sensorFusionOSI_Tests.cpp
+++ b/sim/tests/unitTests/components/SensorAggregation_OSI/sensorAggregationOSI_Tests.cpp
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2019 in-tech GmbH
+* Copyright (c) 2019, 2020 in-tech GmbH
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,7 @@
#include "fakeAgent.h"
-#include "sensorFusionImpl.h"
+#include "sensorAggregationImpl.h"
#include "common/sensorDataSignal.h"
#include "osi3/osi_sensordata.pb.h"
@@ -21,7 +21,7 @@ using ::testing::Eq;
using ::testing::NiceMock;
using ::testing::Return;
-TEST(SensorFusionOSI_Unittest, TestAppendingDetectedObjectsWithinTheSameTimestamp)
+TEST(SensorAggregationOSI_Unittest, TestAppendingDetectedObjectsWithinTheSameTimestamp)
{
osi3::SensorData sensorData1;
auto movingObject1 = sensorData1.add_moving_object();
@@ -42,7 +42,7 @@ TEST(SensorFusionOSI_Unittest, TestAppendingDetectedObjectsWithinTheSameTimestam
NiceMock<FakeAgent> fakeAgent;
ON_CALL(fakeAgent, GetId()).WillByDefault(Return(0));
- SensorFusionImplementation sensorFusion("",
+ SensorAggregationImplementation sensorFusion("",
false,
0,
0,
@@ -74,7 +74,7 @@ TEST(SensorFusionOSI_Unittest, TestAppendingDetectedObjectsWithinTheSameTimestam
}
-TEST(SensorFusionOSI_Unittest, TestResettingDetectedObjectsInNewTimestamp)
+TEST(SensorAggregationOSI_Unittest, TestResettingDetectedObjectsInNewTimestamp)
{
osi3::SensorData sensorData1;
auto movingObject1 = sensorData1.add_moving_object();
@@ -95,7 +95,7 @@ TEST(SensorFusionOSI_Unittest, TestResettingDetectedObjectsInNewTimestamp)
NiceMock<FakeAgent> fakeAgent;
ON_CALL(fakeAgent, GetId()).WillByDefault(Return(0));
- SensorFusionImplementation sensorFusion("",
+ SensorAggregationImplementation sensorFusion("",
false,
0,
0,
diff --git a/sim/tests/unitTests/components/SensorAggregation_OSI/sensorAggregationOSI_Tests.pro b/sim/tests/unitTests/components/SensorAggregation_OSI/sensorAggregationOSI_Tests.pro
new file mode 100644
index 00000000..b1802b84
--- /dev/null
+++ b/sim/tests/unitTests/components/SensorAggregation_OSI/sensorAggregationOSI_Tests.pro
@@ -0,0 +1,32 @@
+# /*********************************************************************
+# * Copyright (c) 2019 in-tech GmbH
+# *
+# * 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
+# **********************************************************************/
+
+CONFIG += OPENPASS_GTEST \
+ OPENPASS_GTEST_DEFAULT_MAIN
+
+include(../../../testing.pri)
+
+UNIT_UNDER_TEST = $$OPEN_SRC/components/SensorAggregation_OSI/src
+
+INCLUDEPATH += \
+ . \
+ $$UNIT_UNDER_TEST \
+ ../../../..
+
+HEADERS += \
+ $$UNIT_UNDER_TEST/sensorAggregationImpl.h
+
+SOURCES += \
+ $$UNIT_UNDER_TEST/sensorAggregationImpl.cpp \
+ sensorAggregationOSI_Tests.cpp
+
+LIBS += \
+ -lopen_simulation_interface \
+ -lprotobuf
diff --git a/sim/tests/unitTests/components/SensorFusion_OSI/CMakeLists.txt b/sim/tests/unitTests/components/SensorFusionErrorless_OSI/CMakeLists.txt
index 7cdddcd4..44dc34ed 100644
--- a/sim/tests/unitTests/components/SensorFusion_OSI/CMakeLists.txt
+++ b/sim/tests/unitTests/components/SensorFusionErrorless_OSI/CMakeLists.txt
@@ -1,23 +1,22 @@
-set(COMPONENT_TEST_NAME SensorFusionOSI_Tests)
-set(COMPONENT_SOURCE_DIR ${OPENPASS_SIMCORE_DIR}/components/SensorFusion_OSI/src)
+set(COMPONENT_TEST_NAME SensorFusionErrorless_Tests)
+set(COMPONENT_SOURCE_DIR ${OPENPASS_SIMCORE_DIR}/components/SensorFusionErrorless_OSI/src)
add_openpass_target(
NAME ${COMPONENT_TEST_NAME} TYPE test COMPONENT core
DEFAULT_MAIN
- LINKOSI
SOURCES
- sensorFusionOSI_Tests.cpp
+ sensorFusionErrorless_Tests.cpp
${COMPONENT_SOURCE_DIR}/sensorFusionImpl.cpp
HEADERS
${COMPONENT_SOURCE_DIR}/sensorFusionImpl.h
- ${COMPONENT_SOURCE_DIR}/sensorFusionQuery.h
INCDIRS
${COMPONENT_SOURCE_DIR}
LIBRARIES
Qt5::Core
-)
+ LINKOSI
+)
diff --git a/sim/tests/unitTests/components/SensorFusionErrorless_OSI/sensorFusionErrorless_Tests.cpp b/sim/tests/unitTests/components/SensorFusionErrorless_OSI/sensorFusionErrorless_Tests.cpp
new file mode 100644
index 00000000..1d06c830
--- /dev/null
+++ b/sim/tests/unitTests/components/SensorFusionErrorless_OSI/sensorFusionErrorless_Tests.cpp
@@ -0,0 +1,168 @@
+/*******************************************************************************
+* Copyright (c) 2020 in-tech GmbH
+*
+* 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
+*******************************************************************************/
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+
+#include "fakeAgent.h"
+
+#include "sensorFusionImpl.h"
+
+using ::testing::Eq;
+
+TEST(SensorFusionErrorless_Tests, SensorDataWithMovingObjects_IsMergedAppropriately)
+{
+ FakeAgent fakeAgent;
+
+ auto sensorFusion = SensorFusionErrorlessImplementation("",
+ false,
+ 0,
+ 0,
+ 0,
+ 100,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ &fakeAgent);
+ unsigned int idA = 7;
+ unsigned int idB = 8;
+ unsigned int idC = 9;
+
+ unsigned int idSensor1 = 101;
+ unsigned int idSensor2 = 102;
+
+ osi3::SensorData sensorData;
+ auto movingObject1a = sensorData.add_moving_object();
+ movingObject1a->mutable_header()->add_ground_truth_id()->set_value(idA);
+ movingObject1a->mutable_header()->add_sensor_id()->set_value(idSensor1);
+ movingObject1a->mutable_base()->mutable_position()->set_x(10);
+ movingObject1a->mutable_base()->mutable_position()->set_y(11);
+ auto movingObject1b = sensorData.add_moving_object();
+ movingObject1b->mutable_header()->add_ground_truth_id()->set_value(idB);
+ movingObject1b->mutable_header()->add_sensor_id()->set_value(idSensor1);
+ movingObject1b->mutable_base()->mutable_position()->set_x(20);
+ movingObject1b->mutable_base()->mutable_position()->set_y(21);
+
+ auto movingObject2b = sensorData.add_moving_object();
+ movingObject2b->mutable_header()->add_ground_truth_id()->set_value(idB);
+ movingObject2b->mutable_header()->add_sensor_id()->set_value(idSensor2);
+ movingObject2b->mutable_base()->mutable_position()->set_x(20);
+ movingObject2b->mutable_base()->mutable_position()->set_y(21);
+ auto movingObject2c = sensorData.add_moving_object();
+ movingObject2c->mutable_header()->add_ground_truth_id()->set_value(idC);
+ movingObject2c->mutable_header()->add_sensor_id()->set_value(idSensor2);
+ movingObject2c->mutable_base()->mutable_position()->set_x(30);
+ movingObject2c->mutable_base()->mutable_position()->set_y(31);
+
+ auto signal = std::make_shared<SensorDataSignal>(sensorData);
+ sensorFusion.UpdateInput(0, signal, 0);
+
+ sensorFusion.Trigger(0);
+
+ std::shared_ptr<const SignalInterface> output;
+ sensorFusion.UpdateOutput(0, output, 0);
+ auto outSensorDataSignal = std::dynamic_pointer_cast<const SensorDataSignal>(output);
+ auto outSensorData = outSensorDataSignal->sensorData;
+
+ ASSERT_THAT(outSensorData.moving_object_size(), Eq(3));
+ ASSERT_THAT(outSensorData.moving_object(0).header().ground_truth_id(0).value(), Eq(idA));
+ ASSERT_THAT(outSensorData.moving_object(0).header().sensor_id_size(), Eq(1));
+ ASSERT_THAT(outSensorData.moving_object(0).header().sensor_id(0).value(), Eq(idSensor1));
+ ASSERT_THAT(outSensorData.moving_object(0).base().position().x(), Eq(10));
+ ASSERT_THAT(outSensorData.moving_object(0).base().position().y(), Eq(11));
+ ASSERT_THAT(outSensorData.moving_object(1).header().ground_truth_id(0).value(), Eq(idB));
+ ASSERT_THAT(outSensorData.moving_object(1).header().sensor_id_size(), Eq(2));
+ ASSERT_THAT(outSensorData.moving_object(1).header().sensor_id(0).value(), Eq(idSensor1));
+ ASSERT_THAT(outSensorData.moving_object(1).header().sensor_id(1).value(), Eq(idSensor2));
+ ASSERT_THAT(outSensorData.moving_object(1).base().position().x(), Eq(20));
+ ASSERT_THAT(outSensorData.moving_object(1).base().position().y(), Eq(21));
+ ASSERT_THAT(outSensorData.moving_object(2).header().ground_truth_id(0).value(), Eq(idC));
+ ASSERT_THAT(outSensorData.moving_object(2).header().sensor_id_size(), Eq(1));
+ ASSERT_THAT(outSensorData.moving_object(2).header().sensor_id(0).value(), Eq(idSensor2));
+ ASSERT_THAT(outSensorData.moving_object(2).base().position().x(), Eq(30));
+ ASSERT_THAT(outSensorData.moving_object(2).base().position().y(), Eq(31));
+}
+
+TEST(SensorFusionErrorless_Tests, SensorDataWithStationaryObjects_IsMergedAppropriately)
+{
+ FakeAgent fakeAgent;
+
+ auto sensorFusion = SensorFusionErrorlessImplementation("",
+ false,
+ 0,
+ 0,
+ 0,
+ 100,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ &fakeAgent);
+ unsigned int idA = 7;
+ unsigned int idB = 8;
+ unsigned int idC = 9;
+
+ unsigned int idSensor1 = 101;
+ unsigned int idSensor2 = 102;
+
+ osi3::SensorData sensorData;
+ auto stationaryObject1a = sensorData.add_stationary_object();
+ stationaryObject1a->mutable_header()->add_ground_truth_id()->set_value(idA);
+ stationaryObject1a->mutable_header()->add_sensor_id()->set_value(idSensor1);
+ stationaryObject1a->mutable_base()->mutable_position()->set_x(10);
+ stationaryObject1a->mutable_base()->mutable_position()->set_y(11);
+ auto stationaryObject1b = sensorData.add_stationary_object();
+ stationaryObject1b->mutable_header()->add_ground_truth_id()->set_value(idB);
+ stationaryObject1b->mutable_header()->add_sensor_id()->set_value(idSensor1);
+ stationaryObject1b->mutable_base()->mutable_position()->set_x(20);
+ stationaryObject1b->mutable_base()->mutable_position()->set_y(21);
+
+ auto stationaryObject2b = sensorData.add_stationary_object();
+ stationaryObject2b->mutable_header()->add_ground_truth_id()->set_value(idB);
+ stationaryObject2b->mutable_header()->add_sensor_id()->set_value(idSensor2);
+ stationaryObject2b->mutable_base()->mutable_position()->set_x(20);
+ stationaryObject2b->mutable_base()->mutable_position()->set_y(21);
+ auto stationaryObject2c = sensorData.add_stationary_object();
+ stationaryObject2c->mutable_header()->add_ground_truth_id()->set_value(idC);
+ stationaryObject2c->mutable_header()->add_sensor_id()->set_value(idSensor2);
+ stationaryObject2c->mutable_base()->mutable_position()->set_x(30);
+ stationaryObject2c->mutable_base()->mutable_position()->set_y(31);
+
+ auto signal = std::make_shared<SensorDataSignal>(sensorData);
+ sensorFusion.UpdateInput(0, signal, 0);
+
+ sensorFusion.Trigger(0);
+
+ std::shared_ptr<const SignalInterface> output;
+ sensorFusion.UpdateOutput(0, output, 0);
+ auto outSensorDataSignal = std::dynamic_pointer_cast<const SensorDataSignal>(output);
+ auto outSensorData = outSensorDataSignal->sensorData;
+
+ ASSERT_THAT(outSensorData.stationary_object_size(), Eq(3));
+ ASSERT_THAT(outSensorData.stationary_object(0).header().ground_truth_id(0).value(), Eq(idA));
+ ASSERT_THAT(outSensorData.stationary_object(0).header().sensor_id_size(), Eq(1));
+ ASSERT_THAT(outSensorData.stationary_object(0).header().sensor_id(0).value(), Eq(idSensor1));
+ ASSERT_THAT(outSensorData.stationary_object(0).base().position().x(), Eq(10));
+ ASSERT_THAT(outSensorData.stationary_object(0).base().position().y(), Eq(11));
+ ASSERT_THAT(outSensorData.stationary_object(1).header().ground_truth_id(0).value(), Eq(idB));
+ ASSERT_THAT(outSensorData.stationary_object(1).header().sensor_id_size(), Eq(2));
+ ASSERT_THAT(outSensorData.stationary_object(1).header().sensor_id(0).value(), Eq(idSensor1));
+ ASSERT_THAT(outSensorData.stationary_object(1).header().sensor_id(1).value(), Eq(idSensor2));
+ ASSERT_THAT(outSensorData.stationary_object(1).base().position().x(), Eq(20));
+ ASSERT_THAT(outSensorData.stationary_object(1).base().position().y(), Eq(21));
+ ASSERT_THAT(outSensorData.stationary_object(2).header().ground_truth_id(0).value(), Eq(idC));
+ ASSERT_THAT(outSensorData.stationary_object(2).header().sensor_id_size(), Eq(1));
+ ASSERT_THAT(outSensorData.stationary_object(2).header().sensor_id(0).value(), Eq(idSensor2));
+ ASSERT_THAT(outSensorData.stationary_object(2).base().position().x(), Eq(30));
+ ASSERT_THAT(outSensorData.stationary_object(2).base().position().y(), Eq(31));
+}
diff --git a/sim/tests/unitTests/components/SensorFusion_OSI/sensorFusionOSI_Tests.pro b/sim/tests/unitTests/components/SensorFusionErrorless_OSI/sensorFusionErrorless_Tests.pro
index e5f854c8..2385b171 100644
--- a/sim/tests/unitTests/components/SensorFusion_OSI/sensorFusionOSI_Tests.pro
+++ b/sim/tests/unitTests/components/SensorFusionErrorless_OSI/sensorFusionErrorless_Tests.pro
@@ -13,7 +13,7 @@ CONFIG += OPENPASS_GTEST \
include(../../../testing.pri)
-UNIT_UNDER_TEST = $$OPEN_SRC/components/SensorFusion_OSI/src
+UNIT_UNDER_TEST = $$OPEN_SRC/components/SensorFusionErrorless_OSI/src
INCLUDEPATH += \
. \
@@ -25,7 +25,7 @@ HEADERS += \
SOURCES += \
$$UNIT_UNDER_TEST/sensorFusionImpl.cpp \
- sensorFusionOSI_Tests.cpp
+ sensorFusionErrorless_Tests.cpp
LIBS += \
-lopen_simulation_interface \
diff --git a/sim/tests/unitTests/core/slave/agentSampler_Tests.cpp b/sim/tests/unitTests/core/slave/agentSampler_Tests.cpp
index 02e9910b..caa4ca98 100644
--- a/sim/tests/unitTests/core/slave/agentSampler_Tests.cpp
+++ b/sim/tests/unitTests/core/slave/agentSampler_Tests.cpp
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2018, 2019 in-tech GmbH
+* Copyright (c) 2018, 2019, 2020 in-tech GmbH
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
@@ -300,9 +300,9 @@ TEST(DynamicAgentTypeGenerator, GatherSensors)
std::map<int, std::shared_ptr<SimulationSlave::AgentTypeInterface>> systems = {{0, fakeAgentType}};
std::map<std::string, std::shared_ptr<SimulationSlave::ComponentType>> components{};
- auto sensorFusion = std::make_shared<SimulationSlave::ComponentType>("SensorFusion", false, 0, 0, 0, 0, "SensorFusion");
- sensorFusion->AddInputLink(0, 100);
- components.insert(std::make_pair("SensorFusion", sensorFusion));
+ auto sensorAggregation = std::make_shared<SimulationSlave::ComponentType>("SensorAggregation", false, 0, 0, 0, 0, "SensorAggregation");
+ sensorAggregation->AddInputLink(0, 100);
+ components.insert(std::make_pair("SensorAggregation", sensorAggregation));
auto sensorObjectDetector = std::make_shared<SimulationSlave::ComponentType>("SensorObjectDetector", false, 0, 0, 0, 0, "SensorObjectDetector");
sensorObjectDetector->AddOutputLink(3, 100);
@@ -317,14 +317,14 @@ TEST(DynamicAgentTypeGenerator, GatherSensors)
const auto& gatheredComponents = agentBuildInformation.agentType->GetComponents();
ASSERT_THAT(gatheredComponents.size(), Eq(3));
- ASSERT_THAT(gatheredComponents.count("SensorFusion"), Eq(1));
+ ASSERT_THAT(gatheredComponents.count("SensorAggregation"), Eq(1));
ASSERT_THAT(gatheredComponents.count("Sensor_5"), Eq(1));
ASSERT_THAT(gatheredComponents.count("Sensor_7"), Eq(1));
- ASSERT_THAT(gatheredComponents.at("SensorFusion")->GetInputLinks().size(), Eq(2));
- ASSERT_THAT(gatheredComponents.at("SensorFusion")->GetModelLibrary(), Eq("SensorFusion"));
- ASSERT_THAT(gatheredComponents.at("SensorFusion")->GetInputLinks().at(0), Eq(100));
- ASSERT_THAT(gatheredComponents.at("SensorFusion")->GetInputLinks().at(1), Eq(101));
+ ASSERT_THAT(gatheredComponents.at("SensorAggregation")->GetInputLinks().size(), Eq(2));
+ ASSERT_THAT(gatheredComponents.at("SensorAggregation")->GetModelLibrary(), Eq("SensorAggregation"));
+ ASSERT_THAT(gatheredComponents.at("SensorAggregation")->GetInputLinks().at(0), Eq(100));
+ ASSERT_THAT(gatheredComponents.at("SensorAggregation")->GetInputLinks().at(1), Eq(101));
ASSERT_THAT(gatheredComponents.at("Sensor_5")->GetModelLibrary(), Eq("SensorObjectDetector"));
ASSERT_THAT(gatheredComponents.at("Sensor_5")->GetOutputLinks().at(3), Eq(100));
diff --git a/sim/tests/unitTests/unitTests.pro b/sim/tests/unitTests/unitTests.pro
index ade3e5da..fd38aee5 100644
--- a/sim/tests/unitTests/unitTests.pro
+++ b/sim/tests/unitTests/unitTests.pro
@@ -30,7 +30,8 @@ SUBDIRS = \
openScenarioActions_Tests \
scheduler_Tests \
sensorDriver_Tests \
- sensorFusionOSI_Tests \
+ sensorAggregation_Tests \
+ sensorFusionErrorless_Tests \
sensorOSI_Tests \
signalPrioritizer_Tests \
spawnPointScenario_Tests \
@@ -87,8 +88,11 @@ scheduler_Tests.file = \
sensorDriver_Tests.file = \
$$PWD/components/Sensor_Driver/sensorDriver_Tests.pro
-sensorFusionOSI_Tests.file = \
- $$PWD/components/SensorFusion_OSI/sensorFusionOSI_Tests.pro
+sensorAggregation_Tests.file = \
+ $$PWD/components/SensorAggregation_OSI/sensorAggregationOSI_Tests.pro
+
+sensorFusionErrorless_Tests.file = \
+ $$PWD/components/SensorFusionErrorless_OSI/sensorFusionErrorless_Tests.pro
sensorOSI_Tests.file = \
$$PWD/components/Sensor_OSI/sensorOSI_Tests.pro

Back to the top