Commit 1c9ab983 authored by konstantin blenz's avatar konstantin blenz
Browse files

Import of vehicle parameters MaxDeceleration and MaxAcceleration from VehicleModelsCatalog

parent 8e015d91
Thumbs.db
# qt artifact
**/build-*
**/build_debug-*
/.project
*.autosave
*.orig
......@@ -10,6 +11,7 @@ Thumbs.db
.directory
DoxyGen/Function/doxy_build/*
build
build_debug
*.bak
Doxygen.log
......
......@@ -89,6 +89,8 @@ struct ParametrizedVehicleModelParameters
VehicleAxle rearAxle;
openScenario::ParameterizedAttribute<double> distanceReferencePointToLeadingEdge = -999.0;
openScenario::ParameterizedAttribute<double> maxVelocity = -999.0;
openScenario::ParameterizedAttribute<double> maxAcceleration = -999.0;
openScenario::ParameterizedAttribute<double> maxDeceleration = -999.0;
openScenario::ParameterizedAttribute<double> weight = -999.0;
openScenario::ParameterizedAttribute<double> heightCOG = -999.0;
openScenario::ParameterizedAttribute<double> momentInertiaRoll = -999.0;
......@@ -122,6 +124,8 @@ struct ParametrizedVehicleModelParameters
GetAttribute(distanceReferencePointToLeadingEdge, assignedParameters),
GetAttribute(frontAxle.positionX, assignedParameters),
GetAttribute(maxVelocity, assignedParameters),
GetAttribute(maxAcceleration, assignedParameters),
GetAttribute(maxDeceleration, assignedParameters),
GetAttribute(weight, assignedParameters),
GetAttribute(heightCOG, assignedParameters),
GetAttribute(momentInertiaRoll, assignedParameters),
......
......@@ -260,6 +260,10 @@ struct VehicleModelParameters
double distanceReferencePointToFrontAxle = -999.0;
// The maximum velocity of the vehicle in m/s
double maxVelocity = -999.0;
// The maximum acceleration of the vehicle in m/s²
double maxAcceleration = -999.0;
// The maximum deceleration of the vehicle in m/s²
double maxDeceleration = -999.0;
// The overall mass of the vehicle in kg
double weight = -999.0;
// The height of the center of gravity above ground in m
......
......@@ -383,8 +383,8 @@ void AlgorithmModularDriverImplementation::UpdateInput(int localLinkId, const st
throw std::runtime_error(msg);
}
vehicleParameters = signal->vehicleParameters;
vehicleParameters.maxDeceleration = GetAgent()->GetMaxDeceleration() * -1; // TODO Adjust to deceleration as absolute value
vehicleParameters.maxAcceleration = GetAgent()->GetMaxAcceleration();
vehicleParameters.maxDeceleration = vehicleParameters.maxDeceleration > 0 ? vehicleParameters.maxDeceleration*-1 : vehicleParameters.maxDeceleration; //GetAgent()->GetMaxDeceleration() * -1; // TODO Adjust to deceleration as absolute value
//vehicleParameters.maxAcceleration = GetAgent()->GetMaxAcceleration();
situationassessment.SetVehicleParameters(&vehicleParameters);
actiondeduction.SetVehicleParameters(&vehicleParameters);
actionexecution.SetVehicleParameters(&vehicleParameters);
......
......@@ -22,6 +22,8 @@ agentParameters &agentParameters::operator = (const VehicleModelParameters &vp)
distanceReferencePointToLeadingEdge = vp.distanceReferencePointToLeadingEdge;
distanceReferencePointToFrontAxle = vp.distanceReferencePointToFrontAxle;
maxVelocity = vp.maxVelocity;
maxAcceleration = vp.maxAcceleration;
maxDeceleration = vp.maxDeceleration;
weight = vp.weight;
heightCOG = vp.heightCOG;
momentInertiaRoll = vp.momentInertiaRoll;
......
......@@ -15,6 +15,6 @@ class agentParameters : public VehicleModelParameters
{
public:
agentParameters &operator=(const VehicleModelParameters &);
double maxDeceleration;
double maxAcceleration;
//double maxDeceleration;
//double maxAcceleration;
};
......@@ -19,7 +19,7 @@ add_subdirectory(AlgorithmAFDM)
add_subdirectory(Algorithm_AEB)
#add_subdirectory(Algorithm_CruiseControlByDistance)
add_subdirectory(Algorithm_ModularDriver)
add_subdirectory(Algorithm_FmuWrapper)
#add_subdirectory(Algorithm_FmuWrapper)
add_subdirectory(Algorithm_Lateral)
add_subdirectory(Algorithm_Longitudinal)
add_subdirectory(ComponentController)
......
......@@ -49,6 +49,8 @@
* maximumEngineTorque | The maximum torque of the engine in Nm
* maximumSteeringWheelAngleAmplitude | The maximum amplitude of the steering wheel angle in degree
* maxVelocity | The maximum velocity of the vehicle in m/s
* maxAcceleration | The maximum acceleration of the vehicle in m/s²
* maxDeceleration | The maximum deceleration of the vehicle in m/s²
* minimumEngineSpeed | The idle speed of the engine in 1/min
* minimumEngineTorque | The drag torque of the engine in Nm
* momentInertiaPitch | The moment of inertia along the vehicle's lateral axes in kgm2
......
......@@ -487,6 +487,8 @@ namespace openpass::importer::xml::vehicleModelsImporter::attribute
constexpr char length[] {"length"};
constexpr char mass[] {"mass"};
constexpr char maxSpeed[] {"maxSpeed"};
constexpr char maxAcceleration[] {"maxAcceleration"};
constexpr char maxDeceleration[] {"maxDeceleration"};
constexpr char maxSteering[] {"maxSteering"};
constexpr char name[] {"name"};
constexpr char pedestrianCategory[] {"pedestrianCategory"};
......
......@@ -111,6 +111,8 @@ void VehicleModelsImporter::CheckModelParameters(const ParametrizedVehicleModelP
assert(model.rearAxle.trackWidth.defaultValue > 0);
// assert(model.wheelbase.defaultValue > 0);
assert(model.maxVelocity.defaultValue > 0);
assert(model.maxAcceleration.defaultValue > 0);
assert(model.maxDeceleration.defaultValue < 0);
// assert(model.maxCurvature.defaultValue > 0);
assert(model.vehicleType != AgentVehicleType::Undefined);
}
......@@ -210,6 +212,8 @@ void VehicleModelsImporter::ImportVehicleModelPerformance(QDomElement& vehicleEl
vehicleElement, "Tag " + std::string(TAG::performance) + " is missing.");
modelParameters.maxVelocity = ParseParametrizedAttribute<double>(performanceElement, ATTRIBUTE::maxSpeed, parameters);
modelParameters.maxAcceleration = ParseParametrizedAttribute<double>(performanceElement, ATTRIBUTE::maxAcceleration, parameters);
modelParameters.maxDeceleration = ParseParametrizedAttribute<double>(performanceElement, ATTRIBUTE::maxDeceleration, parameters);
}
void VehicleModelsImporter::ImportVehicleModelGears(ParametrizedVehicleModelParameters& modelParameters,
......
......@@ -99,6 +99,8 @@ private:
* - trackwidth
* - wheelbase
* - maxVelocity
* - maxAcceleration
* - maxDeceleration (smaller than 0.0)
* - maxCurvature
*
* \param[in] model The model parameters to check
......
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