The Platooning Extension for Veins.

Plexe Examples - Implementing a Maneuver

Note: This tutorial assumes you already cloned the git repositories for running Example 1.


The third example shows how plexe can be used to implement a maneuver. In this case we show a simple example where a platoon of four cars is travelling on the freeway while a fifth requests the leader to join at the tail. The maneuver is very simple and does not consider corner cases, e.g., failures. It is just provided to the user as an example to build upon. The joiner requests the leader to join the platoon and waits for a reply from the leader. The leader approves the join maneuver, replies with a message including information about the platoon (lane, join position, etc.), and waits for the joiner to become closer. The joiner uses such data to come close to the tail of the platoon, moving into the join position. Once in position, i.e., at a negotiated distance from the last car of the platoon, the joiner notifies the leader that it is able to join. The leader sends back a confirmation and the joiner switches to CACC, closing its gap to the predecessor to the platoon inter-car distance.

The source files for this example are (starting from the ~/src/plexe-veins/src/veins/modules/application/platooning folder:

  • apps/GeneralPlatooningApp.*: this is a new application that can be used as a base application that manages different maneuvers.
  • maneuver/JoinAtBack.*: the implementation of the join at back maneuver, invoked by the GeneralPlatooningApp application.
  • scenarios/JoinManeuverScenario.*: the scenario that triggers the start of the maneuver for the joining vehicle.
  • utilities/LocalPlatoonPositionHelper.*: a position helper that is local to each vehicle, i.e., it only has knownledge about the platoon the vehicle is currently in. The information stored in this position helper can be modified at runtime.

Running the example

The example is located in the ~/src/plexe-veins/examples/joinManeuver folder and has two different runs. One run uses the default CACC parameter (i.e., and ), while the second uses and . To run the two examples type

1 2 3
cd ~/src/plexe-veins/examples/joinManeuver ./run -u Cmdenv -c JoinManeuverNoGui -r 0 ./run -u Cmdenv -c JoinManeuverNoGui -r 1

If you want to see the join maneuver, run the simulations removing the NoGui substring. When the simulation terminates, plot the graphs.

Plotting the results

As for the first example, move into the analysis folder, generate the Makefile, and run the R script

1 2 3 4
cd analysis ./ parse-config > Makefile make Rscript plot.R

The script generates the plots describing the dynamics of the simulation in terms of distance, speed, and acceleration of the vehicles. From the plots it is possible to see the evolution in time of the maneuver. The joiner accelerates up to 130 km/h to reach the platoon in front. When coming close (i.e., around 15 m from the tail of the platoon), the joiner slows down and asks the leader a confirmation for joining. The joining vehicles then speeds up a little to close the gap and finally joins the platoon. What it is interesting to notice is the slightly different behavior for different CACC parameters. For the simulation with and , the procedure is faster, as it ends at around 70 s, while in the other case the joiner needs roughly 90 s. However, in the first case the controller is much more aggressive, and even slightly unstable, showing sudden accelerations and decelerations. This shows how the simulator can be used to perform a parameterization study and find the values with the best trade-off between convergence time and driving comfort.

Figure 1. Distance profiles in time.
Figure 2. Speed profiles in time.
Figure 3. Acceleration profiles in time.