Direction of a node

78 views
Skip to first unread message

Domenico Daniele Celsa

unread,
May 13, 2014, 12:11:03 PM5/13/14
to omn...@googlegroups.com
Hi all,
i have to get informations by a received packet, only if the sender is moving in my same direction, otherwise i will drop it.

How can i get the direction?? the methods for lane and road that i see are not enough to figure out the direction.. 

Daniele.

Alfonso Ariza Quintana

unread,
May 13, 2014, 12:50:36 PM5/13/14
to omn...@googlegroups.com

In inet or mixim?

In inet the controlInfo associated to the packet has the info

--
You received this message because you are subscribed to the Google Groups "omnetpp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Domenico Daniele Celsa

unread,
May 13, 2014, 4:30:05 PM5/13/14
to omn...@googlegroups.com
Sorry for few informations..mixim..

Alfonso Ariza Quintana

unread,
May 14, 2014, 4:12:16 AM5/14/14
to omn...@googlegroups.com

In this case, unfortunately,  I can’t help you, I know how this address is available in inet-framework.

--

Domenico Daniele Celsa

unread,
May 14, 2014, 7:57:33 AM5/14/14
to omn...@googlegroups.com
OK thanks anyway for the interest..
Nobody else knows how to get this value? is it possible in mixim we can't get it..?
I think it is possible for sure..


Il giorno martedì 13 maggio 2014 19:11:03 UTC+3, Domenico Daniele Celsa ha scritto:

Michael Kirsche

unread,
May 14, 2014, 8:26:12 AM5/14/14
to omn...@googlegroups.com
If you are using the current MiXiM version, then mobility models should be included by an INET stub.
So eventually, you might already use CircleMobility or MassMobility models, correct?

Then Alfonso's way of getting the angle for INET is exactly what you need.

Alfonso Ariza Quintana

unread,
May 14, 2014, 8:58:02 AM5/14/14
to omn...@googlegroups.com

In inet it is possible with this

Coord coord = MobilityAccess().get()->getCurrentSpeed();

double angle = atan(coord.y/coord.x);

 

 

De: omn...@googlegroups.com [mailto:omn...@googlegroups.com] En nombre de Michael Kirsche
Enviado el: miércoles, 14 de mayo de 2014 14:26
Para: omn...@googlegroups.com
Asunto: [Omnetpp-l] Re: Direction of a node

 

If you are using the current MiXiM version, then mobility models should be included by an INET stub.

--

Domenico Daniele Celsa

unread,
May 14, 2014, 10:19:40 AM5/14/14
to omn...@googlegroups.com
Dear Michael ,
actually i'm using TraciMobility, do you think i have to use Circle or Mass Mobility to get the direction? Or maybe angle..

Your method, Alfonso, i think is not related to Inet and so to Circle or Mass, i guess it's just a mathematical calculation which i could use with mixim as well, once i got the speed..
Also i'm not sure angle is the direction, i mean if i have 2 cars in the same road and lane but the road is divided in two pieces like it turns a little bit (there is a bit angle, but the road is the same), and a car is in first piece and the second one in the second piece, i think the angle will be different even if the cars are moving in the same 'direction', because the road has turned.
I mean something like this :  
______
----------  \
           \ \

:)

So i will get 2 different angles and i will think the direction is different but actually they are moving in the same direction
So maybe no way to get the real direction...what do you think?

Daniele


Il giorno martedì 13 maggio 2014 19:11:03 UTC+3, Domenico Daniele Celsa ha scritto:

Christoph Sommer

unread,
May 14, 2014, 10:45:19 AM5/14/14
to omn...@googlegroups.com
Domenico Daniele Celsa wrote:
> How can i get the direction??

Have you considered looking at the source code?

TraCIMobility has a getAngleRad method, documented as follows "returns
angle in rads, 0 being east, with -M_PI <= angle < M_PI". This sounds
like what you want.

The relevant line in the source code is here:

https://github.com/sommer/veins/blob/veins-3a1/src/modules/mobility/traci/TraCIMobility.h#L112


Best,

Christoph

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

Domenico Daniele Celsa

unread,
May 14, 2014, 10:54:27 AM5/14/14
to omn...@googlegroups.com
Ok thanks i got how to get the angle, even if i'm not sure it is what i need as direction, as i said in the last message, when the road is not straight.
But i will do some tests.

Daniele

Il giorno martedì 13 maggio 2014 19:11:03 UTC+3, Domenico Daniele Celsa ha scritto:

Domenico Daniele Celsa

unread,
May 14, 2014, 10:59:10 AM5/14/14
to omn...@googlegroups.com
Have you taken a look at my question about RSSI? that one is really more important.
Thanks in advance.

Daniele

Il giorno martedì 13 maggio 2014 19:11:03 UTC+3, Domenico Daniele Celsa ha scritto:
Reply all
Reply to author
Forward
0 new messages