gazebo模型不显示

  • Post author:
  • Post category:其他


提示:

File “/usr/lib/python2.7/xml/etree/ElementTree.py”, line 1657, in feed

self._parser.Parse(data, 0)

UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\u5b8f’ in position 468: ordinal not in range(128)

[spawn_model-4] process has died [pid 2519, exit code 1, cmd /opt/ros/melodic/lib/gazebo_ros/spawn_model -urdf -model car -param robot_description __name:=spawn_model __log:=/home/rot/.ros/log/a3909d5a-6224-11ec-ad5e-080027175752/spawn_model-4.log].

log file: /home/rot/.ros/log/a3909d5a-6224-11ec-ad5e-080027175752/spawn_model-4*.log

gazebo可以打开,但是模型不显示,提示以上内容

解决办法:

/usr/lib/python2.7/xml/etree/ElementTree.py文件

在主代码前,加入

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

只读文件,无法修改权限:

可以使用命令 sudo chmod 777 文件名 开权限

cd /usr/lib/python2.7/xml/etree

sudo chmod 777 ElementTree.py


ROS中使用gazebo_ros的spawn_model时,显示[spawn_model-4] process has died_lzzzzzzm的博客-CSDN博客



版权声明:本文为nownow_原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。