Ubuntu环境下的CARLA+ROS联合仿真
所用的版本:
CARLA 0.9.13
ROS版本:ROS Melodic
Ubuntu版本:18.04
这里描述安装过程中遇到的问题:
安装Ubuntu系统比较简单,我也是第一次安装就成功了,简要说一下:
这里要说一下安装的驱动版本,第一次安装了"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();
}
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
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
运行完上面所有的命令,我们就已经创建好了虚拟环境同时也安装好了需要的依赖库;
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
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
./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
roslaunch carla_ros_bridge carla_ros_bridge_with_example_ego_vehicle.launch
这时候可以看到如下的界面,我们已经成功配置了联合仿真环境,尽情享受吧_,谢谢观看,CARLA+ROS联合仿真环境配置完成。