提示:
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博客