一,安装carla(快速安装版本,源码安装实在是。。。电脑带不动)
(1)按照最新的版本的linux build来下载更新依赖,主要是python等一些依赖。建议安装0.9.10-1版本。carla和carla-ros-bridge都安装这个版本。(还是python版本的那些事)

https://carla.readthedocs.io/en/0.9.13/build_linux/
https://blog.csdn.net/qq_45281711/article/details/116608261

sudo apt-get update &&
sudo apt-get install wget software-properties-common &&
sudo add-apt-repository ppa:ubuntu-toolchain-r/test &&
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - &&
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" &&
sudo apt-get update
sudo apt-get install build-essential clang-8 lld-8 g++-7 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev git
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-8/bin/clang++ 180 &&
sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-8/bin/clang 180
# For Python 3
pip3 install --upgrade pip

# For Python 2
pip install --upgrade pip
pip install --user setuptools &&
pip3 install --user -Iv setuptools==47.3.1 &&
pip install --user distro &&
pip3 install --user distro &&
pip install --user wheel &&
pip3 install --user wheel auditwheel

安装时若出现 launchpadlib 1.10.6 requires testresources, which is not installed.

手动安装:python3.6 -m pip install launchpadlib

(2)安装carla
回到0.9.10-1版本的carla安装:

https://carla.readthedocs.io/en/0.9.10/start_quickstart/

先安装pygame和numpy:

pip install --user pygame numpy
pip3 install --user pygame numpy(把python3的也安装了)
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1AF1527DE64CB8D9
sudo add-apt-repository "deb [arch=amd64] http://dist.carla.org/carla $(lsb_release -sc) main"
sudo apt-get update # Update the Debian package index
注意:安装0.9.10-1版本
sudo apt-get install carla-simulator=0.9.10-1 # In this case, "0.9.10" refers to a CARLA version, and "1" to the Debian revision
安装位置:
cd /opt/carla-simulator # Open the folder where CARLA is installed

Import additional assets

cd /opt/carla-simulator
 ./ImportAssets.sh
 运行carla:
 ./CarlaUE4.sh

(3)安装carla-ros-bridge前,先安装ros-melodic

https://blog.csdn.net/qq_44830040/article/details/106049992?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_default&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_default&utm_relevant_index=2

(4)安装carla-ros-bridge
注意:还是版本的问题0.9.10-1

https://carla.readthedocs.io/en/0.9.10/ros_installation/

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1AF1527DE64CB8D9
sudo add-apt-repository "deb [arch=amd64] http://dist.carla.org/carla $(lsb_release -sc) main"
sudo apt-get update # Update the Debian package index
sudo apt-get install carla-ros-bridge=0.9.10-1 # In this case, "0.9.10" refers to the ROS bridge version, and "1" to the Debian revision  

注:源文件下载的方式一直编译出错,还没解决!!!!

gedit ~/.bashrc 
文末添加:source /opt/carla-ros-bridge/melodic/setup.bash

用ros-bridge运行:

# Option 1: start the ros bridge
roslaunch carla_ros_bridge carla_ros_bridge.launch

# Option 2: start the ros bridge together with RVIZ
roslaunch carla_ros_bridge carla_ros_bridge_with_rviz.launch

# Option 3: start the ros bridge together with an example ego vehicle
roslaunch carla_ros_bridge carla_ros_bridge_with_example_ego_vehicle.launch

接下来进入飞哥的知乎学习吧:

https://www.zhihu.com/people/xie-xiao-fei-78-24/posts

Logo

更多推荐