跟自动驾驶之心仿真课程问题操作与解决


conda create -n carla37 python=3.8

conda activate carla37

cd ~/download/PythonAPI/examples

python -m pip install -r requirements.txt

8.27开课
课程用的是ros-bridge  py2,我们的为ros-noetic  py3.12
要改尝试改,
报错1/bin/sh: 1: sdl-config: not found
网上说降版本,到10
Anaconda 并希望切换到 Python 3.10
   conda create -n py310env python=3.10
   conda activate py310env
coda环境全都没了,要重新建
sudo apt-get install libomp5
sudo apt-get install libpng16-16
sudo apt-get install aria2
sudo apt-get install python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev libportmidi-dev libavformat-dev libswscale-dev

pip install pygame==1.9.6 -i https://pypi.tuna.tsinghua.edu.cn/simple
还是不行
这里最后pip install pygame安装了pygame 2.6.0,先用着把
如果要卸载
   pip uninstall pygame
  rm -rf ~/.cache/pip
 
  配置环境sudo gedit ~/.bashrc

刚才发现新方法
Ubuntu 20.04 中可以同时安装 ros-bridge (rosbridge_server)和 ROS Noetic。
https://carla.readthedocs.io/projects/ros-bridge/en/latest/ros_installation_ros1/#b-using-the-source-repository
然后安装pygame==1.9.6
要先退出cada,
conda  deactivate
   curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
   python2 get-pip.py
python2 -m pip install pygame==1.9.6 -i https://pypi.tuna.tsinghua.edu.cn/simple
   python2 -m pip install numpy

(base) jack@jack:~/download$ ./CarlaUE4.sh -prefernvidia
jack@jack:~/download/PythonAPI/examples$ python manual_control.py

导入carla包
jack@jack:~$ pip install -e ~/download/PythonAPI/carla/dist/carla-0.9.10-py2.7-linux-x86_64

lidar使用要先安装
sudo apt-get install meshlab

先打开
./CarlaUE4.sh -prefernvidia -world-port=2000
再运行自己的py

# 加载自定义地图
xodr_path = str('/home/jack/download/PythonAPI/util/opendrive/TownBig.xodr' )

你可能感兴趣的:(carla仿真,自动驾驶,pygame,人工智能,ROS)