BerkeleyLearnVerify / Scenic

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

Problems with FollowLaneBehavior in CARLA when the roads have height #308

Open dbarrita opened 1 month ago

dbarrita commented 1 month ago

System Details

Python 3.8.10 Scenic 3.0.0 Ubuntu 20.04 CARLA 0.9.13

Detailed Description

The behavior FollowLaneBehavior doesn't have a good result if the CARLA level has been created with roads with height. With the command: $ scenic --2d my_scene.scenic --simulate -b The result is shown in the following video:

https://github.com/user-attachments/assets/ef7dc709-c099-406f-b496-b689d9322872

This world have been created from an xodr with road with height and and a fbx of the road using the import script of CARLA. I have created another world with the same steps but without height in the xodr file and this bug doesn't happen.

Steps To Reproduce

  1. Create xodr file adding heights to the road (in my case is created with RoadRunner)
  2. Put the xodr and fbx of the road in the carla/Import folder of CARLA and create the world using the import script in the carla directory.
  3. Add the xodr in the Scenic directory Scenic/assets/maps/CARLA
  4. Create scene with the behavior FollowLaneBehavior (I attach my scenic code in a txt: MySceneWithElev.txt)
  5. Run the scene with the command: $ scenic --2d my_scene.scenic --simulate -b

Issue Submission Checklist

Eric-Vin commented 1 month ago

Can you provide both XODR files (with and without height) so we can try to reproduce the issue? Can you also try running these in the built in Newtonian simulator to see if there is different behavior between the two maps independent of Carla?

dbarrita commented 4 weeks ago

Can you provide both XODR files (with and without height) so we can try to reproduce the issue? Can you also try running these in the built in Newtonian simulator to see if there is different behavior between the two maps independent of Carla?

Hi, of course these are the files: xodrFiles.zip I'll try the Newtonian simulator as you suggested and let you know what happens. Thanks!

dbarrita commented 4 weeks ago

Can you provide both XODR files (with and without height) so we can try to reproduce the issue? Can you also try running these in the built in Newtonian simulator to see if there is different behavior between the two maps independent of Carla?

Hi, of course these are the files: xodrFiles.zip I'll try the Newtonian simulator as you suggested and let you know what happens. Thanks!

I have used the Newtonian simulator with the following command for the both xodr files: $ scenic --2d my_scene.scenic --simulate --model scenic.simulators.newtonian.driving_model -b The car doesn't follow the lanes properly in either case. I also tried pulling the main branch, but the problem remains.

dbarrita commented 5 days ago

Hello, I have tried the FollowLaneBehavior in CARLA with the map Town05. This map has some roads with elevation greater than zero, I have observed that the FollowLaneBehavior works fine when the elevation is zero, but when is greater appears the undesired behavior. Using the Newtonian simulator the behavior is as expected, so it seems that the problem lies in the integration with CARLA. I have used the xodr continent in the folder Scenic/assets/maps/CARLA/Town05.xodr The code of the scene is this: Town05_test1.zip

https://github.com/user-attachments/assets/f3d3822d-73ec-44bd-af6f-aa1733ad1d9d

To reproduce this issue:

  1. Launch CARLA
  2. Select Town05 map and press play
  3. Launch the scene: $ scenic --2d manual_control/Town05_test1.scenic --simulate
dbarrita commented 3 days ago

I solved it by editing these lines:

Screenshot from 2024-11-22 13-39-20

I suppose it's not the best solution, but with this change I can keep working.