Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Causing right of way violations in junctions #8205

Closed
MarcelLanger opened this issue Feb 8, 2021 · 7 comments
Closed

Causing right of way violations in junctions #8205

MarcelLanger opened this issue Feb 8, 2021 · 7 comments

Comments

@MarcelLanger
Copy link

Hi Sumo team,

I have been looking for a way to cause vehicles to violate the right of way inside a junction. I am familar with the safety parameters jmDriveAfterRedTime and jmIgnoreFoeProb and just came across the new addition of the jmIgnoreJunctionFoeProb. What I would like to do is to use TraCI to trigger a specific vehicle to overlook one other vehicle during its entire crossing of a junction or until the error is reset via TraCI. If I understand correctly the jmIgnoreFoeProb will be applied on each simulation step which could make the selected vehicle overlook different foes during each simulation step. However, overlooking one foe while being aware of one or multiple other foes the entire time, seems to me like the best way to implement a right of way violation resulting from a perception error. Setting the speed mode to disregard the right of way at intersections will (to the best of my knowledge) cause the vehicle to possibly crash into vehicles queueing or waiting inside the intersection which seems less realistic than overlooking a single vehicle.

Do you have a suggestion on how I would cause the overlooking or could this functionality be added to the junction model or in the perception error modeling in the Driver State? If so, would it further be possible to specify the direction from which a foe should be overlooked? This would allow me to trigger overlooking of an oncoming vehicle when turning left with a different probability than overlooking of a vehicle crossing from left to right or vice versa.

Looking forward to your reply!

Thank you and best regards,
Marcel

@namdre
Copy link
Contributor

namdre commented Feb 9, 2021

I agree that overlooking a specific foe or direction while being aware of all others consistently would be useful.
My first idea would be to extend the traci API.
However I'm unsure what a useful API method should look like:

  1. setting a list of vehicle ids to be ignored
  2. setting a list of link indices to be ignored
  3. setting an angular range to be ignored

Either of the above with an extra probability value?

Methods 1 and 2 may require extensive pre-processing to figure out which vehicles / links to actually ignore while method 3 seems more generic but you might still run into problems when a given angular range includes "normal" leader vehicles and oncoming vehicles.

I'm even less sure how this could be usefully added to the driver state or junction model.

@behrisch any thoughts?

@MarcelLanger
Copy link
Author

Thank you for the fast reply!

To me, your suggestions 1. and 2. sound most promising. The first suggestion would allow me to do exactly what I want at the cost of extensive computing effort during the simulation. While this gives me as a user all the freedom, I suppose it would create too much overhead. For my specific application I accually parse the sumo map anyways and can easily create a dataframe/dict/list that contains all foe-links for a specific link of the junction. From these I could select one link and set this to be ignored via the command you are suggesting in 2.. I of course understand that this may not be the case for all users and may therefore not be the prefered solution. However, this would be preferable in my opinion as the calculation must be done only once before the simulation and not in every simulation step.

I just looked into TraCI value retrieval for edges, lanes and junctions. In my opinion the existing possibilities allow for very nice applications of your suggestion 2.:

  • Edge or Lane Value Retrieval: last step vehicle number or last step occupancy combine very well with 2. because a simple "If LastStepVehicleNumber <= 1: IgnoreLink" or "If LastStepMeanSpeed >= 5m/s: IgnoreLink" would stop vehicles from running into multiple queueing or waiting vehicles on the foe link
  • The information "has approaching foe" from "TraCI/Lane Value Retrieval" would allow you to trigger errors specifically when foes are approaching
  • "TraCI/Lane Value Retrieval" has an option "getFoes" which (if I understand correctly) makes pre-processing of the map obsoltete since you can just call this for every link before the first simulation step and create the connection of links to foes

From what I found in the documentation, I feel your suggestion 2. would make a lot of sense for my application - if you find a useful way to implement it.

Sorry for the second wall of text. ;)

Thanks,
Marcel

@behrisch behrisch added this to the 1.9.0 milestone Feb 9, 2021
@behrisch behrisch modified the milestones: 1.9.0, 1.11.0 Apr 13, 2021
@MarcelLanger
Copy link
Author

Hi, would it be possible to prioritize this ticket in the near future? I would really like to use the functionality for my current scientific work.

@namdre namdre modified the milestones: 1.11.0, 1.10.0 Apr 14, 2021
@namdre
Copy link
Contributor

namdre commented Apr 16, 2021

After thinking about this some more, I'm leaning towards solution 1 since it's the most generic. If you are able build a map of directions (link indices) to be ignored it should be trivial to obtain the ids of vehicles that approach the junction via those links or passing the junction via those links. Also, I suppose that you would typically need to check the properties of approaching vehicles anyway (larger vehicles are harder to ignore than smaller vehicles) so even if ignorance is mainly a function of direction you still need to retrieve the vehicle id at some point.

Furthermore, the initial use case of ignoring specific vehicles but not others maps much better to vehicle ids (after all, more than one vehicle could approach via the same link index and you may only want to ignore one of them).

@namdre namdre added the a:sumo label Apr 16, 2021
@MarcelLanger
Copy link
Author

Yes, I agree, this would be very straight forward to use.

namdre added a commit that referenced this issue Apr 17, 2021
@namdre namdre closed this as completed in 55c4904 Apr 17, 2021
@namdre
Copy link
Contributor

namdre commented Apr 17, 2021

@MarcelLanger
Copy link
Author

Thank you very much! I will try it out asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants