2D Merge (Merge)

This module is the setup for a vehicle dealing with lane-merges. The goal is to quickly move from the leftmost lane to the rightmost lane without crashing into other vehicles.

Note that this setup differs from the 1D-target example in that the demonstrations are provided by the python programs in python-gen (try running merge.py). Demonstrations will be placed into that folder automatically. As a result, the setup does not require filling out robotSets.h, a simulation ASP, a physics model, or their corresponding settings.

Try running the algorithm on the setup (or see snapshots/ for pre-acquired results).

The most useful/informative outputs will be:

We also show the behavior of the synthesized policy directly in the simulator.

Iteration 1:

Iteration 3:

Iteration 8:

We provide the observation model below:

step(action):
    target_acc = 0
    target_heading = 0

    if (action == FASTER)
        target_acc = 45 - v
        target_heading = atan((round(y) - y) / 30)
    else if (action == SLOWER)
        target_acc = v_front  - v
        target_heading = atan((round(y) - y) / 30)
    else if (action == LANE_LEFT)
        target_acc = -0.5
        target_heading = -0.15
    else if (action == LANE_RIGHT)
        target_acc = -0.5
        target_heading = 0.15
    
    if (target_heading - heading > steer)
        steer = min(steer + 0.08, target_heading - heading)
    else 
        steer = max(steer - 0.08, target_heading - heading)

    if (target_acc > acc)
        acc = min(target_acc, acc + 4)
    else
        acc = max(target_acc, acc - 6)