carla-simulator / scenario_runner

Traffic scenario definition and execution engine
https://carla-scenariorunner.readthedocs.io/en/latest/
MIT License
532 stars 363 forks source link

FOLLOWING ROUTE via OpenScenario format #516

Closed iremonur closed 4 years ago

iremonur commented 4 years ago

I would like to have a vehicle ("adversary") to follow a set of waypoints which should be supported through the tag in the .xml file and the waypoint following atomic behavior. But i can't get my car to start to follow waypoints, the vehicle did not even move. With FollowRoute.xml file which i attached, i expect the vehicle to start following waypints. Can you please help me ? FollowRoute.zip

NOTE : I cloned latest atomic_behaviour.py Ubuntu 16.04, CARLA 0.9.7.4, Python 2.7

fabianoboril commented 4 years ago

The route itself looks fine, but the start condition might be a blocking factor. Having a starttime of time equal_to 0, is likely to fail, I guess. You can run with "--debug" to get the behavior tree printed, to see where the problem occurs.

iremonur commented 4 years ago

Thank you for your response. I tried to have a starttime of time "greater_than 0" and "SimulationTime value="1" rule="equal_to" Both of them didn't work, too. So, i would like to try running with --debug but i use scenario runner with ros. So i run these following commands to execute scenario : --> roslaunch carla_ros_scenario_runner carla_ros_scenario_runner.launch --> rosservice call /scenario_runner/execute_scenario "{ 'scenario': { 'scenario_file': '/home/user_name/carla/scenario_runner-master/srunner/examples/FollowRoute.xml' } }" --> python no_rendering_mode.py So, where should i run the command "--debug" ?

iremonur commented 4 years ago

I tried to give a start condition which depends on RelativeDistance and it worked. But 4-5 seconds after simulation starts, I keep getting the following error: Resetting ego-vehicle! Destroying ego-vehicle! Then the vehicle which followed the route("adversary") disappeared. I tried to give "time" specification as you can see below : Waypoint strategy="fastest" time = "100" Position World x="14.0" y="400.0" z="0.5" h="1.57079632679" / /Position But it didn't work. Is there any way that the "adversary" vehicle does not disappear during following a set of waypoints?

fabianoboril commented 4 years ago

Hi, The Resetting/Destroying messages come from CARLA directly, you can ignore these. More likely the scenario is finished, and that is why the vehicle disappears. You can for example run with "--output" to get a scenario summary in stdout.

iremonur commented 4 years ago

Thank you for your help, i add more waypoints and it worked.

fabianoboril commented 4 years ago

Excellent :)