inet + traci + sumo vehicle name

549 views
Skip to first unread message

jp...@njit.edu

unread,
Oct 14, 2012, 3:32:59 PM10/14/12
to omn...@googlegroups.com
Hi omentpp experts,
 
     I am using inet+traci+sumo to develop a V2V project.
     I just started to learn and try to follow TraCIDemo example.
     My I ask if there is a way to get the vehicle's name in traci.
     For example,  when TraCIDemo app recieves the positionupdate signal, and call function handlePositionUpdate(),  what is the method to get the current vehicle's name.
     The routes of the vehicles are defined in routes.rou.xml file. It looks as below:
     ......
     <vehicle id="Flow 1-353" type="Default" depart="0.00" color="0.42,0.26,0.58">
        <route color="0.42,0.26,0.58" edges="83700099#0 83700099#1 83700099#2 83700099#3 108179442#1 108179442#2 108179442#3 108179442#4"/>
    </vehicle>
    <vehicle id="Flow 1-356" type="Default" depart="0.00" color="0.42,0.26,0.58">
       <route color="0.42,0.26,0.58" edges="5676865#0 5676865#1 5676865#2 5676865#3 108179452#1 108179452#2 108179452#3"/>
    </vehicle>
    .......
 
     Thanks for your time in advance.
 
Susan
 

Christoph Sommer

unread,
Oct 15, 2012, 1:06:41 PM10/15/12
to omn...@googlegroups.com
Dear Susan,

jp...@njit.edu wrote:
> My I ask if there is a way to get the vehicle's name in traci.

sure, this is already implemented as a method of TraCIMobility. The demo
should explain how to get a pointer to that module and call methods there.

Cheers,

Christoph

--
Dr.-Ing. Christoph Sommer
Institute of Computer Science
University of Innsbruck, Austria
Phone: +43 512 507-53285 / Fax: -53079
http://ccs.uibk.ac.at/~sommer/

jp...@njit.edu

unread,
Oct 15, 2012, 1:55:22 PM10/15/12
to omn...@googlegroups.com, christop...@uibk.ac.at
Hi Christoph,
 
     I saw getExternalId(), which is the method I need.
     Thanks for your help. 
     
Susan

Dalen

unread,
Jan 14, 2016, 2:58:09 AM1/14/16
to omn...@googlegroups.com, christop...@uibk.ac.at
Hello,

I'm facing the same problem as you before.
I need to get the vehicles id from sumo for my omnet++ simulation.
Can you give it in detail how to use getExternalId() function ?
where should I add the code and how ?

Thank you!
Message has been deleted

h rahmatzehi

unread,
Jul 15, 2017, 12:12:26 PM7/15/17
to OMNeT++ Users, christop...@uibk.ac.at
Hi dear sommer,

I want to get vehicle's id ,in veins 3 getExternalId is worked.but I used veins4.4
how can I get vehicles id in veins 4.4
also I want to get jnction's position ,how can I do this in veins 4.4

with the best.
hana

در دوشنبه 15 اکتبر 2012، ساعت 20:36:41 (UTC+3:30)، Christoph Sommer نوشته:
Reply all
Reply to author
Forward
0 new messages