HighwayEnv icon indicating copy to clipboard operation
HighwayEnv copied to clipboard

IDMVehicles easily get stuck facing obstacles

Open ningwak opened this issue 2 years ago • 3 comments

When the road is crowded, in a merging scenario an IDMVehicle can easily get stuck in front of the obstacle, unable to do anything. The vehicle behind it behaves the same. QQ截图20220118155505 Please ignore the "ego vehicle", I put it there fixed just to view a fixed area. It seems that we can't define a merging lane that merges smoothly with the main road. If we simply draw two overlapping lanes, the vehicles will consider staying in their own lane safe, ignoring the risk of colliding with vehicles from the interfering lane.

ningwak avatar Jan 18 '22 14:01 ningwak

That is strange, the MOBIL model should allow them to change lane if there is no vehicle incoming in the other lane, since it would provide a gain in acceleration. I wonder that's going on...

eleurent avatar Jan 18 '22 21:01 eleurent

About the stuck vehicle: I think it may be because of this line: https://github.com/eleurent/highway-env/blob/9d63973da854584fe51b00ccee7b24b1bf031418/highway_env/vehicle/behavior.py#L110

In the original MOBIL model, lane changes are instantaneous. In this project however, that is not the case, and while a lane change is occurring I decided that vehicles look at both the current and target lane and select the most conservative acceleration. But in this situation where a vehicle is stuck in front of an obstacle, the acceleration associated with the current lane is 0, which means it will not move even if the other lane is free. Maybe it would make more sense to only consider the target lane, as if the lane change had already happened. You can try this by replacing the line above by: action['acceleration'] = target_idm_acceleration

About lanes that merge smoothly in the main road: it should be possible to do so, and vehicle that are located in the overlapping part should be detected by vehicles on both lanes. However, the IDM model does not contain any mechanism for a vehicle to anticipate collisions that may occur with other cars that are not located on its current lane. That would probably require a more sophisticated look-ahead planning behavior.

eleurent avatar Jan 18 '22 22:01 eleurent

About the stuck vehicle: I think it may be because of this line:

https://github.com/eleurent/highway-env/blob/9d63973da854584fe51b00ccee7b24b1bf031418/highway_env/vehicle/behavior.py#L110

In the original MOBIL model, lane changes are instantaneous. In this project however, that is not the case, and while a lane change is occurring I decided that vehicles look at both the current and target lane and select the most conservative acceleration. But in this situation where a vehicle is stuck in front of an obstacle, the acceleration associated with the current lane is 0, which means it will not move even if the other lane is free. Maybe it would make more sense to only consider the target lane, as if the lane change had already happened. You can try this by replacing the line above by: action['acceleration'] = target_idm_acceleration

About lanes that merge smoothly in the main road: it should be possible to do so, and vehicle that are located in the overlapping part should be detected by vehicles on both lanes. However, the IDM model does not contain any mechanism for a vehicle to anticipate collisions that may occur with other cars that are not located on its current lane. That would probably require a more sophisticated look-ahead planning behavior.

Thank you very much for this tip! After making this modification, with appropriate desired distance setting the vehicle facing an obstacle can finally change to the next lane. I will continue looking into the mobil model to make the behavior more realistic.

ningwak avatar Jan 19 '22 14:01 ningwak