Plexe

The Platooning Extension for Veins.

Plexe Examples - Implementing a Maneuver

This quick tutorial assumes that you already have installed Plexe and all the required software following the instruction inside the building section. After doing so, please set up the environmental variables by running the following

1 2
cd ~/src/plexe . ./setenv

Description

The third example shows how plexe can be used to implement a join 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/src/plexe 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.
  • traffic/JoinTrafficManager.*: a traffic manager that extends the PlatoonsTrafficManager class to insert one platoon and an additional lone vehicle (the joiner).

At the end of the page, you also find a brief description of the merge maneuver.

Running the example

The example is located in the ~/src/plexe/examples/joinManeuver folder and has two different runs. One run uses the default CACC parameter (i.e., \(\xi = 1\) and \(\omega_n = 0.2\)), while the second uses \(\xi = 2\) and \(\omega_n = 1.0\). To run the two examples type

1 2 3
cd ~/src/plexe/examples/joinManeuver plexe_run -u Cmdenv -c JoinManeuverNoGui -r 0 plexe_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 genmakefile.py 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 \(\xi = 2\) and \(\omega_n = 1.0\), 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.

Merge maneuver

Starting from Plexe 3.0, the framework implements a sample merge maneuver between two platoons. The main files implementing such maneuver are:

  • apps/GeneralPlatooningApp.*: the same as for the join maneuver.
  • maneuver/MergeAtBack.*: the implementation of the merge at back maneuver, invoked by the GeneralPlatooningApp application.
  • scenarios/MergeManeuverScenario.*: the scenario that triggers the start of the maneuver for the leader of the second platoon.
  • traffic/PlatoonsTrafficManager.*: this is the standard Plexe traffic manager, which is configured (through omnetpp.ini) to spawn two platoons made by two vehicles each which will then merge into a single one.

Running merge

The example is located in the ~/src/plexe/examples/joinManeuver folder and has two different runs. One run uses the default CACC parameter (i.e., \(\xi = 1\) and \(\omega_n = 0.2\)), while the second uses \(\xi = 2\) and \(\omega_n = 1.0\), exactly as in the join maneuver. To run the first example inside the SUMO GUI to see the maneuver, run the following command:

1 2
cd ~/src/plexe/examples/joinManeuver plexe_run -u Cmdenv -c MergeManeuver -r 0