启动gazebo仿真环境报错[spawn_model-4] process has died

启动gazebo仿真环境报错[spawn_model-4] process has died

错误信息如下:
[spawn_model-4] process has died [pid 9871, exit code 1, cmd /opt/ros/melodic/lib/gazebo_ros/spawn_model -urdf -model car -param robot_description __name:=spawn_model __log:=/home/yuepeng/.ros/log/5cffbaa4-c07c-11ec-b5ad-782b462a8447/spawn_model-4.log].

请添加图片描述
解决方法:
主要是编码老问题,找到上面出现的/usr/lib/python2.7/xml/etree/ElementTree.py文件,使用vim文本编辑器打开,终端命令是

sudo vim /usr/lib/python2.7/xml/etree/ElementTree.py

加入以下代码

reload(sys) 
sys.setdefaultencoding("utf-8")

加入之后的程序格式如下:
请添加图片描述

你可能感兴趣的:(ros,ubuntu)