crashing / misbehavior in rescue vehicle simulation
We are currently evaluating various options to implement a rescue lane for emergency vehicles, fire brigade vehicles, etc.. Our approach uses sublanes and the Opposite-Direction-Driving.
However, several issues arise:
- Not all emergency vehicles use the lane
- Vehicle collisions occur. This seems to be related to the sublanes
- The sumo-gui sometimes crashes with segfaults (seems to be related to emergency vehicles with blue light) -- The flows need to be included in the example code (intersection.rou.xml)
- Right-of-way rules are still applied when turning, i.e. when turning left, the driver waits until the intersecting lane is clear
It looks like we are overlooking some important configurations and would appreciate the crucial hint.
If possible, upload an example that shows your problem. exampleSetup.zip
SUMO-version: 1.10.0 operating system: MacOS, Debian 10, Ubuntu 20.04.3 LTS
* Vehicle collisions occur. This seems to be related to the sublanes
To be more specific, when using the sublane model, there are collisions between regular vehicles as well as with emergency vehicles, mostly in lateral direction. This happens especially on the junction but seemingly also on regular lanes.
* The sumo-gui sometimes crashes with segfaults (seems to be related to emergency vehicles with blue light) -- The flows need to be included in the example code (intersection.rou.xml)
Regarding the segfault in sumo-gui:
Thread 2 "sumo-gui" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffed72d700 (LWP 73043)]
0x0000555555ccce70 in MSDevice_Bluelight::notifyMove(SUMOTrafficObject&, double, double, double) ()
(gdb) bt
#0 0x0000555555ccce70 in MSDevice_Bluelight::notifyMove(SUMOTrafficObject&, double, double, double) ()
#1 0x0000555555ac1e20 in MSVehicle::workOnMoveReminders(double, double, double) ()
#2 0x0000555555ad7e4e in MSVehicle::executeMove() ()
#3 0x0000555555a39c65 in MSLane::executeMovements(long long) ()
#4 0x00005555558e9fb9 in GUILane::executeMovements(long long) ()
#5 0x0000555555b06004 in MSEdgeControl::executeMovements(long long) ()
#6 0x0000555555a78d2b in MSNet::simulationStep() ()
#7 0x00005555558f4ab5 in GUINet::simulationStep() ()
#8 0x00005555558bee97 in GUIRunThread::makeStep() ()
#9 0x00005555558bf180 in GUIRunThread::run() ()
#10 0x00007ffff77d44f3 in FX::FXThread::execute(void*) () from /usr/lib/x86_64-linux-gnu/libFOX-1.6.so.0
#11 0x00007ffff745c609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#12 0x00007ffff5a99293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Unfortunately, I wasn't able to figure out the exact location of the segfault yet.
It looks like we are overlooking some important configurations and would appreciate the crucial hint.
No. You are using a combination of features that has seen few tests (blue light device with opposite direction driving) and are therefore the first to discover slumbering bugs.
I'm unable to reproduce the crashing (with/without enabled flows) on windows and linux and with 1.10 and the latest dev version. Is the crash tied to any visualization options? How many attempts should I expect before seeing a crash?
I'm unable to reproduce the crashing (with/without enabled flows) on windows and linux and with 1.10 and the latest dev version. Is the crash tied to any visualization options? How many attempts should I expect before seeing a crash?
Indeed, in this scenario we cannot reproduce the bug either. We will open another issue for this segfault as soon as we can isolate a scenario.
It looks like we are overlooking some important configurations and would appreciate the crucial hint.
No. You are using a combination of features that has seen few tests (blue light device with opposite direction driving) and are therefore the first to discover slumbering bugs.
Can you have a quick look at the configuration parameters of the emergency vehicles and whether they make sense? We figured that some parts of the unexpected behavior might come from incorrect parameter values.
Regarding collisions: When you enable (only) the 4 car flows (intersection.rou.xml), set the probability of each flow to 0.25 (our original values), and remove the first traffic light phase (intersection.net.xml), which is only red, we get with the current main branch (ffb35d6d2fa43fd11c951bf2ad2b182c8e4f2428):
Vehicle 'from_west.29'; junction collision with vehicle 'from_east.37', lane=':junc4_17_1', gap=-1.00', latGap=0.00, time=246.00 stage=move.
This is, of course, not related to emergency vehicles as such, but we noticed this during our simulations. Perhaps this also results in collisions with emergency vehicles.
Can you have a quick look at the configuration parameters of the emergency vehicles and whether they make sense? We figured that some parts of the unexpected behavior might come from incorrect parameter values.
The parameters are ok.
The junction collision is an instance of #4397. A simple workaround is to move the waiting position for the left turns (internal junction) back by 0.5m by setting connection attribute 'contPos' for that movement.
I was able to reproduce the segfault with the given scenario: Again (1) enable the 4 car flows (intersection.rou.xml), (2) set the probability of each flow to 0.25, (3) and remove the first traffic light phase (intersection.net.xml), which is only red, (4) remove the individual cars. Then I get:
gdb --args sumo-gui -c intersection.sumocfg
Thread 2 "sumo-gui" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffed737700 (LWP 120810)]
0x0000555555cf1ff0 in MSDevice_Bluelight::notifyMove(SUMOTrafficObject&, double, double, double) ()
(gdb) bt
#0 0x0000555555cf1ff0 in MSDevice_Bluelight::notifyMove(SUMOTrafficObject&, double, double, double) ()
#1 0x0000555555ae0807 in MSVehicle::workOnMoveReminders(double, double, double) ()
#2 0x0000555555af6ff4 in MSVehicle::executeMove() ()
#3 0x0000555555a55447 in MSLane::executeMovements(long long) ()
#4 0x00005555558f62a9 in GUILane::executeMovements(long long) ()
#5 0x0000555555b24bd4 in MSEdgeControl::executeMovements(long long) ()
#6 0x0000555555a96a20 in MSNet::simulationStep() ()
#7 0x00005555559022e5 in GUINet::simulationStep() ()
#8 0x00005555558c99a7 in GUIRunThread::makeStep() ()
#9 0x00005555558c9c97 in GUIRunThread::run() ()
#10 0x00007ffff77d44f3 in FX::FXThread::execute(void*) () from /usr/lib/x86_64-linux-gnu/libFOX-1.6.so.0
#11 0x00007ffff745c609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#12 0x00007ffff5a99293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
@heinovski Do you still see crashing?
@heinovski Do you still see crashing?
Using the recent version (e45a0e3d1afa9ce72bfdcd5b67f8c60a83a92d1f), the simulation does not crash anymore, but we still see collisions, mainly between emergency vehicles and normal vehicles. Also, the behavior of emergency vehicles is still not as expected (e.g., having the right of way or using the opposite lane).
I added a complete scenario that we are using. It includes the intersection network, car flows, and some emergency vehicles: scenario.zip
Using the latest version (137ee3ceddd3cd87f2a6eaaef9fc07082bfb4b67), the issues unfortunately still persist. There are collisions on the intersection (see below) and the rescue vehicle do not use the opposite lane.
Warning: Vehicle 'from_west.16' performs emergency braking with decel=-9.00 wished=4.50 severity=1.00, time=152.60. Warning: Vehicle 'from_west.16'; junction collision with vehicle 'case_1_engine', lane=':junc4_17_1', gap=-1.00', latGap=0.00, time=152.60 stage=move.
The collision comes down to a lack of lateral spacing while going around the curve. In your test you can work around this by setting lcPushy=0. A possible fix would be to disable pushy behavior automatically when turning at an intersection.
Opposite driving through turns also isn't working but that should be fixable.
The simulation looks much better when increasing the width of the roads to 3.84m (one more sublane)
@heinovski A number of collisions are now fixed via #9919
Since this ticket is growing a bit unwieldy after several iterations of fixes, please open up a new issue with fresh test cases as needed.