carla-simulator / ros-bridge

ROS bridge for CARLA Simulator
MIT License
513 stars 414 forks source link

installed ros-bridge under VMware error #599

Open kennyS99 opened 2 years ago

kennyS99 commented 2 years ago

Guys, I am running Carla on windows 10 host machine and running the ros-bridge on a Ubuntu virtual machine(VM ware). I have already tried couple solutions

  1. download the Linux version Carla and set the python path to the egg file in the virtual machine. and use the following command [export PYTHONPATH=$PYTHONPATH:path/to/carla/PythonAPI/] to add the .egg file. Following this guide #237

  2. make the Carla folder that installed in win10 as shared folder with virtual machine, and copied the Linux version .egg file to the win10 folder. Set the python path to the shared folder.

But i still got the following error message:

kenny@kenny-virtual-machine:~$ ros2 launch carla_ros_bridge carla_ros_bridge.launch.py [INFO] [launch]: All log files can be found below /home/kenny/.ros/log/2022-02-02-23-33-31-983942-kenny-virtual-machine-7645 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [bridge-1]: process started with pid [7647] [bridge-1] Traceback (most recent call last): [bridge-1] File "/home/kenny/carla-ros-bridge/install/carla_ros_bridge/lib/carla_ros_bridge/bridge", line 11, in [bridge-1] load_entry_point('carla-ros-bridge==0.0.0', 'console_scripts', 'bridge')() [bridge-1] File "/home/kenny/.local/lib/python3.8/site-packages/pkg_resources/init.py", line 489, in load_entry_point [bridge-1] return get_distribution(dist).load_entry_point(group, name) [bridge-1] File "/home/kenny/.local/lib/python3.8/site-packages/pkg_resources/init.py", line 2861, in load_entry_point [bridge-1] return ep.load() [bridge-1] File "/home/kenny/.local/lib/python3.8/site-packages/pkg_resources/init.py", line 2461, in load [bridge-1] return self.resolve() [bridge-1] File "/home/kenny/.local/lib/python3.8/site-packages/pkg_resources/init.py", line 2467, in resolve [bridge-1] module = import(self.module_name, fromlist=['name'], level=0) [bridge-1] File "/home/kenny/carla-ros-bridge/install/carla_ros_bridge/lib/python3.8/site-packages/carla_ros_bridge/bridge.py", line 24, in

[bridge-1] import carla [bridge-1] ModuleNotFoundError: No module named 'carla' [ERROR] [bridge-1]: process has died [pid 7647, exit code 1, cmd '/home/kenny/carla-ros-bridge/install/carla_ros_bridge/lib/carla_ros_bridge/bridge --ros-args -r __node:=carla_ros_bridge --params-file /tmp/launch_params_v997htaz --params-file /tmp/launch_params_vfxwwxsz --params-file /tmp/launch_params_cvtstc9q --params-file /tmp/launch_params_bc7eeaob --params-file /tmp/launch_params_uw098dmw --params-file /tmp/launch_params_523rl7y2 --params-file /tmp/launch_params_cwipl593 --params-file /tmp/launch_params_dhrmfak5 --params-file /tmp/launch_params_tz4vm998 --params-file /tmp/launch_params_pvtpj7 --params-file /tmp/launch_params_pa21hboq']. [INFO] [launch]: process[bridge-1] was required: shutting down launched system

It seems like the path to the CARLA Python API is missing as the official tutorial explained. But I am 100% promise that I have set the right path of Carla and name of my .egg file.

Only one problem that make me confused is the host machine .egg file shows the python version is 3.7 and the .egg file in the virtual machine shows the python version is 3.8.

I also tried the following code to check the CARLA library can be imported correctly, and i got the success message at terminal.

python3 -c 'import carla;print("Success")' # python3

Anyone can provide help? Thank you so much.