sumo icon indicating copy to clipboard operation
sumo copied to clipboard

EIDM: imprecise stopping causes emergency braking at junction

Open namdre opened this issue 3 years ago • 10 comments

found while building tests for https://github.com/eclipse/sumo/issues/11165 but probably not related.

The vehicle that does emergency braking is running with Krauss (after an EIDM vehicle is apparently violating it's right-of-way). ~~Possibly, some code that estimates the time to clear the intersection returns invalid results.~~

namdre avatar Jul 13 '22 15:07 namdre

@domsall The junction model is telling EIDM to brake hard for a closed link (oncoming foe traffic). However, the model insists on reduced braking (~ 1/3 of the needed deceleration) and thus passes the stop line (of the internal junction). Here is the relevant log that shows how the gap approaches 0 but the vehicle just keeps on driving.

stopSpeed 99.10s, veh=0 speed=2.68 gap=2.48 vars->v0_int=8.00
99.10 EIDM::finalizeSpeed s, veh=0 oldV=2.68 vPos=2.64 _vPos=2.64 vStop=2.64 vMinEmergency=1.78 vMin=2.23 vMax=2.64
stopSpeed 99.20s, veh=0 speed=2.64 gap=2.21 vars->v0_int=8.00
99.20 EIDM::finalizeSpeed s, veh=0 oldV=2.64 vPos=2.58 _vPos=2.58 vStop=2.58 vMinEmergency=1.74 vMin=2.19 vMax=2.58
stopSpeed 99.30s, veh=0 speed=2.58 gap=1.95 vars->v0_int=8.00
99.30 EIDM::finalizeSpeed s, veh=0 oldV=2.58 vPos=2.53 _vPos=2.53 vStop=2.53 vMinEmergency=1.68 vMin=2.13 vMax=2.53
stopSpeed 99.40s, veh=0 speed=2.53 gap=1.70 vars->v0_int=8.00
99.40 EIDM::finalizeSpeed s, veh=0 oldV=2.53 vPos=2.46 _vPos=2.46 vStop=2.46 vMinEmergency=1.63 vMin=2.08 vMax=2.46
stopSpeed 99.50s, veh=0 speed=2.46 gap=1.45 vars->v0_int=8.00
99.50 EIDM::finalizeSpeed s, veh=0 oldV=2.46 vPos=2.40 _vPos=2.40 vStop=2.40 vMinEmergency=1.56 vMin=2.01 vMax=2.40
stopSpeed 99.60s, veh=0 speed=2.40 gap=1.22 vars->v0_int=8.00
99.60 EIDM::finalizeSpeed s, veh=0 oldV=2.40 vPos=2.32 _vPos=2.32 vStop=2.32 vMinEmergency=1.50 vMin=1.95 vMax=2.32
stopSpeed 99.70s, veh=0 speed=2.32 gap=0.98 vars->v0_int=8.00
99.70 EIDM::finalizeSpeed s, veh=0 oldV=2.32 vPos=2.24 _vPos=2.24 vStop=2.24 vMinEmergency=1.42 vMin=1.87 vMax=2.24
stopSpeed 99.80s, veh=0 speed=2.24 gap=0.76 vars->v0_int=8.00
99.80 EIDM::finalizeSpeed s, veh=0 oldV=2.24 vPos=2.15 _vPos=2.15 vStop=2.15 vMinEmergency=1.34 vMin=1.79 vMax=2.15
stopSpeed 99.90s, veh=0 speed=2.15 gap=0.54 vars->v0_int=8.00
99.90 EIDM::finalizeSpeed s, veh=0 oldV=2.15 vPos=2.06 _vPos=2.06 vStop=2.06 vMinEmergency=1.25 vMin=1.70 vMax=2.06
stopSpeed 100.00s, veh=0 speed=2.06 gap=0.34 vars->v0_int=8.00
100.00 EIDM::finalizeSpeed s, veh=0 oldV=2.06 vPos=1.96 _vPos=1.96 vStop=1.96 vMinEmergency=1.16 vMin=1.61 vMax=1.96
stopSpeed 100.10s, veh=0 speed=1.96 gap=0.14 vars->v0_int=8.00
100.10 EIDM::finalizeSpeed s, veh=0 oldV=1.96 vPos=1.86 _vPos=1.86 vStop=1.86 vMinEmergency=1.06 vMin=1.51 vMax=1.86
stopSpeed 100.20s, veh=0 speed=1.86 gap=0.00 vars->v0_int=8.00
100.20 EIDM::finalizeSpeed s, veh=0 oldV=1.86 vPos=1.69 _vPos=1.69 vStop=1.69 vMinEmergency=0.96 vMin=1.41 vMax=1.69

namdre avatar Jul 14 '22 11:07 namdre

This is probably the output from the test?! I will look into it.

I think I know where this is coming from: The gap in stopSpeed/followSpeed is without the minGap, so 0.00m means that this is the place to come to a stop. With estimated variables this can be under/overestimated. The EIDM subtracts 0.25m from the gap to ensure a stop before the vehicle reaches 0.00m, but this seems to be not enough here.

For followSpeed, the EIDM adds minGap to the actual gap the same way the IDM does (to the real gap and to the desired gap s). The only difference is that the EIDM does the same for stopSpeed while the IDM does not do this. But not adding minGap can result in oscillating high acceleration/deceleration because we are dividing two very small values, which are both influenced by estimated values.

Domsall avatar Jul 14 '22 11:07 Domsall

This is probably the output from the test?!

Yes: tests/sumo/cf_model/EIDM/ticket11183

namdre avatar Jul 14 '22 11:07 namdre

Arguably, it's easier to estimate the distance to a fixed point in space (compared to judging distance and speed of a moving leader) and it becomes progressively easier as the distance is reduced. Not driving over a stop line should generally be achievable.

namdre avatar Jul 14 '22 11:07 namdre

After looking into this, it seems to be a model dependent issue of the IDM... With this parameter set the IDM also causes collisions when trying to stop behind another vehicle.

I am currently trying to figure out a workaround. Maybe you have a good idea.

Domsall avatar Jul 14 '22 14:07 Domsall

There seems to be a misunderstanding somewhere. The problem I observe is this:

  • ego vehicle wants to wait within the intersection but is not supposed to drive beyond the internal waiting position (otherwise it forces oncoming traffic to brake)
  • ego vehicle drives beyond the intended position

There was indeed a problem like this for IDM but I fixed it in #8577 (01b45590ca3ab6ac11c814c1b21f95346fbb9747). When I change EIDM to IDM in the abovbe test, it's working fine. If you have a test case where IDM is having collisions, please attach it.

My suggestion for EIDM would be to reduce the driving error / increase driving precision in EIDM::stopSpeed when the speed and remaining gap are low.

namdre avatar Jul 14 '22 15:07 namdre

sorry for the confusion. The scenario I mean: issue11183.zip

The point I wanted to make: I need to do a few more tests, because this is a model dependent issue, not really a bug. I think the solution is to change the respectMinGap variable to always be false. But this may result in oscillating accelerations (division with two small values). I think your last comment is the way to solve it.

My suggestion for EIDM would be to reduce the driving error / increase driving precision in EIDM::stopSpeed when the speed and remaining gap are low.

Domsall avatar Jul 14 '22 15:07 Domsall

This could be a question for Treiber and Helbing :)

I think the solution is to change the respectMinGap variable to always be false.

With respectMinGap, there is no certainty that the vehicle stops at minGap.

Domsall avatar Jul 14 '22 16:07 Domsall

I think the solution is to change the respectMinGap variable to always be false.

respectMinGap is currently false in the context EIDM::stopSpeed and yet this method is causing the problem. I contrast, slightly violating minGap isn't really a problem in followSpeed since you can set collisionMinGapFactor < 1 (IDM and EIDM set it to 0.5). The precision requirement is much higher in stopSpeed.

namdre avatar Jul 14 '22 16:07 namdre

The problem with the current IDM model (and supposedly inherited by EIDM) is that the minGap violation increases the lower myAccel becomes. I'm thinking Treiber and Helbing never intended the value of myAccel to be very low.

see more analysis on this in #11199

I think this problem is somewhat independent of the EIDM-stopSpeed-precision problem.

namdre avatar Jul 14 '22 19:07 namdre