Coordinates x and y of a vehicle in Omnet+SUMO simulation using VEINS

1,621 views
Skip to first unread message

Rayane Sibaï

unread,
Nov 25, 2014, 10:02:32 AM11/25/14
to omn...@googlegroups.com
Hello,
In the results of the simulation in OMNeT + sumo using Veins3a3, a vehicle has such position: startPos (616.75,48.45,0) direction (6.12303e-017,1,0). however, in my network, the maximum value of x 500m and for y is 300m. My question is how to know the true position (x and y coordinates of the vehicle) at a precise moment.
Thank in advance

Christoph Sommer

unread,
Nov 25, 2014, 1:40:44 PM11/25/14
to omn...@googlegroups.com
Rayane Sibaï wrote:
> a vehicle has such position: startPos (616.75,48.45,0) direction
> (6.12303e-017,1,0). however, in my network, the maximum value of x 500m
> and for y is 300m. My question is how to know the true position

This is a frequently asked question.

Please have a look at the FAQ on
http://veins.car2x.org/documentation/faq/

Best,

Christoph

--
Dr. Christoph Sommer
Distributed Embedded Systems Group
University of Paderborn, Germany
http://www.ccs-labs.org/~sommer/

Rayane Sibaï

unread,
Nov 26, 2014, 3:24:41 AM11/26/14
to
Dear Christoph,
I already read the answer in the FAQ (the answer to the question "Why are the coordinates returned by Traci methods different from the ones I see in the GUI?"), and I understood why I get these values, but I did not understand how I can get the true coordinates of a vehicle at specific time.
I would be grateful for your help!

Christoph Sommer

unread,
Nov 26, 2014, 4:11:36 AM11/26/14
to omn...@googlegroups.com
Rayane Sibaï wrote:
> I already read the answer in the FAQ[...], but I did
> not understand how I can get the true coordinates of a vehicle at some
> point.

The answer is actually below this question: The Veins TraCI modules
transparently perform this transformation (using internal methods
omnet2traci and traci2omnet).
Message has been deleted

Rayane Sibaï

unread,
Nov 27, 2014, 7:16:01 AM11/27/14
to omn...@googlegroups.com
Dear Christoph,

I use this formula to find the coordinates of each vehicle at a specific time, but, what is the value of the margin?

new coord (x, y) : [ (x + netbounds1.x - margin) , ( ( netbounds2.y - netbounds1.y ) - (y - netbounds1.y ) + margin ) ) ]

where netbounds1 . x = Min (playground size. x)
and netbounds1 . y = Min (playground size. y)
and netbounds2 . x = Max (playground size.x)
and netbounds2 . y = Max (playground size.y)

Thanks,

Christoph Sommer

unread,
Nov 28, 2014, 4:42:59 PM11/28/14
to omn...@googlegroups.com
Rayane Sibaï wrote:
> I use this formula to find the coordinates of each vehicle at a specific
> time, but, what is the value of the margin?

Just use the methods omnet2traci and traci2omnet. They are designed to
do exactly what you want.

h rahmatzehi

unread,
Jul 15, 2017, 10:54:30 AM7/15/17
to OMNeT++ Users
Hi Dear Sommer,

I found junctions with this code in veins4.4
traci->getJunctionIds()
How can I find these junctions' position?


در شنبه 29 نوامبر 2014، ساعت 1:12:59 (UTC+3:30)، Christoph Sommer نوشته:

Pradeep kumar Jha

unread,
Feb 25, 2020, 12:37:51 AM2/25/20
to OMNeT++ Users
Dear Christoph
I am working to find out ,given a Coordinates I have to detect  if the Coordinate  lies within Eavesdropper zone or not. I am not able to know if I can get the center position of a given Eavesdropper. Getting the center position of Eavesdropper will solve my problem.
I would be very grateful if you can provide me as to which file to explore .
Reply all
Reply to author
Forward
0 new messages