CARLA-ROS联合仿真环境搭建

项目场景:

Ubuntu环境下的CARLA+ROS联合仿真

所用的版本:
CARLA 0.9.13
ROS版本:ROS Melodic
Ubuntu版本:18.04


一.Ubuntu系统安装

这里描述安装过程中遇到的问题:
安装Ubuntu系统比较简单,我也是第一次安装就成功了,简要说一下:

1.找一个U盘作系统盘,选择.iso镜像文件下载,具体步骤安装可以去看安装Ubuntu系统的博客;

2.开机的时候按F2或者Delete健进入进入Boot Manager模式,选择U盘启动盘起动;

3.系统安装完成后,安装Nidia的显卡驱动;

这里要说一下安装的驱动版本,第一次安装了"NVIDIA-Linux-x86_64-515.86.01.run",结果CARLA不能正常运行,换了一个版本"NVIDIA-Linux-x86_64-450.80.02.run"就可以了;
这里还是说明一下怎么安装NVIDIA的驱动吧,需要安装git和cmake,然后直接运行下面的代码即可成功安装NVIDIA驱动;

sudo ./NVIDIA-Linux-x86_64-450.80.02.run

输入命令

nvidia-smi

即可查看是否成功安装驱动;

@Override
	public void run() {
		bytes = mmInStream.read(buffer);
		mHandler.obtainMessage(READ_DATA, bytes, -1, buffer).sendToTarget();
	}

二.ROS安装:

1.安装 Ros1;

wget http://fishros.com/install -O fishros && . fishros

# Ubuntu 18 用户选择 melodic,Ubuntu 20 用户选择 noetic,:
source /opt/ros/melodic/setup.bash
source /opt/ros<melodic/setup.bash

三.CARLA安装:

1.首先下载CARLA 0.9.13;

2.下载Anaconda,创建环境,安装CARLA;

conda  create -n deepblue python=3.7
conda activate deepblue
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip install opencv-python==4.2.0.32 
pip install networkx
pip install rospkg
pip install rospy
pip install simple_pid
pip install transforms3d
pip install networkx
pip install enum
pip install pygame

运行完上面所有的命令,我们就已经创建好了虚拟环境同时也安装好了需要的依赖库;

3.安装Carla-ros-bridge

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
sudo apt-get install carla-ros-bridge

4.添加CARLA环境变量;

sudo gedit ~/.bashrc
export CARLA_ROOT=/home/carla/CARLA_0.9.13
export PYTHONPATH=$PYTHONPATH:/home/carla/CARLA_0.9.13/PythonAPI/carla/dist/carla-0.9.13-py3.7-linux-x86_64.egg.egg:$CARLA_ROOT/PythonAPI/carla

5.运行CARLA:

./CarlaUE4.sh -opengl;

运行CARLA 0.9.13遇到一个错误提示:

LogShaders: Error: The global shader cache file Carla_Sim/Engine/GlobalShaderCache-GLSL_150.bin is missing
Your application is built to load COOKED content No COOKED content was found this usually means you did not cook content for this build."
Upon inspecting the Engine folder, the file really is missing, however, there is a file named " GlobalShaderCache-GLSL_430.bin". Is there some other version of Carla that needs to be compiled in order to use opengl3? I am not quite sure what is causing this error.

解决办法:sudo apt install vulkan-utils

四.CARLA+ROS联合仿真:

1.终端在启动 Carla 仿真器后,新开一个终端,运行如下命令:

roslaunch carla_ros_bridge carla_ros_bridge_with_example_ego_vehicle.launch

这时候可以看到如下的界面,我们已经成功配置了联合仿真环境,尽情享受吧_,谢谢观看,CARLA+ROS联合仿真环境配置完成。
在这里插入图片描述

  • 3
    点赞
  • 32
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值