Commit b55761cb authored by konstantin blenz's avatar konstantin blenz
Browse files

merge of modular-driver v.0.7-update to hlrs branch

parent 1eb61651
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
******************************************************************************/ ******************************************************************************/
#include "Algorithm_ModularDriver.h" #include "Algorithm_ModularDriver.h"
#include "Algorithm_ModularDriver_implementation.h" #include "src/Algorithm_ModularDriver_implementation.h"
const std::string Version = "0.0.1"; const std::string Version = "0.0.1";
static const CallbackInterface *Callbacks = nullptr; static const CallbackInterface *Callbacks = nullptr;
...@@ -29,7 +29,7 @@ extern "C" ALGORITHM_MODULARDRIVER_SHARED_EXPORT ModelInterface *OpenPASS_Create ...@@ -29,7 +29,7 @@ extern "C" ALGORITHM_MODULARDRIVER_SHARED_EXPORT ModelInterface *OpenPASS_Create
StochasticsInterface *stochastics, StochasticsInterface *stochastics,
WorldInterface *world, WorldInterface *world,
const ParameterInterface *parameters, const ParameterInterface *parameters,
const std::map<int, ObservationInterface*> *observations, PublisherInterface *const publisher,
AgentInterface *agent, AgentInterface *agent,
const CallbackInterface *callbacks) const CallbackInterface *callbacks)
{ {
...@@ -47,7 +47,7 @@ extern "C" ALGORITHM_MODULARDRIVER_SHARED_EXPORT ModelInterface *OpenPASS_Create ...@@ -47,7 +47,7 @@ extern "C" ALGORITHM_MODULARDRIVER_SHARED_EXPORT ModelInterface *OpenPASS_Create
stochastics, stochastics,
world, world,
parameters, parameters,
observations, publisher,
callbacks, callbacks,
agent)); agent));
} }
...@@ -171,10 +171,10 @@ extern "C" ALGORITHM_MODULARDRIVER_SHARED_EXPORT bool OpenPASS_Trigger( ...@@ -171,10 +171,10 @@ extern "C" ALGORITHM_MODULARDRIVER_SHARED_EXPORT bool OpenPASS_Trigger(
if(Callbacks != nullptr) if(Callbacks != nullptr)
{ {
#ifndef _MSC_VER #ifndef _MSC_VER
std::exception_ptr p = std::current_exception(); std::exception_ptr p = std::current_exception();
const std::string exType = p ? p.__cxa_exception_type()->name() : "null"; const std::string exType = p ? p.__cxa_exception_type()->name() : "null";
#else #else
const std::string exType = "null"; const std::string exType = "null";
#endif #endif
Callbacks->Log(CbkLogLevel::Error, __FILE__, __LINE__, "unexpected exception - type: " + exType); Callbacks->Log(CbkLogLevel::Error, __FILE__, __LINE__, "unexpected exception - type: " + exType);
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#pragma once #pragma once
#include "Algorithm_ModularDriver_global.h" #include "src/Algorithm_ModularDriver_global.h"
#include "modelInterface.h" #include "include/modelInterface.h"
...@@ -11,13 +11,13 @@ CONFIG += OPENPASS_LIBRARY ...@@ -11,13 +11,13 @@ CONFIG += OPENPASS_LIBRARY
include(../../../global.pri) include(../../../global.pri)
SUBDIRS += . \ SUBDIRS += . \
../Sensor_Modular_Driver/Signals \ ../Sensor_Modular_Driver/src/Signals \
../Sensor_Modular_Driver/Container \ ../Sensor_Modular_Driver/src/Container \
ActionDeductionMethods \ src/ActionDeductionMethods \
SituationAssessmentMethods \ src/SituationAssessmentMethods \
../../Common \ ../../Common \
../../Interfaces \ ../../Interfaces \
../Sensor_Driver/Signals \ ../Sensor_Driver/src/Signals \
.. ..
INCLUDEPATH += $$SUBDIRS \ INCLUDEPATH += $$SUBDIRS \
...@@ -29,9 +29,9 @@ SOURCES += \ ...@@ -29,9 +29,9 @@ SOURCES += \
$$getFiles(SUBDIRS, cpp) \ $$getFiles(SUBDIRS, cpp) \
$$getFiles(SUBDIRS, cc) \ $$getFiles(SUBDIRS, cc) \
$$getFiles(SUBDIRS, c) \ $$getFiles(SUBDIRS, c) \
../Algorithm_Longitudinal/algorithm_longitudinalCalculations.cpp \ ../Algorithm_Longitudinal/src/algorithm_longitudinalCalculations.cpp \
HEADERS += \ HEADERS += \
$$getFiles(SUBDIRS, hpp) \ $$getFiles(SUBDIRS, hpp) \
$$getFiles(SUBDIRS, h) \ $$getFiles(SUBDIRS, h) \
../Algorithm_Longitudinal/algorithm_longitudinalCalculations.h \ ../Algorithm_Longitudinal/src/algorithm_longitudinalCalculations.h \
...@@ -16,43 +16,39 @@ add_openpass_target( ...@@ -16,43 +16,39 @@ add_openpass_target(
NAME ${COMPONENT_NAME} TYPE library LINKAGE shared COMPONENT core NAME ${COMPONENT_NAME} TYPE library LINKAGE shared COMPONENT core
HEADERS HEADERS
AlgorithmSituationAssessment.h Algorithm_ModularDriver.h
AlgorithmActionExecution.h src/Algorithm_ModularDriver_global.h
Algorithm_ModularDriver.h src/Algorithm_ModularDriver_implementation.h
Algorithm_ModularDriver_implementation.h src/AlgorithmActionDeduction.h
Algorithm_ModularDriver_global.h src/AlgorithmActionExecution.h
AlgorithmActionDeduction.h src/AlgorithmInformationAcquisition.h
AlgorithmInformationAcquisition.h src/AlgorithmMentalModel.h
AlgorithmMentalModel.h src/AlgorithmSituationAssessment.h
ActionDeductionMethods/CFModel.h src/ActionDeductionMethods/AbstractLaneChangeModel.h
ActionDeductionMethods/LCM_LC2013.h src/ActionDeductionMethods/CFModel.h
ActionDeductionMethods/AbstractLaneChangeModel.h src/ActionDeductionMethods/CFModel_Daniel1.h
ActionDeductionMethods/TargetBraking.h src/ActionDeductionMethods/LCM_LC2013.h
ActionDeductionMethods/CFModel_Daniel1.h src/ActionDeductionMethods/TargetBraking.h
SituationAssessmentMethods/SituationCalculation.h src/SituationAssessmentMethods/boundingBoxCalculation.h
SituationAssessmentMethods/SituationLogging.h src/SituationAssessmentMethods/SituationCalculation.h
SituationAssessmentMethods/boundingBoxCalculation.h src/SituationAssessmentMethods/SituationLogging.h
../Algorithm_Longitudinal/algorithm_longitudinalCalculations.h
SOURCES SOURCES
AlgorithmSituationAssessment.cpp Algorithm_ModularDriver.cpp
AlgorithmActionExecution.cpp src/Algorithm_ModularDriver_implementation.cpp
Algorithm_ModularDriver.cpp src/AlgorithmActionDeduction.cpp
AlgorithmInformationAcquisition.cpp src/AlgorithmActionExecution.cpp
Algorithm_ModularDriver_implementation.cpp src/AlgorithmInformationAcquisition.cpp
AlgorithmMentalModel.cpp src/AlgorithmMentalModel.cpp
AlgorithmActionDeduction.cpp src/AlgorithmSituationAssessment.cpp
ActionDeductionMethods/AbstractLaneChangeModel.cpp src/ActionDeductionMethods/AbstractLaneChangeModel.cpp
ActionDeductionMethods/TargetBraking.cpp src/ActionDeductionMethods/CFModel.cpp
ActionDeductionMethods/CFModel.cpp src/ActionDeductionMethods/CFModel_Daniel1.cpp
ActionDeductionMethods/LCM_LC2013.cpp src/ActionDeductionMethods/LCM_LC2013.cpp
ActionDeductionMethods/CFModel_Daniel1.cpp src/ActionDeductionMethods/TargetBraking.cpp
SituationAssessmentMethods/SituationLogging.cpp src/SituationAssessmentMethods/boundingBoxCalculation.cpp
SituationAssessmentMethods/SituationCalculation.cpp src/SituationAssessmentMethods/SituationCalculation.cpp
SituationAssessmentMethods/boundingBoxCalculation.cpp src/SituationAssessmentMethods/SituationLogging.cpp
../Algorithm_Longitudinal/algorithm_longitudinalCalculations.cpp
../Sensor_Modular_Driver/Container/agent_representation.cpp
../Sensor_Modular_Driver/Container/MentalModelLane.cpp
LIBRARIES LIBRARIES
Qt5::Core Qt5::Core
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include <map> #include <map>
#include <vector> #include <vector>
#include <utility> #include <utility>
#include "Container/ContainerStructures.h" #include "../../../Sensor_Modular_Driver/src/Container/ContainerStructures.h"
class Lane; class Lane;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
*/ */
#include "TargetBraking.h" #include "TargetBraking.h"
#include "Container/ContainerStructures.h" #include "../../../Sensor_Modular_Driver/src/Container/ContainerStructures.h"
TargetBraking::TargetBraking(int cycleTime, StochasticsInterface *stochastics): TargetBraking::TargetBraking(int cycleTime, StochasticsInterface *stochastics):
cycleTime(cycleTime), cycleTime(cycleTime),
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#pragma once #pragma once
#include "Interfaces/stochasticsInterface.h" #include "include/stochasticsInterface.h"
#include "Container/ContainerStructures.h" #include "../../../Sensor_Modular_Driver/src/Container/ContainerStructures.h"
#include "CFModel.h" #include "CFModel.h"
//! \ingroup Algorithm_Action_Deduction //! \ingroup Algorithm_Action_Deduction
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
//#include <limits> //#include <limits>
#include <iostream> #include <iostream>
#include "AlgorithmActionDeduction.h" #include "AlgorithmActionDeduction.h"
#include <Common/commonTools.h> #include "common/commonTools.h"
ActionDeduction::ActionDeduction(int cycletime, StochasticsInterface *stochastics, ObservationInterface *observer) : ActionDeduction::ActionDeduction(int cycletime, StochasticsInterface *stochastics, ObservationInterface *observer) :
CycleTime(cycletime), CycleTime(cycletime),
...@@ -103,7 +103,19 @@ void ActionDeduction::CalcAccelerationWish(ActionDeduction_Output_BU &AD_Output_ ...@@ -103,7 +103,19 @@ void ActionDeduction::CalcAccelerationWish(ActionDeduction_Output_BU &AD_Output_
CarFollowingModel->setHeadwayTime(*AD_Input->SA_O_BU->Ego->GetDriverInformation()->thw_Wish); CarFollowingModel->setHeadwayTime(*AD_Input->SA_O_BU->Ego->GetDriverInformation()->thw_Wish);
double delta_s_front = *Leader.GetDistanceToEgo() - *DriverInformation->MinGap; double delta_s_front = *Leader.GetDistanceToEgo() - *DriverInformation->MinGap;
double v_long_Front = Leader.GetState()->velocity_long; double v_long_Front = Leader.GetState()->velocity_long;
double netttc = TrafficHelperFunctions::CalculateNetTTC(v_long, v_long_Front, delta_s_front); // Calculation not in TrafficHelperFunctions -> Calculation previously done in function is done here now
// TODO Decide where it should be
// double netttc = TrafficHelperFunctions::CalculateNetTTC(v_long, v_long_Front, delta_s_front);
double netttc {-99.};
if (delta_s_front < 0.)
{
netttc = -1.;
}
else
{
double deltaV {v_long - v_long_Front};
netttc = deltaV < 1e-6 ? 99. : delta_s_front / deltaV;
}
if (netttc < *AD_Input->SA_O_BU->Ego->GetDriverInformation()->ttc_threshold) if (netttc < *AD_Input->SA_O_BU->Ego->GetDriverInformation()->ttc_threshold)
decel = vehicleParameters->maxDeceleration; decel = vehicleParameters->maxDeceleration;
...@@ -625,29 +637,31 @@ void ActionDeduction::Initialize() ...@@ -625,29 +637,31 @@ void ActionDeduction::Initialize()
void ActionDeduction::LogSetValues(int time) void ActionDeduction::LogSetValues(int time)
{ {
Logged = true; Logged = true;
observation->Insert(time, //!!!
AD_Input->MM_O->Ego->GetState()->id, // observation->Insert(time,
LoggingGroup::Driver, // AD_Input->MM_O->Ego->GetState()->id,
"MinComfortDeceleration", // LoggingGroup::Driver,
std::to_string(minComfortDeceleration)); // "MinComfortDeceleration",
observation->Insert(time, // std::to_string(minComfortDeceleration));
AD_Input->MM_O->Ego->GetState()->id, // observation->Insert(time,
LoggingGroup::Driver, // AD_Input->MM_O->Ego->GetState()->id,
"MaxComfortAcceleration", // LoggingGroup::Driver,
std::to_string(maxComfortAcceleration)); // "MaxComfortAcceleration",
observation->Insert(time, // std::to_string(maxComfortAcceleration));
AD_Input->MM_O->Ego->GetState()->id, // observation->Insert(time,
LoggingGroup::Driver, // AD_Input->MM_O->Ego->GetState()->id,
"SpeedGain", // LoggingGroup::Driver,
std::to_string(SpeedGain)); // "SpeedGain",
observation->Insert(time, // std::to_string(SpeedGain));
AD_Input->MM_O->Ego->GetState()->id, // observation->Insert(time,
LoggingGroup::Driver, // AD_Input->MM_O->Ego->GetState()->id,
"KeepRight", // LoggingGroup::Driver,
std::to_string(KeepRight)); // "KeepRight",
observation->Insert(time, // std::to_string(KeepRight));
AD_Input->MM_O->Ego->GetState()->id, // observation->Insert(time,
LoggingGroup::Driver, // AD_Input->MM_O->Ego->GetState()->id,
"Cooperative", // LoggingGroup::Driver,
std::to_string(Cooperative)); // "Cooperative",
// std::to_string(Cooperative));
//!!!
} }
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
#pragma once #pragma once
//#include <vector> //#include <vector>
#include "Interfaces/stochasticsInterface.h" #include "include/stochasticsInterface.h"
#include "Interfaces/observationInterface.h" #include "include/observationInterface.h"
#include "Container/ContainerStructures.h" #include "../../Sensor_Modular_Driver/src/Container/ContainerStructures.h"
#include "ActionDeductionMethods/CFModel.h" #include "ActionDeductionMethods/CFModel.h"
#include "ActionDeductionMethods/CFModel_Daniel1.h" #include "ActionDeductionMethods/CFModel_Daniel1.h"
#include "ActionDeductionMethods/AbstractLaneChangeModel.h" #include "ActionDeductionMethods/AbstractLaneChangeModel.h"
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
#include <map> #include <map>
#include <iostream> #include <iostream>
#include "AlgorithmActionExecution.h" #include "AlgorithmActionExecution.h"
#include <Common/commonTools.h> #include "common/commonTools.h"
#include "../../Algorithm_Longitudinal/src/longCalcs.cpp"
ActionExecution::ActionExecution(StochasticsInterface *stochastics): ActionExecution::ActionExecution(StochasticsInterface *stochastics):
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
#pragma once #pragma once
//#include <vector> //#include <vector>
#include "Container/ContainerStructures.h" #include "../../Sensor_Modular_Driver/src/Container/ContainerStructures.h"
#include "../Algorithm_Longitudinal/algorithm_longitudinalCalculations.h" #include "../../Algorithm_Longitudinal/src/longCalcs.h"
#include "Interfaces/stochasticsInterface.h" #include "include/stochasticsInterface.h"
//! \brief This class contains the data calculations for the execution of actions from the previous cognition. //! \brief This class contains the data calculations for the execution of actions from the previous cognition.
//! Singleton such that data calculations is generated only once and not seperately //! Singleton such that data calculations is generated only once and not seperately
......
...@@ -138,34 +138,35 @@ bool InformationAcquisition::IsReactive() ...@@ -138,34 +138,35 @@ bool InformationAcquisition::IsReactive()
void InformationAcquisition::LogSetValues(int time) void InformationAcquisition::LogSetValues(int time)
{ {
_observation->Insert(time, //!!!
IA_Input_BU->EgoData.GetState()->id, // _observation->Insert(time,
LoggingGroup::Driver, // IA_Input_BU->EgoData.GetState()->id,
"CurrentAvertViewTime", // LoggingGroup::Driver,
std::to_string(currentReactionTime)); // "CurrentAvertViewTime",
// std::to_string(currentReactionTime));
if (IA_Input_BU->EgoData.GetState()->collisionpartners.size()>0)
{ // if (IA_Input_BU->EgoData.GetState()->collisionpartners.size()>0)
std::string partners; // {
// std::string partners;
auto collisionPartners = IA_Input_BU->EgoData.GetState()->collisionpartners;
for (const auto &partner : collisionPartners) // auto collisionPartners = IA_Input_BU->EgoData.GetState()->collisionpartners;
{ // for (const auto &partner : collisionPartners)
partners += std::to_string(partner.second) + ", "; // {
} // partners += std::to_string(partner.second) + ", ";
// }
std::string out = "CollisionAgentId: " + std::to_string(IA_Input_BU->EgoData.GetState()->id) +
", CollisionPartners: " + partners + // std::string out = "CollisionAgentId: " + std::to_string(IA_Input_BU->EgoData.GetState()->id) +
"CurrAvertView: " + std::to_string(currentReactionTime) + // ", CollisionPartners: " + partners +
", CurrAvertTrigger: " + std::to_string(reactionTimeTrigger); // "CurrAvertView: " + std::to_string(currentReactionTime) +
// ", CurrAvertTrigger: " + std::to_string(reactionTimeTrigger);
std::shared_ptr<BasicEvent> event = std::make_shared<BasicEvent>(time,
out, // std::shared_ptr<BasicEvent> event = std::make_shared<BasicEvent>(time,
"sequenceName", // out,
EventDefinitions::EventType::ComponentStateChange); // "sequenceName",
// EventDefinitions::EventType::ComponentStateChange);
_observation->InsertEvent(event);
} // _observation->InsertEvent(event);
// }
//!!!
} }
...@@ -24,11 +24,9 @@ ...@@ -24,11 +24,9 @@
//#include <vector> //#include <vector>
#include <iostream> #include <iostream>
#include "Container/ContainerStructures.h" #include "components/Sensor_Modular_Driver/src/Container/ContainerStructures.h"
#include "Interfaces/stochasticsInterface.h" #include "include/stochasticsInterface.h"
#include "Interfaces/observationInterface.h" #include "include//observationInterface.h"
#include "Common/vehicleComponentEvent.h"
//! \brief This class contains the acquisition of informations like visual and auditive. //! \brief This class contains the acquisition of informations like visual and auditive.
//! Singleton such that data calculations is generated only once and not seperately //! Singleton such that data calculations is generated only once and not seperately
......
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