随笔 - 272  文章 - 7  评论 - 27  阅读 - 83万

urdf中文注释导致的字符问题

运行joint_state_publisher/joint_state_publisher_gui报错
错误如下:

[joint_state_publisher_gui-4] process has died [pid 97153, exit code 1, cmd /opt/ros/melodic/lib/joint_state_publisher_gui/joint_state_publisher_gui __name:=joint_state_publisher_gui __log:=/home/ros/.ros/log/4422783c-0504-11ee-8b5a-000c29b0c758/joint_state_publisher_gui-4.log].
log file: /home/ros/.ros/log/4422783c-0504-11ee-8b5a-000c29b0c758/joint_state_publisher_gui-4*.log

 



原因:一般均因为urdf內部含有中文字符

解决方案:

1.将urdf文件内部中文字符全部刪除;
2.修改joint_state_publisher和 joint_state_publisher_gui 配置
  cd /opt/ros/melodic/lib/joint_state_publisher (joint_state_publisher_gui类似)
  sudo gedit joint_state_publisher
  修改
  在import sys後面加

reload(sys)
sys.setdefaultencoding(“utf-8”)

 

若仍然報錯修改執行權限:

  cd /opt/ros/melodic/lib/joint_state_publisher

  chmod 777 joint_state_publisher

posted on   NLazyo  阅读(155)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· 单线程的Redis速度为什么快?
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
历史上的今天:
2017-12-07 线程安全的ConcurrentQueue<T>队列
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示