fixed speed limit
Signed-off-by:
hpcwoess <woessner@hlrs.de>
... | ... | @@ -232,7 +232,12 @@ double SituationAssessment::AdaptionOnSpeedLimit(double SpeedLimit, double Dista |
lastSpeedLimit = SpeedLimit; | ||
double v_Wish_target = SpeedLimit + commonSpeedLimit_Violation; | ||
const double v_ego = SA_Input->MM_O->Ego->GetState_Ego()->velocity_long; | ||
v_Wish_new = v_ego + (v_Wish_target - v_ego)/Distance * (cycleTime*0.001); | ||
//v_Wish_new = v_ego + (v_Wish_target - v_ego)/Distance * (cycleTime*0.001); // please explain this to me I would rather say that the wish speed should be the speed limit when the distance reaches 0 (whell the stvo sais something else) but this should be the minimum... | ||
|
||
//double a = ((v_Wish_target - v_ego) * (v_Wish_target - v_ego)) / (2 * Distance); | ||
double tToSpeedlimit = 2 * Distance / sqrt(v_ego -v_Wish_target); | ||
v_Wish_new = v_ego - (((v_ego - v_Wish_target) / tToSpeedlimit) * (cycleTime * 0.001)); | ||
if (v_Wish_new < lastSpeedLimit + commonSpeedLimit_Violation) | ||
v_Wish_new = lastSpeedLimit + commonSpeedLimit_Violation; // just to be safe | ||
return v_Wish_new; | ||
} | ||
if (Distance < 0) | ||
... | ... | @@ -240,7 +245,7 @@ double SituationAssessment::AdaptionOnSpeedLimit(double SpeedLimit, double Dista |
lastSpeedLimit = SpeedLimit; | ||
} | ||
} | ||
if (vWish > lastSpeedLimit) | ||
if (vWish > lastSpeedLimit + commonSpeedLimit_Violation) | ||
{ | ||
vWish = lastSpeedLimit + commonSpeedLimit_Violation; | ||
return lastSpeedLimit + commonSpeedLimit_Violation; | ||
... | ... |