JdeRobot / BehaviorMetrics

Autonomous driving neural network comparison tool
https://jderobot.github.io/BehaviorMetrics/
GNU General Public License v3.0
56 stars 49 forks source link

20: Waiting for vehicles, stuck in loop #662

Closed KlrShaK closed 8 months ago

KlrShaK commented 9 months ago

Hey I installed Carla as you described in #657 , It runs perfectly fine when I do ./CarlaUE4.sh. However, when I try to run the following examples in Quick Start CARLA.

behavior_metrics$ python3 driver_carla.py -c configs/CARLA/default_carla.yml -g
40: CARLA is not supported
20: SimulatorEnv: launching simulator server.
20: SimulatorEnv: launching simulator server.
Traceback (most recent call last):
  File "driver_carla.py", line 429, in <module>
    main()
  File "driver_carla.py", line 308, in main
    controller = ControllerCarla()
  File "/home/<user>/BehaviorMetrics/behavior_metrics/utils/controller_carla.py", line 75, in __init__
    self.world = client.get_world()
RuntimeError: time-out of 100000ms while waiting for the simulator, make sure the simulator is ready and connected to localhost:2000

which is similar to #598 #587 , I tried running Carla on its own using './CarlaUE4.sh', I got the following output:

4.26.2-0+++UE4+Release-4.26 522 0
Disabling core dumps.
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

The simulator loaded fine and I can move around. I also changed sudo sysctl dev.i915.perf_stream_paranoid=0 which removed the warning. and also the error in BehaviorMetric somehow changed now when I run. (THIS IS MOST RECENT ERROR)

/behavior_metrics$ python3 driver_carla.py -c configs/CARLA/default_carla.yml -g
40: CARLA is not supported
20: SimulatorEnv: launching simulator server.
20: SimulatorEnv: launching simulator server.
20: Waiting for vehicles!
20: Waiting for vehicles!
20: Waiting for vehicles!
.
.
.

The error 20: Waiting for vehicles! loops continuously This issue is similar to #588 , but it doesn't help solving the issue as Carla on its own runs fine and doesn't show any dependencies issue.

Also I'm unable to find log files as mentioned in #588 , in environments.py file saves the log in /tmp/ folder, but there is no temp folder in my/behaviormetric/ folder, there is a /log/ folder but the logs.log file that it has is empty

sergiopaniego commented 9 months ago

Hi, Thanks for opening the issue. Based on the information you're sharing, there could be a compatibility issue. It could be CARLA server, CARLA simulator frontend (Python API), or even carla-ros-bridge as it says CARLA is not supported. Could you please share more details about which version of CARLA and carla-ros-bridge you've installed?

The log files should be in your machine's root path /tmp, not inside Behavior Metrics. Could you please double-check if it is present there?

KlrShaK commented 9 months ago

Heya, My Carla version 0.9.13 same as on website. The problem was with carla-ros-bridge since I didn't install Carla using Debian CARLA installation so because of that I think it didn't install carla-ros-bridge automatically. After installing carla-ros-bridge's latest version the error have changed

[INFO] [1707395025.035411, 0.000000]: Trying to connect to localhost:2000
[INFO] [1707395025.623205, 0.000000]: Loading town '' (previous: 'Carla/Maps/Town01').
[ERROR] [1707395038.720427, 0.000000]: Error: time-out of 10000ms while waiting for the simulator, make sure the simulator is ready and connected to localhost:2000
[INFO] [1707395038.722018, 0.000000]: Shutting down...
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/core.py", line 572, in signal_shutdown
    h()
  File "/home/klrshak/carla-ros-bridge/catkin_ws/src/ros-bridge/carla_ros_bridge/src/carla_ros_bridge/bridge.py", line 349, in destroy
    self.shutdown.set()
AttributeError: 'CarlaRosBridge' object has no attribute 'shutdown'
================================================================================REQUIRED process [carla_ros_bridge-2] has died!
process has finished cleanly
log file: /home/klrshak/.ros/log/e594abce-c67c-11ee-a335-8951c7bcf672/carla_ros_bridge-2*.log
Initiating shutdown!
================================================================================
[carla_manual_control_ego_vehicle-5] killing on exit
[set_initial_pose_ego_vehicle-4] killing on exit
[carla_spawn_objects_klrshak_Inspiron_5344_8696946721438619238-3] killing on exit
[carla_ros_bridge-2] killing on exit
KlrShaK commented 9 months ago

Solved this issue by adding parameter -carla-server when running the command ./CarlaUE4.sh -quality-level=Low -preferNvidia -caral-server. I have tested with the launch scripts of carla-ros-bridge ( roslaunch carla_ros_bridge carla_ros_bridge_with_example_ego_vehicle.launch ) . I will close the issue after testing it with BehaviourMetric scripts

sergiopaniego commented 8 months ago

Sure! I’ll close the issue but you can reopen it if the issue persists

ABD-01 commented 7 months ago

Hi! Looks like I'll be the unfortunate soul to reopen this issue. I am facing exactly this same issue with calra ros bridge.

I have installed carla_ros_bridge from source following this doc.

The issue is exactly what Title says. 20: Waiting for vehicles! was being printed endlessly i.e. stuck in the loop. So before testing behaviour_metrics, I ran carla ros bridge. The following error image I followed this step Changed Carla version for bridge.py to 0.9.14

Now, the issue boiled down exactly to be same as KlrShaK's output My Error on running roslaunch carla_ros_bridge carla_ros_bridge.launch: image I am running carla as mentioned: /CarlaUE4.sh -carla-server with the -carla-server parameter. -quality-level=Low parameter has no effect.

My Setup Information OS: Ubuntu 20.04.5 LTS Carla Version: 0.9.14 Python: 3.8 ROS Distro: noetic

sergiopaniego commented 7 months ago

We are using Carla 0.9.15 in this case.

What version of GPU do you have? Are you able to run CARLA with some of the examples they provide without carla-ros-bridge?

ABD-01 commented 7 months ago

Yes, I knew about the Carla version. This one was a PC with 2 GPUs (total of 18 GB), unfortunately, it is a shared system so I won't be changing the Carla version. And yes I am able to run Carla smoothly without ros bridge. GPU Information: image

I will update on this once I try running behaviour_metrics on my personal laptop (GTX 4GB 1650Ti).

sergiopaniego commented 7 months ago

Ok! That behavior is a little bit weird. I suggest that you review the log output generated by the ROS Nodes to understand further the problem. https://github.com/JdeRobot/BehaviorMetrics/blob/b7333abef48b2c506fc428836f3d1ac83590e5e1/behavior_metrics/utils/environment.py#L89

ABD-01 commented 7 months ago

Tried different ways, and finally did rm -rf ~/carla-ros-bridge. And reinstalled again from the source. Followed the above steps and it is working now!

image

Thanks a lot 🙌

sergiopaniego commented 7 months ago

Nice!