sisl / AutomotiveDrivingModels.jl

Driving simulation architecture for Julia
Other
63 stars 29 forks source link

driving off roadway #40

Open mattuntergassmair opened 4 years ago

mattuntergassmair commented 4 years ago

In the current implementation, when a vehicle drives off the beginning or the end of a roadway, it is projected to the beginning / end of it. (roadways.jl line 676). I don't think this is the best default behavior, and also it is inconsistent with situations where the vehicle leaves the road on the side (which is currently allowed afaik). It may be worth discussing the alternatives: Option A: always clipping vehicles to stay on the road (longitudinally and laterally) Option B: throwing an error when a vehicle leaves the road, since the environment there is not defined Option C: allowing vehicles to leave the road (longitudinally and laterally) by also allowing Frenet coordinates that lie off the roadway

The current clipping behavior (option A) gave me some unexpected results from the simulator and it took me a while to find the source of the error, which is why I'm opening this issue. Also, I can't think of a use-case where such clipping could actually be useful (especially in longitudinal direction).

Throwing an error (option B) may be a little strict but would encourage to design driving models which avoid such driving behavior in the first place.

Allowing off-road coordinates (option C, which is the status-quo in the lateral direction) is the least intrusive solution but it raises the question what vehicles are doing off the road in the first place. Also, a projection of Frenet coordinates outside of the road is not well defined.

Would be interested in other people's views on this or additional options I have not considered yet.

wbrannon commented 4 years ago

An idea that comes to mind is to define a "shoulder" on the road? This would be most in line with option C, and it is most representative with what we actually see in reality. If my understanding of the situation is correct, I believe this would indeed require projecting Frenet coordinates off of the main road. If that is not an option, then I can agree with option B most.