BerkeleyLearnVerify / Scenic

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

LaneChangeBehavior and FollowLaneBehavior does not work correctly if put in sequence #239

Closed swatimshah closed 2 months ago

swatimshah commented 2 months ago

System Details

My python version - Python 3.8.7rc1 My scenic version - Scenic 2.1.0 Operating System - Windows 11 Carla Simulator Version - CARLA_0.9.13

Detailed Description

Hello, I am running my scenic script with LaneChangeBehavior and FollowLaneBehavior in sequence. However I get huge oscillations after the lane change. Could you please look into the script and the video attached? You will be able to see this behavior after the third LEFT turn. For uploading purpose, I have changed the file extension from ".scenic" to ".txt"

https://github.com/BerkeleyLearnVerify/Scenic/assets/10433719/950c6fc6-37d2-4c2b-9b0b-06e7f760c8d3

test2.scenic.txt

Please let me know if more details are needed.

Steps To Reproduce

I have attached my complete scenic script which can be run in the environment specified above. I have also attached the video clip with the issue.

Issue Submission Checklist

swatimshah commented 2 months ago

Never mind, I managed to fix this issue at my end.

I changed the below code section in the attached script

interrupt when (distance from ego to laneToFollow_1_19) <= 20: print('Following lane ... 1_19') do LaneChangeBehavior(laneSectionToSwitch=self.laneSection.laneToRight, target_speed=EGO_TURN_SPEED) do FollowLaneBehavior(laneToFollow = laneToFollow_1_19, target_speed=EGO_TURN_SPEED)

with the below one

interrupt when (distance from ego to laneToFollow_1_19) <= 20: print('Following lane ... 1_19')
do LaneChangeBehavior(laneSectionToSwitch=self.laneSection.laneToRight, target_speed=EGO_TURN_SPEED) do FollowLaneBehavior(laneToFollow = self.laneSection._laneToRight, target_speed=EGO_TURN_SPEED)

I am able to successfully change the lane and follow the lane now. Sorry for the trouble. Regards,