riebl / artery

OMNeT++ V2X simulation framework for ETSI ITS-G5
GNU General Public License v2.0
202 stars 128 forks source link

Regarding creating a new service to stationary nodes(rsu) #337

Closed Chiqq closed 2 months ago

Chiqq commented 2 months ago

Hi! !

I'm recently trying to create a custom service with my own scenario. Thanks to the documentations on the official website and example scenarios, I am currently be able to create new service to vehicle nodes. However, when it comes to stationary nodes, I will encounter the following error:

(NED module type "RSUService" not found (fully qualified type name expected) -- in module (artery::StationaryMiddleware) World.rsuRSU_0.middleware (id=34), at t=0.548813502304s, event #2) question1

Here's my service setting:

  1. Create the stationary points with RSUs.xml

    <RSUs>
    <rsu id="RSU_0" positionX="103.0" positionY="100.0">
    <antenna direction="-1.5707963267948966"/>
    <antenna direction="0"/>
    </rsu>
    </RSUs>
  2. Define separate rsuservices.xml

    <?xml version="1.0" encoding="utf-8"?>
    <services>
    <service type="RSUService">
        <listener port="8001" />
    </service>
    </services>

    The RSUService.ned/.h/.cc are all located in the same scenario folder.

  3. Set service.xml in omnetpp.ini

    
    *.staticNodes.nodes = xmldoc("RSUs.xml")
    *.node[*].middleware.services = xmldoc("services.xml")

.rsu.middleware.datetime = "2018-03-19 10:00:00" .rsu.middleware.services = xmldoc("rsuservices.xml")

The vehicle nodes will use the services.xml which is separate with rsuservice.xml

4. Following the guideline to create the CMakeLists.txt

add_artery_feature(junctionservice VehicleService.cc RSUService.cc) generate_opp_message(Blockagestatus.msg TARGET junctionservice DIRECTORY junctionservice_msgs) add_opp_run(junctiontest CONFIG omnetpp.ini)



If I use services from application directory such as RsuCaService in the rsuservice.xml, there'll be no problem. So, I'm wondering that maybe something wrong with the CMakelist that it didn't account my RSUService.xml for stationary nodes. 

Could anybody help me?
Chiqq commented 2 months ago

Hi! !

I'm recently trying to create a custom service with my own scenario. Thanks to the documentations on the official website and example scenarios, I am currently be able to create new service to vehicle nodes. However, when it comes to stationary nodes, I will encounter the following error:

(NED module type "RSUService" not found (fully qualified type name expected) -- in module (artery::StationaryMiddleware) World.rsuRSU_0.middleware (id=34), at t=0.548813502304s, event #2) question1

Here's my service setting:

  1. Create the stationary points with RSUs.xml
<RSUs>
<rsu id="RSU_0" positionX="103.0" positionY="100.0">
    <antenna direction="-1.5707963267948966"/>
    <antenna direction="0"/>
</rsu>
</RSUs>
  1. Define separate rsuservices.xml
<?xml version="1.0" encoding="utf-8"?>
<services>
  <service type="RSUService">
      <listener port="8001" />
  </service>
</services>

The RSUService.ned/.h/.cc are all located in the same scenario folder.

  1. Set service.xml in omnetpp.ini
*.staticNodes.nodes = xmldoc("RSUs.xml")
*.node[*].middleware.services = xmldoc("services.xml")

*.rsu*.middleware.datetime = "2018-03-19 10:00:00"
*.rsu*.middleware.services = xmldoc("rsuservices.xml")

The vehicle nodes will use the services.xml which is separate with rsuservice.xml

  1. Following the guideline to create the CMakeLists.txt
add_artery_feature(junctionservice VehicleService.cc RSUService.cc)
generate_opp_message(Blockagestatus.msg TARGET junctionservice DIRECTORY junctionservice_msgs)
add_opp_run(junctiontest CONFIG omnetpp.ini)

If I use services from application directory such as RsuCaService in the rsuservice.xml, there'll be no problem. So, I'm wondering that maybe something wrong with the CMakelist that it didn't account my RSUService.xml for stationary nodes.

Could anybody help me?

I now change the run setting in CMakelist.txt to: ''' add_opp_run(junctiontest NED_FOLDERS ${CMAKE_CURRENT_SOURCE_DIR} CONFIG omnetpp.ini) ''' Got no more error described above. Is this solution right?

riebl commented 2 months ago

Yes, the location of your new NED files needs to be included so OMNeT++ finds them during runtime.

Chiqq commented 2 months ago

Thank you very much for the reply and your time!!