A few basic things. More tutorials will be added.
Remember that the Veneris framework is made of 3 different tools that can be combined in several ways depending on what you want to do.
It can be done simultaneously, which means that the traffic and network simulation are running
at the same time and synchronize each other and exchange messages over a TCP connection. It is useful if the actions in one
side can have an influence on the other side (e.g., a vehicle stops as a consequence of receiving a network message). In that case,
it is called a bi-directional simulation.
It can also be done separately: first you execute the traffic simulation with Veneris, it creates a .mes
file, and then
that file is used by OMNET++ in the network simulation. In this case, the network events cannot influence the traffic simulation.
It is called a unidirectional simulation.
Since at the moment we do not support bi-directional simulation, the latter is the recommended way.
You can use it as a standalone propagation simulator in C++.
You can use it
directly as a channel medium in OMNET++. In that case, in the .mes
there is also a representation of the buildings in your scenario, that are used to compute the reflections by Opal. You
can decide also to use the Veneris traffic simulation in OMNET++ without Opal, just using one of the propagation models of OMNET, such as Nakagami-m. Or, for instance, you can use the traffic simulation
with and without Opal and compare the results.
It can also be used directly in the Veneris simulation. But in that case, no additional protocol stack is implemented, you can only transmit and get the received power. It is still useful in this way to do electromagnetic characterization. For instance, cellular coverage, you generate an scenario, place a transmitter antenna on top of a building, place a number of receivers and transmit to compute the coverage.
Finally, it could be used in OMNET++ directly without using the traffic simulation, as a channel medium, but then you need to code some things yourself. You have to generate your scenario, save the meshes to files, load then with OMNET++ and use them in your simulation.
.mes
file and provide its path to the OMNET++ configuration modules. Run your OMNET++ simulation and get the results. Follow the steps also in the correspoding tutorial below. If you want to use Opal in the OMNET++ simulation,
configure it accordingly.
tests
folder
in the
Opal repository.
OpalManager
.
You do not need to add the ExternalSim
component. Do not use VenerisOpalManager
here because it defers the Opal initialization to the messages with the server, it is intended to be
used with OMNET. At this point, you need to place your transmitters and receivers with the Unity editor. You need to create your scripts, that use the Opal interface to
transmit and receive, and add them to your transmitters and receivers. Click play and get the results.
To build an scenario Veneris leverages SUMO capabilities for building road networks. It needs the .net.xml
, the .rou.xml
and the .poly.xml
files.
The simplest way is to use the SUMO osmWebWizard or our own modified version in the scenario builder. We are using SUMO 0.32.0 for generating the files. Be aware that using other versions of SUMO may not work because of changes in the XML elements used, that may not be understood by Veneris.
If you use our builder, you will have in addition a JSON version of the SUMO files, calledosm.net.json
, osm.rou.json
and osm.poly.json
.
Veneris > Load SUMO Network in Editor
.
Click on the SumoBuilderOnEditor
component and select the corresponding files. We suggest you tick "Use JSON files" and use the JSON version of the SUMO files. Performance is much better and less prone to XML deserialization errors
After creating the road network, do not forget to click on BuildSumoConnections and Build Global Network Manager buttons. They are necessary to build correctly the routes.
SumoVehicleManager
component, set the vehicle prefab to STDRSCar
. That is the only vehicle prefab that should work correctly at the moment. Set also the Vehicle Prefab Name to "STDRSCar" if you want to use different visuals.
Before starting the simulation you need to add a few more components to your scene. They are Prefabs, so you only have to drag them to your scene tree, that is, drag them from the folder to the Hierarchy tab, on the left, not the Scene tab.
OrbitPanZoomCamera
, FollowVehicleCameraRig
, this would add a couple of cameras. Delete the
default MainCamera
.
Add the SimInformationCanvas
prefab that would add a UI layer to the game. You need also to Create > UI > EventSystem
for the UI to work.
Finally add a SimulationManager
prefab.
veneris.ini
or whatever, but change the corresponding path and name in the SimulationManager component.
In this file add the following lines:
sim-time=-1
no-vehicle-manager=false
output-dir=yourpath
The meaning is more or less obvious, set the maximum simulation time or -1 to let it run until no more vehicles are present, no-vehicle-manager can be used with statically placed vehicles and output-dir is the folder where your results files are saved.
./executableName -nographics -batchmode
Follow the previous tutorial
VenerisOpalManager
and ExternalSim
to your scene. VenerisOpalManager
allows you to set Opal
parameters. If you do not want to use Opal, just keep the defaults. In any case, you can override some parameters with OMNET++ and even force not to use Opal.
In ExternalSim you can set the IP and port of the server or check to serialize messages to a file that can be used later with OMNET++ (unidirectional).
This latter option is the preferred way at the moment. It creates a .mes
file that can be used by OMNET++ to replay your scenario.
Please note that the Unity simulations are not deterministic, due to a number of reasons, in particular due to the physics engine.
It means that if you want to replicate exactly the same traffic simulation but with different parameters, say different propagation models,
you need to use the same .mes file. Otherwise, if you just run the same scenario with Veneris, you end up not using exactly the same traffic simulation results with OMNET++.
STDRSVenerisCar
. Set also the vehicle prefab name to "STDRSVenerisCar" is you want to
use different visuals.
omnetpp.ini
and run the OMNET++ simulator.
Scenes/Validation/Opal/StreetCrossingTestUpdated
Follow the previous tutorial if you want to build an scenario from a OSM map. You can also create your own meshes, with cubes or planes, or whatever, using Unity Create 3D Object.
For all the meshes that you want to send to Opal to participate in the ray tracing you have to add a StaticMesh
component and a OpalMeshProperties
component. The former does not need anything,
but for the latter you have to fill the electromagnetic values of the material. It follows the ITU-R P.2040-1 format and conventions.
If, in addition, you are going to use diffraction with edges, the faceIds have to be filled. It can be done automatically in the Opal > ExtractFaces
menu.
Please. note that all of this is filled automatically if you build the scenario from OSM maps as described in the previous tutorials
So far, only a single diffraction is implemented in the Opal simulation, which means that no high order reflections-diffractions are computed. If you want to use diffraction, you have to add the diffracting edges you want to consider.
You have to add a OpalEdge
component and fill the values with the origin (O), edge vector (v), vectors describing face a (A) and face b (B) and the corresponding normals, as well as the faceId the correspond to.
Due to the involved work, you usually create a Unity script to fill these values.
Please. note that all of this is filled automatically if you build the scenario from OSM maps as described in the previous tutorials
OpalManager
component. With that component you can customize the simulation optios, such as selecting the
type of simulation you want to use:
Antenna
component. There are a few prefabs that can be used under Resources/Prefabs/Communications
.
You can place multiple transmitters and check Use Multitransmitter
in the OpalManager to compute all the transmissions in parallel. It usually gives a little bit more of performance but it is usually simpler
to just use a transmitter and several receivers. In general, you have to provide the code for your transmitter, or, if you just want one transmission, you can call Transmit()
in the Start()
method of
your transmitter. Receivers may be placed by hand or with by creating an appropriate script.
Make sure that you change the id of all transmitters and receivers. Every different antenna must have a different id.
Antenna gain
Antenna gains are provided in files with azimuth x elevation antenna gain values in dB. All the gains used have to be provided to OpalManager
. Then each receiver and transmitter have to select one of the gain files (among the ones provided to OpalManager) and fill the corresponding path.
You can add power loggers to save received power to a file by adding an empty object with a GlobalPowerLogger
script and you can show the rays after transmission with the OpalLogTraceManager
component. Be aware that using log traces with a very high number of rays may hang the Unity editor. You may have millions of ray hits (specially if you use RDN).
When you use a log trace manager you have to select the asset for the RayPrefab as RayRenderer
in Assets (at selection) and you have to select the gameobject that is transmitting in Transmitter, which is just the origin
for the rays that are shown. The E file path is only filled if you use an external trace file.
So far the ray trace log is quite basic. For reflections, it just logs the ray hit points, sorted by number of reflections. For diffractions it is sorted by receiver, transmitter and edge. So there is no filtering by transmitter or
any other fancy function. Even though the trace records multiple transmitters (if present), the GlobalPowerLogger
component only takes one transmitter, so it is better to record traces with only one transmitter (and any
number of receivers, of course).
Copyright Esteban Egea-Lopez - 2019-2021. Last modified: 05-2021