Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
FatalTraCIError on traci.person.getPosition() #5674
The "problem" is that sometimes a person's id is returned before its
while traci.simulation.getMinExpectedNumber() > 0: traci.simulationStep() people = traci.person.getIDList() for person in people: print('stage', traci.person.getStage(person)) # the following throws traci.exceptions.FatalTraCIError if stage == 5: print('position', traci.person.getPosition(person))
I don't know if there is a reason for
Is the stage check something we are supposed to do? I didn't find any documentation about this.
It seems that the error is raised by
As it can be seem
How to reproduce
Using traci_pedestrian_crossing demo
while traci.simulation.getMinExpectedNumber() > 0: traci.simulationStep() people = traci.person.getIDList() print(people) if len(people) > 0: print(traci.person.getPosition(people))
Run the script:
$ python runner.py --no-gui Loading configuration... done. Success. Retrying in 1 seconds Loading configuration... done. ***Starting server on port 59523 *** Loading net-file from 'data/../pedcrossing.net.xml'... done (15ms). Loading additional-files from 'data/pedcrossing.tll.xml'... done (12ms). Loading done. Simulation version 1.2.0 started with time: 0.00 ('ped0',) Error: Should not get here! Quitting (on error). Traceback (most recent call last): File "runner.py", line 159, in <module> run() File "runner.py", line 76, in run print(traci.person.getPosition(people)) File "/usr/lib/python3.7/site-packages/traci/_person.py", line 65, in getPosition return self._getUniversal(tc.VAR_POSITION, personID) File "/usr/lib/python3.7/site-packages/traci/domain.py", line 115, in _getUniversal self._cmdGetID, varID, objectID) File "/usr/lib/python3.7/site-packages/traci/connection.py", line 134, in _sendReadOneStringCmd return self._checkResult(cmdID, varID, objID) File "/usr/lib/python3.7/site-packages/traci/connection.py", line 162, in _checkResult result = self._sendExact() File "/usr/lib/python3.7/site-packages/traci/connection.py", line 105, in _sendExact raise FatalTraCIError("connection closed by SUMO") traci.exceptions.FatalTraCIError: connection closed by SUMO
Using the zipped project
@namdre I thought it was redundant given that all the information is now in the person trip or rather the stop should be added once the trip is resolved into a plan (if it is still necessary then). I would rather consider the visibility of a person in TraCI before depart a bug (Is this true for vehicles as well)?
With the current architecture, the fact that a person has not departed, is deduced from it being in stage WAITING_FOR_DEPART (libsumo/Person.cpp:60).
Undeparted vehicles are also not included in getIDList. However, they can still be the subject of commands such as moveTo which can be used to force them into the network.