Skip to content

Commit ca7ca7b

Browse files
committed
feat(NPCVehicleCognitionStep.cs): add distance-check for prediction-control
Signed-off-by: kazushi67 <[email protected]>
1 parent 60ab38e commit ca7ca7b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Assets/AWSIM/Scripts/RandomTraffic/NPCVehicle/Steps/NPCVehicleCognitionStep.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,16 @@ public void Execute(
11041104
States = states
11051105
}.Execute();
11061106

1107+
foreach (var state in states)
1108+
{
1109+
if ((state.Vehicle.transform.position - egoTransform.position).magnitude <= 200F){
1110+
state.Vehicle.outerControl = true;
1111+
} else {
1112+
state.Vehicle.outerControl = false;
1113+
}
1114+
}
1115+
1116+
11071117
Profiler.EndSample();
11081118
}
11091119

0 commit comments

Comments
 (0)