Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] TraCI subscriptions to route changes
  • From: Michael Behrisch <oss@xxxxxxxxxxx>
  • Date: Thu, 5 Jul 2018 22:35:47 +0200
  • Autocrypt: addr=oss@xxxxxxxxxxx; prefer-encrypt=mutual; keydata= xsDiBFLSvucRBACGsasS4GeIWs1CFNTOYmp3ScQ2ZTJLJWQxhPliwtHTzLsErYu9Y7e8qDov iHFviYyaNuceUNoACm1e4MT4eu0DmM2Wk3y/jjD6hfm7L0EZNPxQhj+CJf2oZAm2ezCe7/si xZ2d7TCO8yWavOGbF0EVi/ZDIJqVgupu6WBpv/NCewCg65HQiS1wm+1w1MdFYxKCmXzbv08D /iWXX3tzabbCrLlUum8hBgBpJEHRtlic2uaGsKm8Fize4tfLZkTBbTYLYXfcx2Oq9+lINPTW h9jnbCjAjErRWLTjNTQjel0JnDryCnqabub/R3wScR/EHRDBeS9L6YRj0xdVd2qIaArtSYRR auKPNc4M2qZNEFSM37cXC7avhpdeA/99oJf4qyVly4RxHmekAmj9UJjRx17x9xX8t9uzUuSt AeTh+kQ3o5jK7veU6/F/+pPyi96EOzym9BJA8pgXC8hLWNjOajI10filkdQ26QsfHOpUdPSZ 4Duyw9Ayj8loagEnnAONmU/xE0QlyVBANIut0W+SNqPScYXfnBbVOaG3Hc0mTWljaGFlbCBC ZWhyaXNjaCA8bWljaGFlbEBiZWhyaXNjaC5kZT7CZgQTEQIAJgIbIwcLCQgHAwIBBhUIAgkK CwQWAgMBAh4BAheABQJS0sKXAhkBAAoJEDwQ/pbRcKYp+SEAoMJSvUzfk3u6EA1nMlMVSk85 nHhoAJ0VE5xLi2ni8j9wdx+uga7XGLtjhs7ATQRS0r7nEAQAkQLdzlu3i/Ddziadm2c/60ZX bcY3FYhHHfsKUHC/QING+lu3uHG0nPaElPTAHTr8UdFMbmpXkRs9+1v1RAvHBWW95BbUXZeu oBsoCm+4Jdktu+PeVxGKhOwQRdR30A4y/bIeRn7iMzkZKoQh0lE3ZEbs0T8TUHBGBUqwEhIv Y0MAAwUD/RXrkwtUiR61/bT96eMaxGtO15AqvlM8DYQ3Xs6EH09QlGzr/i0+usi01wGoh13p YGjzEDtTqO+lNs9AtS7nZAHA3cCWzLmdEXw6EY7IH4X7zOpKoj+JtLNjUd2Nzvhyl48LT217 g8GmCACL6Wo/G+fZ+30Mny+gWbDtEGXNIv7fwkkEGBECAAkFAlLSvucCGwwACgkQPBD+ltFw pimNZQCgnN5oibnjl7r2SVle6hgUMcckfN4AoMYRjy/Tqz9tq8TSUqNcOTjlMR7D
  • Delivered-to: sumo-user@xxxxxxxxxxx
  • List-archive: <https://dev.eclipse.org/mailman/private/sumo-user>
  • List-help: <mailto:sumo-user-request@eclipse.org?subject=help>
  • List-subscribe: <https://dev.eclipse.org/mailman/listinfo/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://dev.eclipse.org/mailman/options/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=unsubscribe>
  • Openpgp: preference=signencrypt
  • User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

Hi Lara,
it is currently not implemented and at the moment all of the
subscriptions are time triggered and not event based. The easiest way to
get the information without constantly polling is probably to implement
an analogue to simulation.getLoadedIDList for rerouting and subscribe to
that. But this will give you the ids of all rerouted vehicles in every
time step, which may be too much as well.

Best regards,
Michael

Am 05.07.2018 um 10:46 schrieb Lara CODECA:
> Dear all,
> 
> is there a way to subscribe to the route changes events?
> 
> I saw subscribeContext in
> http://www.sumo.dlr.de/daily/pydoc/traci._simulation.html#SimulationDomain-subscribeContext 
> and
> #  command: subscribe route context
> CMD_SUBSCRIBE_ROUTE_CONTEXT = 0x86
> #  response: subscribe route context
> RESPONSE_SUBSCRIBE_ROUTE_CONTEXT = 0x96
> #  command: get route variable
> CMD_GET_ROUTE_VARIABLE = 0xa6
> #  response: get route variable
> RESPONSE_GET_ROUTE_VARIABLE = 0xb6
> #  command: set route variable
> CMD_SET_ROUTE_VARIABLE = 0xc6
> #  command: subscribe route variable
> CMD_SUBSCRIBE_ROUTE_VARIABLE = 0xd6
> #  response: subscribe route variable
> RESPONSE_SUBSCRIBE_ROUTE_VARIABLE = 0xe6
> 
> among the constants, but given that the context requires a radius around a the ego-vehicle, I'm
> probably going in the wrong direction.
> 
> I saw that I can subscribe to traci.vehicle.subscribe(vehid, varIDs=(tc.VAR_ROUTE_INDEX)) but this
> imply I have to see if the route index is different, so I'm jamming TraCI for no reason.
> I need to know when the route of some vehicles is changed by sumo (device router or other). 
> If there is no way to do it, at the moment, where do I have to look in the code to know how to add
> a subscription of this kind?
> 
> Thanks in advance!
> 
> Regards,
> Lara
> 


Attachment: signature.asc
Description: OpenPGP digital signature


Back to the top