riebl / artery

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

artery.mac.MacItsG5; #30

Closed 1140464BV closed 6 years ago

1140464BV commented 6 years ago

As I was trying to implement ITS-G5 stack on top of my project, i ran into this problem. Nic80211pItsG5.ned file as this import of MacItsG5... As i figured out this file has been removed recently form the project 3 months ago... What should be my workaround?

riebl commented 6 years ago

Nic80211pItsG5.ned should have been deleted along with MacItsG5. artery.inet.VanetNic is a full replacement of the old MacItsG5.

1140464BV commented 6 years ago

Thank you for the answer. Quick question, I want to replace a 802.15.4 stack for 802.11p w/ITS-G5 on a project I'm developing. What should be my best approach on using artery source code for this? What radio medium should I been using? Is artery.inet.VanetNic the way to implement a nic for ITS-G5 integration?

riebl commented 6 years ago

I am not sure if I understand you correctly, @1140464BV : Do you want to replace the 802.11 part by a 802.15.4 model? If this is the case and 802.15.4 from INET is to be used: Have a look at artery.inet.Car which employs VanetNic as radio module per default. You can use any other INET IWirelessNic there as well. However, you also need to adapt the particular NIC type by providing a matching RadioDriver. See InetRadioDriver as an example which is wrapping ITS-G5 packets in 802.11 frames.

1140464BV commented 6 years ago

No, sorry for the miscommunication. I have the opposite, I got a project working with a 802.15.4 stack, and want to replace this stack with 802.11p.

riebl commented 6 years ago

Okay, can you explain your actual goal in a little bit more detail? It's a little bit hard to give proper advice otherwise :-)

1140464BV commented 6 years ago

Getting a you quick overview on it. I have a platooning simulation under another simulator that has already a bridge sorted out to a omnet++ one, each omnet++ node "represents" a car in the other simulator. The goal is to get the communication between omnet++ nodes to be done implementing the ITS-G5 stack, the only important message to be sent on a omnet node is a CAM message to be broadcasted to any other node. Hope you understood the main goal.

riebl commented 6 years ago

Those OMNeT++ modules representing vehicles in Artery, e.g. artery.inet.Car communicate via ITS-G5 by default. Attaching artery.application.CaService to each vehicles' middleware enables CAM transmissions among those. Of course, you still may need to adapt your "simulator bridge".

1140464BV commented 6 years ago

Oh, I see... wasn't planning on using artery in such a full extent, but as I can see, using that Car module can be a great approach for my goal. So, into a more simple question, what is the cleanest way to import artery to use it as source code in my project? I'm currently having some issues doing this, I believe i'm not doing it in the most correct way...

riebl commented 6 years ago

Simply clone Artery into your project if you need its source code there. If you need only a loose coupling between your project and Artery, you might want to contribute the necessary Artery changes to this repository and keep both projects separated as well. How to manage the relationship between both projects appropriately depends a little bit on the details, e.g. are both linked together to build a common executable or are they only interacting via some network protocol?

1140464BV commented 6 years ago

I just cloned Artery into my machine, did all the building through your README, tested the example, all with success.

Successfully imported the artery project into omnet++, by:

  cmake /artery/root/dir -G 'Eclipse CDT4 - Unix Makefiles'
  Import -> Select root directory (select directory where you executed step 1) -> Finish

Still, i'm unable to build the project under the Omnet++ IDE.

make[3]: Entering directory '/home/insys/Desktop/Artery/artery' make[3]: Leaving directory '/home/insys/Desktop/Artery/artery' make[3]: No rule to make target 'veins'. Pare. make[2]: [CMakeFiles/build_veins] Error 2 CMakeFiles/build_veins.dir/build.make:57: recipe for target 'CMakeFiles/build_veins' failed make[2]: Leaving directory '/home/insys/Desktop/Artery/artery' CMakeFiles/Makefile2:163: recipe for target 'CMakeFiles/build_veins.dir/all' failed make[1]: * [CMakeFiles/build_veins.dir/all] Error 2 make[1]: * Esperando que outros processos terminem. [ 1%] Building INET (external dependency) Scanning dependencies of target build_vanetza /usr/bin/make inet MODE=release make[2]: Leaving directory '/home/insys/Desktop/Artery/artery' /usr/bin/make -f CMakeFiles/build_vanetza.dir/build.make CMakeFiles/build_vanetza.dir/build make[3]: Entering directory '/home/insys/Desktop/Artery/artery' make[3]: Leaving directory '/home/insys/Desktop/Artery/artery' CMakeFiles/build_inet.dir/build.make:57: recipe for target 'CMakeFiles/build_inet' failed make[2]: Leaving directory '/home/insys/Desktop/Artery/artery' CMakeFiles/Makefile2:131: recipe for target 'CMakeFiles/build_inet.dir/all' failed make[2]: Entering directory '/home/insys/Desktop/Artery/artery' make[3]: No rule to make target 'inet'. Pare. make[2]: [CMakeFiles/build_inet] Error 2 make[1]: [CMakeFiles/build_inet.dir/all] Error 2 [ 2%] Building Vanetza (external dependency) /usr/bin/make vanetza make[3]: No rule to make target 'vanetza'. Pare. make[2]: [CMakeFiles/build_vanetza] Error 2 make[3]: Entering directory '/home/insys/Desktop/Artery/artery' make[1]: *** [CMakeFiles/build_vanetza.dir/all] Error 2 make[3]: Leaving directory '/home/insys/Desktop/Artery/artery' CMakeFiles/build_vanetza.dir/build.make:57: recipe for target 'CMakeFiles/build_vanetza' failed make[2]: Leaving directory '/home/insys/Desktop/Artery/artery' CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/build_vanetza.dir/all' failed

Any idea on what can the problem be? Through this general output I couldn't have any idea on how to solve it...

riebl commented 6 years ago

Looks like this setup has overwritten the original Makefile located in Artery's root directory. Thus, the expected targets "veins", "inet" and "vanetza" are not found in this Makefile anymore. Could you please verify my assumption using git status?

1140464BV commented 6 years ago

Running git status on Artery's root directory :

fatal: Not a git repository: /.../artery/.git/modules/extern/inet

1140464BV commented 6 years ago

When running git status only for the Makefile file, it actually seems there are some changes to it... You reckon I should download again the project and re-do all steps?

m-wegner commented 6 years ago

You should be able to retrieve the original Makefile via git (as seen in message of git status):

git checkout -- Makefile

without the need to re-download the project.

1140464BV commented 6 years ago

The problem on this is that the makefile was generated by:

cmake /artery/root/dir -G 'Eclipse CDT4 - Unix Makefiles'

And, as I guess, this is required for the project to be successfully imported into omnet++. Am I wrong?

riebl commented 6 years ago

@1140464BV You should separate the source and build directories so the generated Makefile (in build directory) does not overwrite the Makefile in Artery's root directory (source directory).

1140464BV commented 6 years ago

I just checked and for some odd reason I have the src directory inside the build one as you mentioned... I'll get this directories started from scratch, what should be my methodology to get artery imported into omnet++ after importing your project through git and building it like your README steps?

Venturina commented 6 years ago

That's no odd behaviour, this directory is expected to be located inside the build directory.

The methodology is just as @riebl suggested:

  1. Create a build which is sibling directory of the source directory (build directories as subdirectories of the source directory seem to be not well supported by Eclipse)
  2. cd into your created build directory and execute cmake (cmake path/to/your/artery)
  3. Generate Eclipse project files in your build directory (eg.: cmake /build/dir -G 'Eclipse CDT4 - Unix Makefiles')
  4. Open the IDE and import the project using your created build folder
  5. Add needed include paths
  6. The project's sources should be found in [Source directory] found in Eclipse's Project Explorer
1140464BV commented 6 years ago

Following your suggested steps, i'm still unable to build the project under omnet++'s IDE:

[ 1%] Building Vanetza (external dependency) /usr/bin/make vanetza [ 1%] Building INET (external dependency) [ 2%] Building Veins (external dependency) make[3]: Entering directory '/home/insys/Desktop/Artery/artery' make[3]: Leaving directory '/home/insys/Desktop/Artery/artery' make[3]: No rule to make target 'vanetza'. Pare. CMakeFiles/build_vanetza.dir/build.make:57: recipe for target 'CMakeFiles/build_vanetza' failed make[2]: [CMakeFiles/build_vanetza] Error 2 make[2]: Leaving directory '/home/insys/Desktop/Artery/artery' make[1]: * [CMakeFiles/build_vanetza.dir/all] Error 2 /usr/bin/make inet MODE=release make[1]: * Esperando que outros processos terminem. CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/build_vanetza.dir/all' failed make[3]: No rule to make target 'inet'. Pare. /usr/bin/make veins MODE=release make[2]: [CMakeFiles/build_inet] Error 2 make[3]: No rule to make target 'veins'. Pare. make[3]: Entering directory '/home/insys/Desktop/Artery/artery' make[2]: [CMakeFiles/build_veins] Error 2 make[3]: Leaving directory '/home/insys/Desktop/Artery/artery' make[1]: [CMakeFiles/build_inet.dir/all] Error 2 CMakeFiles/build_inet.dir/build.make:57: recipe for target 'CMakeFiles/build_inet' failed make[1]: [CMakeFiles/build_veins.dir/all] Error 2 make[3]: Entering directory '/home/insys/Desktop/Artery/artery' make[3]: Leaving directory '/home/insys/Desktop/Artery/artery' make[2]: Leaving directory '/home/insys/Desktop/Artery/artery' CMakeFiles/build_veins.dir/build.make:57: recipe for target 'CMakeFiles/build_veins' failed make[2]: Leaving directory '/home/insys/Desktop/Artery/artery' CMakeFiles/Makefile2:131: recipe for target 'CMakeFiles/build_inet.dir/all' failed CMakeFiles/Makefile2:163: recipe for target 'CMakeFiles/build_veins.dir/all' failed make[2]: Entering directory '/home/insys/Desktop/Artery/artery' make[2]: Nothing to be done for 'src/traci/CMakeFiles/traci.dir/build'. make[2]: Leaving directory '/home/insys/Desktop/Artery/artery' [ 20%] Built target traci make[1]: Leaving directory '/home/insys/Desktop/Artery/artery' Makefile:94: recipe for target 'all' failed make: [all] Error 2

Is this the same as last issue?

Venturina commented 6 years ago

What happens if you cd in your artery source directory and type make vanetza?

1140464BV commented 6 years ago

" make: *** No rule to make target 'vanetza'. "

Even though I was actually able to do it following the README steps...

Venturina commented 6 years ago

Then, you have still changed your Makefiles in your source directory. In which folder are you executing the cmake /build/dir -G 'Eclipse CDT4 - Unix Makefiles'? This must be executed in your created build directory, not in the source directory.

1140464BV commented 6 years ago

That should be the problem. So should I:

cd artery/build cmake . -G 'Eclipse CDT4 - Unix Makefiles'

?

Venturina commented 6 years ago

Yes, that's correct. Like I have indicated step two and three of my list, the Makefiles must be generated in the build directory!

  1. cd into your created build directory and execute cmake (cmake path/to/your/artery)
  2. Generate Eclipse project files in your build directory (eg.: cmake /build/dir -G 'Eclipse CDT4 - Unix Makefiles')
1140464BV commented 6 years ago

I was now, finally able to get the project imported successfully into my omnet++ IDE, thank you.

Regarding now, the use of artery's .ned files on my personal project, knowing i already have both projects imported under omnet++'s IDE what should be my next steps? On my project I have some networks already set up, but want to change them to start using ITS-G5, and most probably would be interested in using artery's Car.ned in this use case.

On another issue i found out running your example, I'll create another topic.