Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Context Subscription of a Vehicle to Values of Persons (TraCI API C++)

Hi Jakob,

 

ah, obviously itself is in there always, I was too blind to see that, because I always filtered out the ego vehicle in the results. Still good, if the empty subscription results in a more “forgiving” behavior. Thanks a lot!

 

Jakob

 

Von: sumo-user-bounces@xxxxxxxxxxx [mailto:sumo-user-bounces@xxxxxxxxxxx] Im Auftrag von Jakob Erdmann
Gesendet: Freitag,
5. Januar 2018 10:24
An: Sumo project User discussions <sumo-user@xxxxxxxxxxx>
Betreff: Re: [sumo-user] Context Subscription of a Vehicle to Values of Persons (TraCI API C++)

 

Hello Jakob,

the error was caused when trying to access an empty result (no objects in range). Since a vehicle always has itself in range, the problem never occurred in the first case. It should be fixed in the latest development version 335d5a7.

regards,

Jakob

 

2018-01-05 9:44 GMT+01:00 Kaths, Jakob <jakob.kaths@xxxxxx>:

Hi,

 

I retried with today’s nightly snapshot (0_32_0_+0080-45b239f71c) and get the same behavior, except I can now catch a tcpip::SocketException (somehow didn’t work in my larger code) and avoid the crash.

 

Maybe I got you wrong, but retrieving an empty vehicle subscription works fine and without throwing an exception for me (I used the example you provided with the Python test and with 100m radius, at times there are no vehicles and no persons). When subscribing only to persons though, the exception is thrown as soon as I retrieve the results with “traci.simulation.getContextSubscriptionResults("ego");” when there is no person around.

So to me it seems that

traci.simulation.subscribeContext(CMD_SUBSCRIBE_VEHICLE_CONTEXT, "ego", startTime, endTime, CMD_GET_VEHICLE_VARIABLE, subscription_radius, egoSubscriptionVarsVeh);

and

traci.simulation.subscribeContext(CMD_SUBSCRIBE_VEHICLE_CONTEXT, "ego", startTime, endTime, CMD_GET_PERSON_VARIABLE, subscription_radius, egoSubscriptionVarsPed);

have a different behavior when there are no results. I’m not sure if that’s intended, but it did confuse me since I thought I could just exchange CMD_GET_VEHICLE_VARIABLE by CMD_GET_PERSON_VARIABLE.

 

If you still need them, I would like to provide the stack traces, but I don’t know how to create them unfortunately. Would StackWalker be the right tool?

 

Thanks

 

Jakob

 

 

 

Von: sumo-user-bounces@xxxxxxxxxxx [mailto:sumo-user-bounces@xxxxxxxxxxx] Im Auftrag von Jakob Erdmann
Gesendet: Donnerstag, 4.
Januar 2018 16:28


An: Sumo project User discussions <sumo-user@xxxxxxxxxxx>
Betreff: Re: [sumo-user] Context Subscription of a Vehicle to Values of Persons (TraCI API C++)

 

Possibly you are trying to retrieve context subscription results when there aren't any.  The client throws Exceptions without any error message in this case (helpful messages added in the development version). This was the only way I could reproduce an error.

Please see if you get a better error with the development version. Otherwise I need at least the stack traces from your crash (client and server).

 

regards,

Jakob

 

2018-01-03 17:30 GMT+01:00 Kaths, Jakob <jakob.kaths@xxxxxx>:

Hey,

 

thanks a lot for your answer. I checked the Python example and adapted it to my needs and it worked. I then prepared the minimal example for C++ and while doing that, I think I found the solution. However, I still didn’t fully understand why… Maybe you could give me a little hint, just for understanding. My subscription to both vehicles and persons around a vehicle works fine now. If I only subscribe to persons though, the program crashes straight after starting it. So, if I comment line 66 it crashes (which is what I did in my not-minimal-example and why I asked for help), if I comment line 67 it works and if I don’t comment either of those two lines, it works, too.

 

You can find the cpp-file here:

https://syncandshare.lrz.de/dl/fiWxH8FERhgLwXaDorAyFmW1/SumoConnect.cpp

 

Thanks for the amazing help here!

 

Jakob Kaths

 

 

Von: sumo-user-bounces@xxxxxxxxxxx [mailto:sumo-user-bounces@xxxxxxxxxxx] Im Auftrag von Jakob Erdmann
Gesendet: Mittwoch, 20.
Dezember 2017 09:32
An: Sumo project User discussions <
sumo-user@xxxxxxxxxxx>
Betreff: Re: [sumo-user] Context Subscription of a Vehicle to Values of Persons (TraCI API C++)

 

Hello,

subscribing to persons around an object and subscribing to things around a person should be working. (at least it does in our tests since version 0.31.0).

Can send a small scenario where it fails for you?

regards,

Jakob

 

2017-12-19 17:59 GMT+01:00 Kaths, Jakob <jakob.kaths@xxxxxx>:

Hello!

 

I was wondering if it’s possible to retrieve values of pedestrians in SUMO by subscription. I know, that in Context Subscription in the Wiki (http://sumo.dlr.de/wiki/TraCI/Object_Context_Subscription) pedestrians are not mentioned. However, I found the corresponding value (CMD_GET_PERSON_VARIABLE 0xae) in the TraCIConstants.h and tried to subscribe, but it failed. Is there a possibility to retrieve position, angle, speed etc. from pedestrians via subscription without modelling them as vehicles? If not, is this planned for the future or could you give a hint of how to implement this?

 

Thanks in advance!


Jakob

 

 

--

Dipl.-Ing. Jakob Kaths

 

Technische Universität München
Ingenieurfakultät Bau Geo Umwelt
Lehrstuhl für Verkehrstechnik
jakob.kaths@xxxxxx

 


_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user

 


_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user

 


_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user

 


Back to the top