Hi there,
I am using the Flow toolbox and SUMO for the purposes of reinforcement learning
driving policies. Previous users have published the same error message of a
vehicle not being known but I am unsure if we have the same root cause.
Context:
I am navigating an RL vehicle through intersections created with Neteditor. I
have set --colision.action to "warn" and --collision.check-junctions to "true."
I am using Flow created inflows() to randomly inject vehicles from on certain
road edges that approach the intersection. After a collision occurs, the
environment resets and this seems to be where the errors are published by SUMO
but at this point it's not clear to me if there's some lag in outputting or
printing the error in the terminal.
I detect collisions by checking if
len(self.k.kernel_api.simulation.getSubscriptionResults()[129]) > 0 within the
env.step() function.
The output here: {116: (), 122: (), 118: (), 112: 15700, 123: 0.1, 113: 0, 115:
0, 121: 0, 120: (), 119: 0, 129: ('flow_0.1', 'rl_0'), 128: 2} where 129
indicates vehicles that collided together.
This sends the code to env.reset(). I can confirm that the following IDs are in
the kernel at the time of collision using self.k.kernel_api.vehicle.getIDList():
output: ('flow_0.1', 'flow_0.2', 'flow_1.1', 'rl_0')
In env.reset(), I remove the vehicles in the kernel using
self.k.vehicle.remove(veh_id) for every actor ID seen in the above list.
I can confirm self.k.kernel_api.vehicle.getIDList() returns an empty list. I
also checked the following traci.vehicle internal fields which are empty:
__ids: []
__vehicles: OrderedDict()
__sumo_obs: {}
__human_ds: []
__controlled_ids: []
__controlled_lc_ids: []
__rl_ids: []
I can confirm that 'flow_0.1' and 'rl_0' are not in the kernel again by
catching exceptions to self.k.vehicle.get_position(veh_id) as well. Next, I
reset traci and re-add vehicles in my initial configuration. Now, I confirm the
vehicles are loaded.
I then run self.k.simulation.simulation_step() and confirm that the vehicles
are introduced into the kernel via self.k.kernel_api.vehicle.getIDList() (they
are also in the GUI). However, it seems that inside this simulation_step()
command or before, the following is printed out:
Error: Answered with error to command 0xa4: Vehicle 'flow_0.1' is not known.
Error: Answered with error to command 0xa4: Vehicle 'rl_0' is not known.
Error: Answered with error to command 0xa4: Vehicle 'flow_0.1' is not known.
This is strange because I can confirm that the 'rl_0' vehicle is in the kernel
and that 'flow_0.1' is not by using getPosition() or other getter functions. It
appears that this error message is not problematic because the end result of my
reset() function is correct, it has the vehicles at the designated states, but
I am confused as to why this is happening.
Also, if I use a different collision checking function routine that "catches"
collisions before SUMO does, this never happens. Is this expected behavior? I
am wondering if there's some SUMO collision behavior that may be responsible
for this or perhaps I am using something incorrectly. Any help would be greatly
appreciated!
Best,
Daniel
Nothing in this message is intended to constitute an electronic signature
unless a specific statement to the contrary is included in this message.
Confidentiality Note: This message is intended only for the person or entity to
which it is addressed. It may contain confidential and/or privileged material.
Any review, transmission, dissemination or other use, or taking of any action
in reliance upon this message by persons or entities other than the intended
recipient is prohibited and may be unlawful. If you received this message in
error, please contact the sender and delete it from your computer.
Nothing in this message is intended to constitute an electronic signature
unless a specific statement to the contrary is included in this message.
Confidentiality Note: This message is intended only for the person or entity to
which it is addressed. It may contain confidential and/or privileged material.
Any review, transmission, dissemination or other use, or taking of any action
in reliance upon this message by persons or entities other than the intended
recipient is prohibited and may be unlawful. If you received this message in
error, please contact the sender and delete it from your computer.
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user