Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Field of vision filter for context subscription

Hello,

I have a question related to this item of field of vision. Currently, the opening angle is oriented in alignment with the vehicle headway. Is it possible to set multiple opening angles for the same vehicle and oriented according to different axes (front, left, right and behind)?

Best regards,

Le dim. 10 janv. 2021 à 22:36, Yasmina Jaafra <yasmina.jaafra@xxxxxxxxx> a écrit :

Hello Jakob

Thank you for your reply and availability. I keep this procedure for future issues. Indeed I tried the code below and the filter is working successfully:


subscribed = False

if subscribed:

        for v in sorted(traci.vehicle.getContextSubscriptionResults(str(rl_id)) or []):

               near1.add(v)

if not subscribed:

         traci.vehicle.subscribeContext(str(rl_id), traci.constants.CMD_GET_VEHICLE_VARIABLE, 50, [traci.constants.VAR_POSITION])

         traci.vehicle.addSubscriptionFilterFieldOfVision(90)

         subscribed = True


Best regards,


Le dim. 10 janv. 2021 à 11:10, Jakob Erdmann <namdre.sumo@xxxxxxxxx> a écrit :
Please provide all simulation input files along with a log of the traci commands (https://sumo.dlr.de/docs/TraCI/Interfacing_TraCI_from_Python.html#generating_a_log_of_all_traci_commands)

Am Fr., 8. Jan. 2021 um 13:49 Uhr schrieb Yasmina Jaafra <yasmina.jaafra@xxxxxxxxx>:
Hello Jakob,

I tried other filters addSubscriptionFilterUpstreamDistance and addSubscriptionFilterDownstreamDistance. Similarly there is no update on the initial context.
The filters are not working but there are no errors in the execution and I have the correct radius range.
Did I miss something?

Thank you in advance.

Le ven. 8 janv. 2021 à 14:51, Yasmina Jaafra <yasmina.jaafra@xxxxxxxxx> a écrit :
Hello,

Here attached a doc with the 2 screenshots: Sumo Gui and results.

Best regards,

Le ven. 8 janv. 2021 à 05:44, Jakob Erdmann <namdre.sumo@xxxxxxxxx> a écrit :
the image attachments are missing

Am Fr., 8. Jan. 2021 um 10:27 Uhr schrieb Yasmina Jaafra <yasmina.jaafra@xxxxxxxxx>:

Hello Jakob

Thank you for the reply. I’m using the right methods.

traci.subscribeContext(str(rl_id), tc.CMD_GET_VEHICLE_VARIABLE , 50, [tc.VAR_SPEED, tc.VAR_POSITION])

traci.addSubscriptionFilterFieldOfVision(10)

print(self.k.vehicle.getContextSubscriptionResults(str(rl_id))

Below an invalid example, rl_id is the red car (rl_0):

image.png

 In both cases (with or without addSubscriptionFilterFieldOfVision(10) function) I have the same result:

image.png

 Shouldn’t sumo at least ignore the exo vehicles behind the ego ?


Le ven. 8 janv. 2021 à 09:31, Jakob Erdmann <namdre.sumo@xxxxxxxxx> a écrit :
the methods are called
subscribeContext rather than subscribe_context and
addSubscriptionFilterFieldOfVision rather than add_filter_field_vision

I can confirm that the fieldOfVision filter is used with an opening angle in degrees and that it affects the context subscription results in our tests as expected.
If you can provide a minimal reproducable example of invalid filter results I will take a look.

Am Fr., 8. Jan. 2021 um 00:13 Uhr schrieb Yasmina Jaafra <yasmina.jaafra@xxxxxxxxx>:

Hello,

I am using context subscription to limit the ego vehicle perception. The application looks fine and I assume that the defined zone is a circular area which center is the ego and radius is the indicated distance argument. I tried to apply a field of vision filter, unfortunately it’s not working. I indicated different opening angles (from 5 to 180), however, the returned result is always the subscription context initial range. I think that the angle would have delimited an area from the circular zone in front of the vehicle. Could you please confirm and check if I set something wrong in the script below.


traci.vehicle.subscribe_context(str(rl_id),  tc.CMD_GET_VEHICLE_VARIABLE ,  50 , [tc.VAR_SPEED, tc.VAR_POSITION])
traci.vehicle.add_filter_field_vision(40)
print(traci.vehicle.get_context_subscription_results(str(rl_id)))


Regards,
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top