29 lines
1.2 KiB
Plaintext
29 lines
1.2 KiB
Plaintext
// Next Queue Switcher Scenario
|
|
|
|
Scenario QueueSwitcher:
|
|
|
|
Act QueueSwitcher($rightcount=30,$rightspeed=10km/h,$latpos=0.3,$latpostime=1s,$blinktime=2s):
|
|
|
|
@init:
|
|
CreateVehicle(Ego,EgoProto,xyz=0m|0m|0m,speed=30km/h)
|
|
CreateVehicle(Front,FrontProto,xyz=0m|Ego.y+100m|0m,speed=30km/h)
|
|
repeat $n in [1:$rightcount] by 1:
|
|
CreateVehicle(RightQueue$n,RightQueueProto,xyz=5m|Ego.y+$n*15m|0m,speed=$rightspeed)
|
|
|
|
@Headway(Ego,Front) >= 2s % OnceOnly:
|
|
select $next_queue in RightQueue* with DistanceBeforePassing($next_queue,Ego)>15m minimize Distance($next_queue,Ego):
|
|
@Distance($next_queue,Ego) < 10m:
|
|
LateralChange($next_queue,x=-$latpos,t=$latpostime)
|
|
Delay(2s)
|
|
SetLight($next_queue,LeftTurnIndicator)
|
|
Delay($blinktime)
|
|
LangeChange($next_queue,lane=+1,model=Sinusoidal(time=5s))
|
|
|
|
Prototypes:
|
|
EgoProto: Vehicle(geometry="mycar.obj",color="blue")
|
|
FrontProto: Vehicle(geometry="traffic.obj",color="yellow",maxaccel=10km/h/10s,maxbrake=10m/s/s)
|
|
RightQueueProto: Vehicle(geometry="traffic.obj",color="green")
|
|
|
|
Resources:
|
|
Map: OpenDrive("OpenDriveMap.xodr")
|