How to add more RSU node on Veins?

398 views
Skip to first unread message

Hamza Hadi

unread,
Nov 7, 2022, 2:53:24 PM11/7/22
to OMNeT++ Users

I am facing some problems when trying to add more RSU nodes on the veins example code. Here's the code I added in RSUExampleScenario.ned

@display("bgb=706,476");

    submodules:

        rsu[0]: RSU {

            @display("p=327,395;i=veins/sign/yellowdiamond;is=vs");

        }

        rsu[1]: RSU {

                      @display("p=437,244;i=veins/sign/yellowdiamond;is=vs");

        }

}

And

And more codes in .ini

*.rsu[0].mobility.x = 2000

*.rsu[0].mobility.y = 2000

*.rsu[0].mobility.z = 3

*.rsu[1].mobility.x = 1800

*.rsu[1].mobility.y = 1800

*.rsu[1].mobility.z = 2

When I try to start the simulation, error message says

Error: Name 'rsu' is not unique within its component

I'd really appreciate with some help to solve this problem

 

Sanfora R

unread,
Nov 7, 2022, 3:45:23 PM11/7/22
to omn...@googlegroups.com
Dear Hamza,

You just need to make changes in the ini file only 
First of all specify the number of RSUs (*.numberOfRSU=3) and then initialize the RSUs coordinates as mentioned in below picture.

No need to make changes in the ned file.

I hope this helpful.


Thanks . 


--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/7d4a62c4-91a6-4b61-9888-882ee79c377en%40googlegroups.com.
Screenshot_2022-11-07-23-16-43-82_6012fa4d4ddec268fc5c7112cbb265e7.jpg

Hamza Hadi

unread,
Nov 7, 2022, 6:38:06 PM11/7/22
to omn...@googlegroups.com
Dear sanforea,
in ini file, I did it like your suggestions 
*.numberOfRSU = 3

*.rsu[0].mobility.x = 2000
*.rsu[0].mobility.y = 2000
*.rsu[0].mobility.z = 3

*.rsu[1].mobility.x = 2300
*.rsu[1].mobility.y = 2300
*.rsu[1].mobility.z = 3

*.rsu[2].mobility.x = 1000
*.rsu[2].mobility.y = 1000
*.rsu[2].mobility.z = 3

the result stayed the same with one RSU without the change
What is wrong here?? 

Thank  you for your helpful 


Sanfora R

unread,
Nov 8, 2022, 1:12:24 AM11/8/22
to omn...@googlegroups.com
For the ned file you need to identify Rsu:

rsu[numberOfRSU]: RSU{

}

And in the ini file after config as below:

[Config map]

*.manager.launchConfig = xmldoc("../../map.launchd.xml")
*.playgroundSizeX = 2500m
*.playgroundSizeY = 2000m
*.playgroundSizeZ = 50m
**.roiRects = "0,100-2200,2000"#x,y-X,Y
*.numberOfRSU = 3
*.rsu[0].mobility.constraintAreaMaxX = 1800m
*.rsu[0].mobility.constraintAreaMaxY = 2000m
*.rsu[0].mobility.constraintAreaMaxZ = 0m

*.rsu[1].mobility.constraintAreaMaxX = 1500m
*.rsu[1].mobility.constraintAreaMaxY = 2300m
*.rsu[1].mobility.constraintAreaMaxZ = 0m

*.rsu[2].mobility.constraintAreaMaxX = 2000m
*.rsu[2].mobility.constraintAreaMaxY = 2000m
*.rsu[2].mobility.constraintAreaMaxZ = 0m

Alfonso Ariza Quintana

unread,
Nov 8, 2022, 5:31:01 AM11/8/22
to omn...@googlegroups.com

If you want to have N Rsu you define it like an array


    submodules:

        rsu[N]: RSU {

                      @display("p=437,244;i=veins/sign/yellowdiamond;is=vs");

        }



De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de Hamza Hadi <engha...@gmail.com>
Enviado: lunes, 7 de noviembre de 2022 20:53
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: [Omnetpp-l] How to add more RSU node on Veins?
 
--

Sanfora R

unread,
Nov 8, 2022, 11:58:04 AM11/8/22
to omn...@googlegroups.com
import org.car2x.veins.nodes.RSU;
import org.car2x.veins.nodes.Scenario;

network RSUExampleScenario extends Scenario
{
    parameters:
    int numberOfRSU;
    @display("bgb=706,476");

    submodules:
       
       rsu[numberOfRSU]:RSU{
              @display("p=150,140;i=veins/sign/yellowdiamond;is=vs");
       }
}

Hamza Hadi

unread,
Nov 12, 2022, 8:24:43 AM11/12/22
to omn...@googlegroups.com

Ibtissem Nad

unread,
Nov 29, 2022, 12:11:12 PM11/29/22
to omn...@googlegroups.com
Hello hamza and sanfora R,
Please I found some difficulties to add other RSUs in the omnetpp.ini code . 
Can you help me.

Alfonso Ariza Quintana

unread,
Nov 29, 2022, 12:24:35 PM11/29/22
to omn...@googlegroups.com
You need to add in the ned file, not in the ini file

De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de Ibtissem Nad <ibtiss...@gmail.com>
Enviado: martes, 29 de noviembre de 2022 18:10
Para: omn...@googlegroups.com <omn...@googlegroups.com>
Asunto: Re: [Omnetpp-l] How to add more RSU node on Veins?
 
Reply all
Reply to author
Forward
0 new messages