HighwayEnv icon indicating copy to clipboard operation
HighwayEnv copied to clipboard

How to get the front and rear vehicles of ego-vehicle ?

Open tingtingLiuLiu opened this issue 4 years ago • 2 comments

How to get the front and rear vehicles of ego-vehicle if they are in different lanes of the road in roundabout env? For example, the ego vehicle is on a straight lane, and the preceding vehicle is on a connected circular lane.I called your neighbor_vehicles(), but the results are inconsistent when verified in simulation, I'm a little confused So,thanks for your reply.

tingtingLiuLiu avatar Mar 23 '22 10:03 tingtingLiuLiu

Hi, This is a tricky question whenever we are dealing with a road network more complicated than a straight road (topogically). For example, if two lanes are merging into the ego-vehicle lane, how should we define the following vehicle? Is it V1 or V2? Similarly, if the ego-vehicle's lane is splitting in two, which vehicle is the preceding one, V3 or V4?

V1 --          -- V3
      \      /
       --EV--         
      /      \ 
V2 --          -- V4

I chose the simple heuristic to project every vehicle on the current vehicle lane and pick the closest, and it works fine most of the time but can easily fail in more complex situations. If you have any better idea I'm happy to hear your suggestions.

eleurent avatar Mar 23 '22 22:03 eleurent

I am very happy to receive your reply! Can you elaborate on how to project each vehicle onto the ego_vehicle's lane?

tingtingLiuLiu avatar Mar 24 '22 05:03 tingtingLiuLiu