Dear Yiqun
For obtaining the leader ID and the distance you have to change your
command as follows:
[leaderID, range]=traci.vehicle.getLeader('ego',1000)
Best Regards.
2017-06-13 8:22 GMT-05:00 Jakob Erdmann <[email protected]>:
> Hello,
> i'm not sure if the getLeader function is fully implemented in
> traci4matlab. It should return two values (string and float).
> Maybe Andres (the developer of traci4matlab) can help with this.
> regards,
> Jakob
>
> 2017-06-13 13:13 GMT+02:00 Yiqun Xia <[email protected]>:
>
>> Hi Jakob,
>>
>>
>> thank you for your advice. I have tried the following code in MatLab, but
>> only get the vehicle ID, there is no distance data at all, could you tell
>> me how could I get the distance between the ego vehicle and the leading
>> vehicle?
>>
>>
>> range=traci.vehicle.getLeader('ego',1000)
>>
>>
>> what I got in command window is only:
>>
>>
>> range =
>> flow1.11
>> range =
>> flow3.7
>> range =
>> flow3.7
>>
>> ....
>>
>>
>> I could not find any distance.
>>
>>
>>
>>
>> *Mit freundlichen Grüßen*
>> *Yiqun Xia*
>>
>>
>>
>> ------------------------------
>> *From:* Jakob Erdmann <[email protected]>
>> *Sent:* 12 June 2017 15:40
>> *To:* Yiqun Xia
>> *Cc:* [email protected]
>> *Subject:* Re: [sumo-user] How to extract the Time-to-Collision
>>
>> Hello,
>> using traci you can call vehicle.getLeader() which gives the leader
>> vehicle and the distance (see http://sumo.dlr.de/wiki/TraCI/
>> Vehicle_Value_Retrieval#Extended_retrieval_messages).
>>
>> TraCI/Vehicle Value Retrieval - Sumo
>> <http://sumo.dlr.de/wiki/TraCI/Vehicle_Value_Retrieval#Extended_retrieval_messages>
>> sumo.dlr.de
>> Overview Retrievable Vehicle Variables; Variable ValueType Description
>> Python Method; id list (0x00) stringList Returns a list of ids of all
>> vehicles currently ...
>>
>>
>>
>> regards,
>> Jakob
>>
>> 2017-06-12 15:18 GMT+02:00 Yiqun Xia <[email protected]>:
>>
>>> Hi there,
>>>
>>>
>>> I'm using a self-defined map, which consists of many edges with
>>> different number of lanes. Could you give me some advice on how to extract
>>> the time-to-collison data regarding one specific ego vehicle. Since the
>>> edges are usually not straigt lines, and the lane IDs are also always
>>> changing, it's not easy to get know the leading vehicle ID regarding the
>>> ego-vehicle at each time step (see figure below). Is there any direct and
>>> easier way to extract the time-to-collison or the range data? I'm thinking
>>> about using the x-y coordinate information to get the distance, but then
>>> it's still unknown whether the two vehicles are on the same lane or not,
>>> since the lane ID changes with the number of lanes. Thank you in advance.
>>>
>>>
>>> [cid:073facc4-9982-4dcc-bcec-0ad3e20f40d3]
>>>
>>>
>>>
>>> Best regards
>>>
>>> Yiqun
>>>
>>> Mit freundlichen Grüßen
>>> Yiqun
>>>
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> sumo-user mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/sumo-user
>>>
>>>
>>
>
--
Andres Felipe Acosta Gil, MSc student - Software developer
Universidad Nacional de Colombia - Medellín
Facultad de Minas
Tel: +57 (4) 4255092
Institutional e-mail: [email protected]
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user