Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Novel one-lane road for both directions, and any workarounds

Hello Jacob,

I've been working for while based on your last suggestion, placing cars as obstacles on one lane and using TraCI to detect when two opposing vehicles are within a range of each other.

1) My current approach is to make a distance matrix between vehicles to know whether car A is within range of car B and then decide which one parks. This relies on each car's current lane and the succeeding lane. Do you recommend using context subscriptions or any other approaches to detect an impending collision?

2) To test out the simplest case, for now my scenario only has 2 opposing vehicles, before moving on to greater complexity. I have vehicles 'Red' and 'Blue'. Red is on the wrong lane which is being blocked by long green vehicles, and Blue is on the natural lane which is unblocked. All attempts to make the vehicles park on the side of the road have failed.

image.png


For some reason, whenever they are in range (150 meters) of each other, the TraCI command to park fails. This is the command I used:

traci.vehicle.setStop(vehID=stopping_vehicleID, edgeID=stopping_vehicleEdge, laneIndex=0, duration=duration, flags=traci.constants.STOP_PARKING)

When I force Red to park on the side of the road, I get an error, whether the stopping edge is the one it is currently on ( '6to1_0' ) or whether it is the neighboring edge ( '1to6_0' ) which is in its route but is of course blocked:

Stop for vehicle 'red' ... is not downstream the current route.

I then tried making Blue the vehicle that always parked, but I got the same type of error even though the lane is within the current route:

route: ['in', '4to5', '5to6', '6to1', '1to2', '2to3', '3to4', 'out']
traci.exceptions.TraCIException: Stop for vehicle 'blue' on lane '5to6_0' is not downstream the current route.


Can you please suggest what is wrong and how I can fix this? Thank you

Below is just raw output from the console.

Traceback (most recent call last):
File "<input>", line 3, in <module>
File "<input>", line 228, in run
File "D:\Program Files\DLR\Sumo\tools\traci\_vehicle.py", line 693, in setStop
self._connection._sendExact()
File "D:\Program Files\DLR\Sumo\tools\traci\connection.py", line 109, in _sendExact
raise TraCIException(prefix[1], _RESULTS[prefix[2]], err)
traci.exceptions.TraCIException: Stop for vehicle 'red' on lane '6to1_0' is not downstream the current route.


stopping_vehicleEdge: 1to6
route: ['in', '4to3', '3to2', '2to1', '1to6', '6to5', '5to4', 'out']
Traceback (most recent call last):
File "<input>", line 24, in <module>
File "<input>", line 205, in run
File "D:\Program Files\DLR\Sumo\tools\traci\_vehicle.py", line 693, in setStop
self._connection._sendExact()
File "D:\Program Files\DLR\Sumo\tools\traci\connection.py", line 109, in _sendExact
raise TraCIException(prefix[1], _RESULTS[prefix[2]], err)
traci.exceptions.TraCIException: Stop for vehicle 'red' on lane '1to6_0' is not downstream the current route.


stopping_vehicleEdge: 5to6
route: ['in', '4to5', '5to6', '6to1', '1to2', '2to3', '3to4', 'out']
lanePos: 534.0311930685754
Traceback (most recent call last):
File "<input>", line 3, in <module>
File "<input>", line 229, in run
File "D:\Program Files\DLR\Sumo\tools\traci\_vehicle.py", line 693, in setStop
self._connection._sendExact()
File "D:\Program Files\DLR\Sumo\tools\traci\connection.py", line 109, in _sendExact
raise TraCIException(prefix[1], _RESULTS[prefix[2]], err)
traci.exceptions.TraCIException: Stop for vehicle 'blue' on lane '5to6_0' is not downstream the current route.



On Mon, May 18, 2020 at 11:29 AM Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:
1) Sorry for that. You also need to set netconvert/netedit option  '--geometry.avoid-overlap false' to make this happen (otherwise netconvert tries it's best to modify geometries and avoid such overlap). In Netedit you can set the option using F10 (see https://sumo.dlr.de/docs/NETEDIT.html#processing_menu_options).

Unfortunately, the latest release of SUMO has a bug where the avoid-overlap setting is lost when re-opening the network in NETEDIT and then saving it again.
The bug is fixed and the nightly development version will be updated tomorrow. Hence, I recommend that you update SUMO tomorrow (https://sumo.dlr.de/docs/Downloads.php#sumo_-_latest_development_version)

2) No. Right now collision checking is not done if you simply put edges on top of each other. However, you could combine my two previous suggestions to get collision detection (collisions are registered on opposite-direction overtaking). To make the visualization look nice, you just have to make the obstacle cars black or transparent.



Am Mo., 18. Mai 2020 um 03:09 Uhr schrieb K M <kadrimufti@xxxxxxxxx>:
Hello all,

Thank you for the great ideas Jakob,

1) Can you please explain what you mean when you say to place the two edges on top of each other with reversed geometries? Do they share the same nodes? (my failed attempts are below)

2) Is a collision supposed to be detected in SUMO GUI with a warning message or something like that in the output?


I attempted your method #2 in two ways. (I also tried simply narrowing the lane width and widening the cars on a regular two-way road, but it seems it's only for visualization; I think it had no effect because I got no message in SUMO GUI of a collision or issue).
  • When any 2 edges (parallel and opposite in direction) were connected to the same 2 nodes, as much as I tried in NetEdit to make the edges overlap, NetEdit automatically changed the Y-coordinates in the shapes of the lanes to make them not overlap. So that did not work.
  • I then made the edges in each direction connected to a different set of nodes (as in the code snippet below), and made the nodes almost fully overlap each other but without them merging. The result was that visually the lanes were above each other, but again SUMO GUI showed no sign of an issue or collision as the vehicles passed through each other and kept going.
image.png

<nodes>
    <node id="1" x="225.20" y="6.55" type="dead_end"/>
    <node id="2" x="105.78" y="1.76" type="priority"/>
    <node id="3" x="-0.74" y="8.28" type="dead_end"/>
    <node id="4" x="-0.47" y="5.09" type="dead_end"/>
    <node id="5" x="105.77" y="3.57" type="priority"/>
    <node id="6" x="225.86" y="3.23" type="dead_end"/>
</nodes>


<edges>
    <edge id="1to2" from="1" to="2" priority="1" numLanes="1" speed="13.89" shape="224.85,1.44 105.78,1.76" spreadType="center"/>
    <edge id="2to3" from="2" to="3" priority="1" numLanes="1" speed="13.89" shape="105.78,1.76 -1.68,3.11" spreadType="center"/>
    <edge id="4to5" from="4" to="5" priority="1" numLanes="1" speed="13.89" shape="-0.48,3.46 105.80,1.92" spreadType="center"/>
    <edge id="5to6" from="5" to="6" priority="1" numLanes="1" speed="13.89" shape="105.77,1.92 225.90,1.59" spreadType="center"/>
</edges>


On Sun, May 17, 2020 at 7:30 PM Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:
Hello,
right now, full bidirectional operation is only possible with trains.
You have two methods to emulate the desired behavior for cars:

  - place lots of standing cars as obstacles on the road. Vehicles will be forced on the opposite side to pass the obstacles.
  - areas without obstacles are the detour locations.

2)
- place two edges going in opposite direction directly on top of each other (i.e. by setting attribute spreadType="center" and giving them the reversed geometry).
- use TraCI to detect dangerous situations
- call vehicle.setStop(...,flags=traci.constants.STOP_PARKING) to clear the road for oncoming traffic and avoid a collision

regards,
Jakob

Am So., 17. Mai 2020 um 03:00 Uhr schrieb K M <kadrimufti@xxxxxxxxx>:
Hello all,

I have a novel situation that I need to model and I would like to know if it is technically possible in SUMO:

I must model a one lane road which operates in both directions, i.e. the road does not have a lane in each direction, it is literally one lane used by vehicles going in opposite directions, obviously towards each other.

(Just for context, the idea is to make the oncoming vehicles somehow (perhaps using TraCI or something) avoid colliding into each other by detecting each other from a distance and then one of them rerouting into a small pit-stop or shoulder or D-tour until it safe to get back on the road and continue moving forward.)

Is it even technically possible to code such a road in SUMO?

Thank you,

Kadri
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top