czjaixuexi / carla_ros_bridge_pnc

通过carla-ros-bridge在carla上实现自动驾驶planning and control。
142 stars 50 forks source link

启动planning_demo.launch时,Carla仿真器会卡死 #1

Closed chenhengwei1999 closed 1 year ago

chenhengwei1999 commented 1 year ago

问题已解决,原因是启动carla-ros-bridge时,出现以下报错:

File "/home/chw/Documents/ros_ws_top/carla-ros-bridge-0.9.11/catkin_ws/src/ros-bridge/carla_ros_bridge/src/carla_ros_bridge/camera.py", line 455, in get_carla_image_data_array
    ('pol', numpy.bool)
  File "/usr/local/lib/python3.8/dist-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'bool'.
`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:

解决方法: 将catkin_ws/src/ros-bridge/carla_ros_bridge/src/carla_ros_bridge/camera.py中的numpy.bool改成bool就可以了。

czjaixuexi commented 1 year ago

Numpy版本的问题,新版本Numpy中np.bool被弃用了 将/carla_ros_bridge/src/carla_ros_bridge/camera.py文件中, 函数get_carla_image_dataarray下的 numpy.bool 改为numpy.bool 重新编译即可。