BerkeleyLearnVerify / Scenic

A compiler and scenario generator for the Scenic scenario description language.
https://scenic-lang.org/
Other
258 stars 93 forks source link

Spawning vehicle in the intersection #200

Closed Nancy22-NJ closed 7 months ago

Nancy22-NJ commented 7 months ago

advInitLane = Uniform(*filter(lambda m: m.type is ManeuverType.STRAIGHT, Uniform(*filter(lambda m: m.type is ManeuverType.STRAIGHT, egoInitLane.maneuvers)).conflictingManeuvers) ).startLane

After reading the example scenarios in NHTSA, it seems that we can spawn the vehicle on the lateral entry(right or left randomly) of intersection?

But if i want to spawn the vehicle on the right entry only, how should i do?

Looking forward to your reply!

Eric-Vin commented 7 months ago

Hello,

Can you clarify what you'd like to do? Are you trying to place a vehicle uniformly on a specific road out of those entering an intersection?

Nancy22-NJ commented 7 months ago

Hello,

Can you clarify what you'd like to do? Are you trying to place a vehicle uniformly on a specific road out of those entering an intersection?

For example, i want place the vehicle on the left entry of the intersection.

Eric-Vin commented 7 months ago

Hello, It sounds like what you'd like to do can be accomplished by using the roads module of the driving domain. Specifically the Manuever class and the Lane (specifically the adjacentLanes attribute of the appropriate lanes to find the leftmost lane). Hope this helps!