Ubuntu22.04安装carla v0.9.14apollo v8.0.0_bridge环境搭建

最近配置carla apollo bridge的时候踩了很多坑,写个学习记录备忘,用的是深信科创的开源bridge

https://github.com/guardstrikelab/carla_apollo_bridge

1.安装docker

sudo apt-get install docker.io

2.为了在docker中用显卡,NVIDIA Container Toolkit

curl https://get.docker.com | sh \
&& sudo systemctl --now enable docker
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
    && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
    && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
          sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
          sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker

如果报错 参考https://huaweicloud.csdn.net/638db47fdacf622b8df8caa4.html#:~:text=%E5%AE%98%E6%96%B9%E7%BD%91%E5%9D%80%EF%BC%9Attps%3A%2F%2Fdocs.nvidia.com%2Fdatacenter%2Fcloud-native%2Fcontainer-toolkit%2Ftroubleshooting.html%20%E6%B2%A1%E5%A4%A7%E7%9C%8B%E6%87%82%EF%BC%8C%E6%84%9F%E8%A7%89%E5%A4%A7%E8%87%B4%E6%84%8F%E6%80%9D%E5%B0%B1%E6%98%AF%E5%8E%BB%E9%99%A4%E9%87%8D%E5%A4%8D%E9%85%8D%E7%BD%AE%E7%9A%84%E7%BD%91%E5%9D%80%E3%80%82,%E4%B8%A4%E4%B8%AA%E6%96%87%E6%A1%A3%E4%B8%AD%E5%AD%98%E5%9C%A8%E9%87%8D%E5%A4%8D%E9%85%8D%E7%BD%AE%E7%9A%84%E7%BD%91%E5%9D%80%EF%BC%8C%E5%88%A0%E9%99%A4%E7%AC%AC%E4%BA%8C%E4%B8%AA%E6%96%87%E6%A1%A3%E4%B8%AD%E7%9A%84deb%20https%3A%2F%2Fnvidia.github.io%2Flibnvidia-container%2Fstable%2Fubuntu18.04%2F%24%20%28ARCH%29%E5%90%8E%EF%BC%8C%E8%A7%A3%E5%86%B3%E9%97%AE%E9%A2%98%E3%80%82

3.安装apollo8.0.0

这里要注意是8.0.0,不是8.0

#Using HTTPS
git clone -b v8.0.0 https://github.com/ApolloAuto/apollo.git

安装速度慢的话可以换成gitee的apollo8.0.0镜像。

cd apollo
echo "export APOLLO_ROOT_DIR=$(pwd)" >> ~/.bashrc  && source ~/.bashrc
sudo rm -rf /apollo/.cache
bash docker/scripts/dev_start.sh

如果报错说 permission denied 不要用sudo,用sudo会导致docker创建一个名称为root的container,和我们要求不一样,要把当前用户加入docker组,参考

https://blog.csdn.net/weixin_43321041/article/details/120399194 

成功的话会显示

[ OK ] Congratulations! You have successfully finished setting up Apollo Dev Environment.
[ OK ] To login into the newly created apollo_dev_lei container, please run the following command:
[ OK ]   bash docker/scripts/dev_into.sh
[ OK ] Enjoy!

进入容器

bash docker/scripts/dev_into.sh

编译gpu版本的apollo 

./apollo.sh build_gpu

打开dreamview

./scripts/bootstrap.sh

 在浏览器中打开

http://localhost:8888/

4.运行carla

 

git clone https://github.com/guardstrikelab/carla_apollo_bridge.git

拉取carla镜像并运行

 

cd carla_apollo_bridge/carla_scripts
./docker_run_carla.sh

 注意cd到carla_scripts文件夹下再运行,不然会找不到yml文件

5.运行bridge

 把carla_bridge文件夹复制到apollo容器内

docker cp carla_bridge <apollo_container_name>:/apollo/modules/carla_bridge

在容器内运行

cd /apollo/modules/carla_bridge
chmod +x install.sh
./install.sh
source ~/.bashrc
python main.py

打开apollo,点击左侧moudle栏,打开routing planning predicting control模块

点击左侧route editing模块,点击Add Point of Interest,点击想要到达的目的地,再点send routing

联合仿真就开始运行了。

如果小车没有动,可以试试把上面四个模块重启一下,然后reset backend data,再选择路径,多试几次应该就行了

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值