Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Loading simulation state fails after collision (stop on lane is not downstream)

Hi everyone

I was running my application and found this error (Sumo version 1.8.0):

"Error: stop for vehicle '-gneE0__gneE3__light.42' on lane ':gneJ0_2_0' is not downstream the current route.
Quitting (on error).
'Connection' object has no attribute '_socket'"


This error occured after loading a state, saved after the following collision:

Step #1830.00
Warning: Vehicle '-gneE0__gneE3__light.42'; collision with vehicle '-gneE2__gneE0__light.46', lane=':gneJ0_2_0', gap=-1.00, time=1830.00 stage=move.




To reproduce the error locally, I loaded the state manually in my machine

Loading through python, I receive pretty much the same error, but for car 46 instead.

Screenshot from 2020-12-18 14-41-30.png

Alternatively, if I try to load it through the sumocfg and sumo-gui, I receive this error:

Screenshot from 2020-12-18 14-41-44.png


sumo files + script attached


Thank you in advance


Sincerely,

Marcelo d'Almeida
import os
import sys

if 'SUMO_HOME' in os.environ:
    tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
    sys.path.append(tools)
else:
    sys.exit("please declare environment variable 'SUMO_HOME'")

import traci
import traci.constants as tc
from sumolib import checkBinary
from os.path import expanduser


home = expanduser("~")

def get_sumo_binary(gui=False):

    if gui:
        sumo_binary = checkBinary('sumo-gui')
    else:
        sumo_binary = checkBinary('sumo')

    return sumo_binary

class Example:

    def __init__(self, net_file, route_file):

        self.net_file = net_file
        self.route_file = route_file

    def start_traci(self, gui=False):
        traci.start([
            get_sumo_binary(gui),
            '-n', self.net_file,
            '-r', self.route_file,
            '--start', str(True),
            '--begin', str(3080),
            #'--load-state', home + '/temp/planning_for_step_1830__previous_phases_None__initial_step_1830__'
            #                       'phase_4__b171d823-7f0d-4a1e-8762-e2ec21aa0019_save_state_1840.0.sbx'
            #'--load-state', home + '/temp/planning_for_step_1830__previous_phases_None__initial_step_1830__'
            #                       'phase_12__9896f538-2fbe-4d7d-a0b3-1f2cbc37a00c_save_state_1840.0.sbx'
            '--load-state', home + '/temp/planning_for_step_1830__previous_phases_None__initial_step_1830__'
                                   'phase_13__96267e52-bd6a-4859-887e-ff366f6958a2_save_state_1840.0.sbx'
        ])

    def run_simulation(self):

        while traci.simulation.getMinExpectedNumber() > 0:
            traci.simulationStep()


net_file = home + '/temp/regular-intersection__right_on_red.net.xml'
route_file = home + '/temp/regular-intersection.rou.xml'

example = Example(net_file, route_file)
example.start_traci(gui=True)
example.run_simulation()
traci.close()

Attachment: temp.zip
Description: Zip archive


Back to the top