Which of the Veins version uses vehicle to vehicle communication (car) only without RSU. The current veins uses RSU, any way to remove RSU and use V2V (CAR) only.
Many thanks
How to add and remove modules from a simulation is documented in the user manual and the topic of lesson one in the tic toc tutorial. From a quick look at the top level .ned file of the simulation you should also see the line where the RSU is instantiated. Simply delete this line.
Related
I've got the Veins example simulation up and running (on the preset Erlangen map), and also the Veins_Inet subproject functions as it should (a square track with 3 nodes and signal broadcasts between each upon accident). What I would like to do is to retain the initial Veins example simulation, but use the VeinsInetCar module as nodes such that instead of AirFrames being exchanges upon an accident, they exchange a signal broadcast as in the Veins_Inet example.
I thought it probably easiest to alter the Veins folder to make this happen, so I have allowed it import from other projects if referenced and added in the VeinsInetCar module and imported this instead of the Car module in all the relevant files. Moreover, I have added in the setup lines in the omnetpp.ini file to include the wlan implementations. I have included the RadioMedium in the Scenario module and included an integrated visualiser in the omnetpp.ini file. I run the simulation which doesn't complain, but the simulation looks exactly the same. How do I achieve what I want?
I am trying to implement a VANET model for smart parking simulations. Trying to fully understand the TraCIDemo11pp.cc and files relevant to it and its proving quite difficult to get my head around the general structure of each module and the communications between them despite understanding the TicToc tutorial.
I understand how SUMO and OMNETPP are run in parallel, TraCIScenarioManager from OMNETPP communicates with the TraCI server in order to exchange information to SUMO etc. But I'm finding it hard to get my head around how the TraCIDemoApp is utilised.
The question is quite specific, but hoping an answer to it would let me figure out the rest. Any help would be appreciated!
Thanks,
Wesley
Veins comes with a very small demo example in the city of Erlangen:
Vehicles start at the parking lot of the university and drive to a location off-sight. After some time the first vehicle (node[0]) emulates an accident and stops driving. Therefore, it broadcasts this information which gets re-distributed via the RSU to all other vehicles in range. They, in turn, try to use an alternative route to their destination while re-broadcasting the information about the accident. Thus, newly spawned vehicles also get informed and immediately try to choose a different route to the destination.
All of this (i.e. accident, broadcasting, switching route) is implemented in the TraCIDemo* files which represent a VANET application running in a car or RSU utilizing the NIC (i.e. PHY & MAC) to do communication. See what policy is based vehicle rerouting in case of accident? for more information.
handleParkingUpdate() is used to react to a vehicle having switched it's state from driving to parking or vice versa. Depending on the current state and whether parked cars should be allowed to communicate in the simulation this method registers the vehicle's NIC module at the BaseConnectionManager which is involved in handling the actual wireless communication. For more details see this module or follow a packet from one application layer to another (i.e. twice through the networking stack and the wireless transmission).
I am currently using SUMO-0.19.0 veins-3.0 and OMNet++-4.6.
I have been doing research online about how to change the vehicle's speed through the ini file in OMNet, my goal is to test how different vehicle speed can affect the broadcast. I am able to change the broadcast interval using iteration, and I am able to change the vehicle speed in the .rou file and .net file one at a time.
However, my problem is I want to use iteration in OMNet++ ini file to change the vehicle speed and acceleration to accelerate the simulation process, but I don't know how.
I have checked the link https://groups.google.com/forum/#!topic/omnetpp/Cy1Slhx9h1U, but I still don't know where to use setSpeed, not to mention how to use iteration on changing the vehicle speed.
Thank you in advance.
To have runs with different vehicle speeds it is best to configure a run for every needed speed in SUMO.
To do this you have to create additional .rou.xml files with various speeds. How this can be achieved is described in detail in the SUMO Wiki. Basically, every .rou.xml has to have its own value for maxSpeed.
Afterwards make sure to load the correct .sumo.cfg via the .launchd.xmlin your omnetpp.ini. You can configure OMNeT++ to make a run for various configurations as shown in the OMNeT++ Manual.
in my opinion the speed of the vehicles could be changed from the .net.xml file. the only problem is you have to change the speed separately for all the vehicles. the easiest way for that could be changing the speed of the group of vehicles like a group of cars have been classified as , u can replace the speed with any speed of your choice.
If you are using traci interface, you can set any individualy vehicle speed from the next timestep using the command
traci.vehicle.setSpeed(vehId, desiredspeed)
I am using Veins to implement a scenario in which I shall update a vehicle's route every time step characterized by the step selfmsg. In which module shall I find this behavior? I want to add some more functions to this module in the application layer by extending it. Is it possible to do that?
You can take advantage of the fact that SUMO updates the positions of all vehicles at exactly the same time. By extension, Veins (I am assuming you are using version 4a2) will update the OMNeT++ positions of all vehicles at exactly the same time. See the Veins tutorial demo application for how to execute code whenever the position changes. Indeed, this will make sure that all code is running within in a single OMNeT++ event, which seems to be what you want.
I want to transmit a given car's vehicular data such as it's vType, instantaneous speed and position to a RSU in a scenario in Veins.
How can I obtain the data from SUMO and send it through MiXiM methods to an RSU node?
To achieve your goal you have to use the TraCIMobility component of Veins.
You can do that by first getting a pointer to that component in the initialize() method of your node
cModule *tmpMobility = getParentModule()->getSubmodule("veinsmobility");
mobility = dynamic_cast<Veins::TraCIMobility*>(tmpMobility);
ASSERT(mobility);
Once you have the mobility component you can query it for various data.
The type of data that it can provide can be found in TraCIMobility.h
For example in your case you could do:
mobility->getCurrentSpeed().length()); /* will provide velocity vector */
mobility->getAngleRad()); /* will provide angle of movement */
Then you can attach this data to your message and send it to the RSU of your choice.
If this exact solution does not work for you that could be due to me using a different Veins version than yours.
However you will certainly find what you need in TraCIDemo11p.cc or TraCIDemoRSU.cc of your Veins project.
Also, TraCICommandInterface is something you should have a look at.
In the official Veins website under the Documentation section it is said:
Application modules can use the TraCICommandInterface class and
related classes, conveniently accessible from TraCIMobility, to
interact with the running simulation. The following example shows how
to make a vehicle aware of slow traffic on a road called Second
Street, potentially causing it to change its route to avoid this road.
mobility = TraCIMobilityAccess().get(getParentModule());
traci = mobility->getCommandInterface();
traciVehicle = mobility->getVehicleCommandInterface();
traciVehicle->changeRoute("Second Street", 3600);
Some of the other vehicle related commands are setSpeed or setParking.
Similar methods are available for the whole simulation (e.g.,
addVehicle, addPolygon), roads (getMeanSpeed), individual lanes
(getShape), traffic lights (setProgram), polygons (setShape), points
of interest, junctions, routes, vehicle types, or the graphical user
interface.
How to use these modules is demonstrated in the source code of the
Veins tutorial example. Again, a list of all 80+ available methods can
be found in TraCICommandInterface.h or the autogenerated module
documentation.
A potentially related question/answer here: https://stackoverflow.com/a/29918148/4786271