Search code examples
veins

direction of sending message ( veins /omnet++)


Is there a possibility to define the direction of sending a message?? for example, the sender vehicle wants to send a message only to the vehicle behind? I thought of using Directional antennas; I found this function :

double Antenna::getGain(Coord ownPos, Coord ownOrient, Coord otherPos)

But i don't know how to use it. would you give me a hand please?


Solution

  • You can find an explanation of antenna patterns on http://veins.car2x.org/documentation/modules/#antennas - in brief: *.**.nic.phy80211p.antenna defines which antenna to use (see https://github.com/sommer/veins/blob/veins-5.2/examples/veins/omnetpp.ini#L86). The example simulation uses a monopole antenna defined in https://github.com/sommer/veins/blob/veins-5.2/examples/veins/antenna.xml#L35. It is of type SampledAntenna1D, which means that it defines an antenna pattern using a single parameter, samples, which stores a series of gain samples, taken at equidistant intervals from 0 degrees, going clockwise.

    The following is an example XML statement configuring such an antenna using very coarse (four) gain samples (+2.0 dBi to the front of the car, +1.1 dBi to the right of the car, -4.0 dBi to the back of the car, +0.9 dBi to the left of the car).

    <Antenna type="SampledAntenna1D" id="patch">
      <parameter name="samples" type="string" value="2.0 1.1 -4.0 0.9"/>
    </Antenna>