Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] SUMO crashing when an added vehicle exits

This is related to your route definition. If you want to reuse a route outside a flow, better define it outside the flow, assign it an ID and refer to that ID in the flow or when adding a vehicle by TraCI. You can find an example of such a route definition here.

 

Best regards

Mirko

 

 

 

 

-----Original-Nachricht-----

Betreff: [sumo-user] SUMO crashing when an added vehicle exits

Datum: 2023-09-09T12:17:26+0200

Von: "Didac Busquets via sumo-user" <sumo-user@xxxxxxxxxxx>

An: "sumo-user@xxxxxxxxxxx" <sumo-user@xxxxxxxxxxx>

 

 

 

Hi,
 
I have a simple TraCI scripts that add a vehicle to a network composed of a single long link.
 
The vehicle is added correctly, but when that vehicle reaches the end of the link, SUMO crashes. 
 
The script is as follows (also attached, with the rest of the required network and config files).
 
Why is it crashing?     
 
import traci
 
sumo_binary = "sumo"
sumo_cmd = [sumo_binary, "-c", "single_highway.sumocfg"]
 
traci.start(sumo_cmd)
step = 0
route_id = "!type1"
 
while step < 300:
    traci.simulationStep()
    if step == 50:
        print(f"Adding vehicle at {step} route {route_id}")
        traci.vehicle.add(vehID="added_vehicle",
                          routeID=route_id)
        traci.vehicle.setColor(vehID="added_vehicle", color=(255,0,0))
    step += 1
 
traci.close()
The error when crashing is:
 
Traceback (most recent call last):
  File "/home/didac/development/SUMO/networks/single_highway/run.py", line 12, in <module>
    traci.simulationStep()
  File "/home/didac/development/sumo-1.2.0/tools/traci/__init__.py", line 126, in simulationStep
    responses = _connections[""].simulationStep(step)
  File "/home/didac/development/sumo-1.2.0/tools/traci/connection.py", line 329, in simulationStep
    result = self._sendExact()
  File "/home/didac/development/sumo-1.2.0/tools/traci/connection.py", line 105, in _sendExact
    raise FatalTraCIError("connection closed by SUMO")
traci.exceptions.FatalTraCIError: connection closed by SUMO
(notebooks-env) didac@didac-Precision-5530:~/development/SUM
 
 
Regards,
 
   Didac
 
 

Twitter  Facebook  LinkedIn 

Didac Busquets, PhD Chief Scientist and co-founder
didac.busquets@xxxxxxxxxx


Sign up to our newsletter here

www.immense.ai

Personal data: emails, by default, contain basic personal data and are not necessarily secure. If, in answering this email, you provide additional personal information, we will process that information for the purposes for which you have supplied it and as set out in our Privacy Policy, which also contains information about your rights.

This communication, and the information it contains, is (a) intended for the person(s) and/or organisation(s) to whom it is addressed and is for no other person(s) or organisation(s) and (b) may be confidential, legally privileged and protected by law, including law of copyright. Unauthorised use, copying, forwarding or disclosure of any of it may be unlawful. If you have received this communication in error, please contact us immediately at privacy@xxxxxxxxxx.

Immense Simulations Barcelona SL, ES B67427807, C/Corsega, 299, 6e, 08008 Barcelona, Spain is a subsidiary of Immense Simulations Limited, a limited company registered in England and Wales with registered number 09782647,
and registered address at International House, 36-38 Cornhill, London, England, EC3V 3NG..

 

 

 

 



Back to the top