Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] traci vehicle subscription filter

Hello all,

I have a problem with using traci vehicle subscription filters in python. I am subscribing to the host car and using a Lane filter to filter out the traffic objects in specific lanes. Basically I want to filter out all other vehicles except for the ones in host car's lane and its left and right neighboring lanes. I used the following code for this purpose:

    traci.vehicle.subscribeContext('10001',tc.CMD_GET_VEHICLE_VARIABLE,0.0,[tc.VAR_POSITION3D,
    tc.VAR_SPEED,tc.VAR_ANGLE])
   
    traci.vehicle.addSubscriptionFilterLanes([-1,0,1], noOpposite=False, downstreamDist=200.0,
    upstreamDist=20.0)

As per the documentation, 0 and -1 are the lane indices of the Ego car and its right neighboring lane. As for the left neighboring lane I used '1' as Lane index. This is where the problem is occurring. I am getting the subscription results of the traffic objects in Ego car and its right neighboring lane, but not from the left neighboring lane. The attached image shows one such situation where the subscription results of the car in the opposite lane is also getting filtered out by the Lane filter.

How do I get the subscription result of the traffic object on the opposite lane (left neighboring lane) as well?

Thank you and regards,
Shreevatsa

Attachment: Screenshot (24).png
Description: PNG image


Back to the top