Skip to content
Snippets Groups Projects

#182 - Improve Algorithm_AEB to be also statically configured

Merged Victor Hexad requested to merge victorhexad/simopenpass:improve-aeb-static-config into develop
2 files
+ 29
15
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -2,6 +2,7 @@
@@ -2,6 +2,7 @@
* Copyright (c) 2020 HLRS, University of Stuttgart
* Copyright (c) 2020 HLRS, University of Stuttgart
* 2018-2020 in-tech GmbH
* 2018-2020 in-tech GmbH
* 2022 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* 2022 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
 
* 2023 Hexad GmbH
*
*
* This program and the accompanying materials are made available under the
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* terms of the Eclipse Public License 2.0 which is available at
@@ -25,15 +26,20 @@
@@ -25,15 +26,20 @@
namespace SensorFusionHelperFunctions
namespace SensorFusionHelperFunctions
{
{
static std::vector<osi3::DetectedMovingObject> RetrieveMovingObjectsBySensorId(const std::vector<int>& sensorIds, const osi3::SensorData &sensorData)
static std::vector<osi3::DetectedMovingObject> RetrieveMovingObjectsBySensorId(const std::vector<int> &sensorIds, const osi3::SensorData &sensorData)
{
{
std::vector<osi3::DetectedMovingObject> result;
std::vector<osi3::DetectedMovingObject> result;
auto detectedMovingObjects = sensorData.moving_object();
auto detectedMovingObjects = sensorData.moving_object();
for (const auto& object : detectedMovingObjects)
for (const auto &object : detectedMovingObjects)
{
{
 
if (sensorIds.empty())
 
{
 
result.push_back(object);
 
continue;
 
}
for (auto sensorId : object.header().sensor_id())
for (auto sensorId : object.header().sensor_id())
{
{
if(std::count(sensorIds.cbegin(), sensorIds.cend(), sensorId.value()) > 0)
if (std::count(sensorIds.cbegin(), sensorIds.cend(), sensorId.value()) > 0)
{
{
result.push_back(object);
result.push_back(object);
break;
break;
@@ -43,15 +49,20 @@ namespace SensorFusionHelperFunctions
@@ -43,15 +49,20 @@ namespace SensorFusionHelperFunctions
return result;
return result;
}
}
static std::vector<osi3::DetectedStationaryObject> RetrieveStationaryObjectsBySensorId(const std::vector<int>& sensorIds, const osi3::SensorData &sensorData)
static std::vector<osi3::DetectedStationaryObject> RetrieveStationaryObjectsBySensorId(const std::vector<int> &sensorIds, const osi3::SensorData &sensorData)
{
{
std::vector<osi3::DetectedStationaryObject> result;
std::vector<osi3::DetectedStationaryObject> result;
auto detectedStationaryObjects = sensorData.stationary_object();
auto detectedStationaryObjects = sensorData.stationary_object();
for (const auto& object : detectedStationaryObjects)
for (const auto &object : detectedStationaryObjects)
{
{
 
if (sensorIds.empty())
 
{
 
result.push_back(object);
 
continue;
 
}
for (auto sensorId : object.header().sensor_id())
for (auto sensorId : object.header().sensor_id())
{
{
if(std::count(sensorIds.cbegin(), sensorIds.cend(), sensorId.value()) > 0)
if (std::count(sensorIds.cbegin(), sensorIds.cend(), sensorId.value()) > 0)
{
{
result.push_back(object);
result.push_back(object);
break;
break;
Loading