UNOFFICIAL
Thanks Jakob,
I can add a poi using traci.poi.add(poiId, x,y, rgb).
I simulate and can see the poi in the list in the gui (although even if I change its size or colour I cannot see it visually on the
map), and the location is correct.
I can see all the vehicles in the UI.
I can get all vehicles positions using traci.vehcile.getIDList() to confirm everything is there.
I try to get results using:
def run():
poiId = “555”
traci.poi.add(poiId, x,y, rgb)
traci.simulation.subscribeContext(poiId, traci.constants.CMD_GET_VEHICLE_VARIABLE, 50)
while traci.simulation.getMinExpectedNumber() > 0:
traci.simulationStep()
result = traci.simulation.getContextSubscriptionResults(poiId)
etc..
But result, its always empty.
Cheers
Chris
From: sumo-dev <sumo-dev-bounces@xxxxxxxxxxx>
On Behalf Of Jakob Erdmann
Sent: Friday, 5 March 2021 5:55 PM
To: sumo developer discussions <sumo-dev@xxxxxxxxxxx>
Subject: Re: [sumo-dev] How to query for vehicle in a radius around a location [SEC=UNOFFICIAL]
⚠ EXTERNAL
EMAIL: Do not click any links or open any attachments unless you trust the sender and know the content is safe.
⚠.
Indirectly, yes. You can define a point-of-interest at the given location (traci.poi.add) and then perform a context subscription around that object.