【ROS】ros melodic 的 joint_state_publisher问题

1 无法下载 joint_state_publisher_gui   错误如下

sudo apt-get install ros-melodic-joint-state-publisher-gui
[sudo] *** 的密码: 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列软件包是自动安装的并且现在不需要了:
  linux-hwe-5.4-headers-5.4.0-42 linux-hwe-5.4-headers-5.4.0-73
  linux-hwe-5.4-headers-5.4.0-74 linux-hwe-5.4-headers-5.4.0-77
使用'sudo apt autoremove'来卸载它(它们)。
下列【新】软件包将被安装:
  ros-melodic-joint-state-publisher-gui
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 335 个软件包未被升级。
需要下载 12.0 kB 的归档。
解压缩后会消耗 55.3 kB 的额外空间。
错误:1 http://packages.ros.org/ros/ubuntu bionic/main amd64 ros-melodic-joint-state-publisher-gui amd64 1.12.15-1bionic.20210505.032058
  404  Not Found [IP: 64.50.236.52 80]
E: 无法下载 http://packages.ros.org/ros/ubuntu/pool/main/r/ros-melodic-joint-state-publisher-gui/ros-melodic-joint-state-publisher-gui_1.12.15-1bionic.20210505.032058_amd64.deb  404  Not Found [IP: 64.50.236.52 80]
E: 有几个软件包无法下载,要不运行 apt-get update 或者加上 --fix-missing 的选项再试试?

 

 进行 sudo apt-get update  出现两个错误

 sudo apt-get update
命中:1 http://packages.microsoft.com/repos/code stable InRelease
获取:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]   
命中:4 http://cn.archive.ubuntu.com/ubuntu bionic InRelease                    
获取:2 http://packages.ros.org/ros/ubuntu bionic InRelease [4,680 B]           
忽略:5 http://ppa.launchpad.net/bzindovic/suitesparse-bugfix-1319687/ubuntu bionic InRelease
错误:2 http://packages.ros.org/ros/ubuntu bionic InRelease                     
  下列签名无效: EXPKEYSIG F42ED6FBAB17C654 Open Robotics <info@osrfoundation.org>
获取:6 http://cn.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]  
错误:7 http://ppa.launchpad.net/bzindovic/suitesparse-bugfix-1319687/ubuntu bionic Release
  404  Not Found [IP: 91.189.95.85 80]
获取:8 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [51.4 kB]
获取:9 http://cn.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
获取:10 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [57.8 kB]
获取:11 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B]
获取:12 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [294 kB]
获取:13 http://cn.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [295 kB]
获取:14 http://cn.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,468 B]
获取:15 http://cn.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [9,268 B]
正在读取软件包列表... 完成                                                  
W: 校验数字签名时出错。此仓库未被更新,所以仍然使用此前的索引文件。GPG 错误:http://packages.ros.org/ros/ubuntu bionic InRelease: 下列签名无效: EXPKEYSIG F42ED6FBAB17C654 Open Robotics <info@osrfoundation.org>
E: 仓库 “http://ppa.launchpad.net/bzindovic/suitesparse-bugfix-1319687/ubuntu bionic Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。

解决方案 

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654

问题

sudo apt-get update
命中:2 http://security.ubuntu.com/ubuntu bionic-security InRelease             
命中:3 http://cn.archive.ubuntu.com/ubuntu bionic InRelease                    
获取:1 http://packages.ros.org/ros/ubuntu bionic InRelease [4,680 B]           
忽略:4 http://ppa.launchpad.net/bzindovic/suitesparse-bugfix-1319687/ubuntu bionic InRelease
命中:5 http://cn.archive.ubuntu.com/ubuntu bionic-updates InRelease            
获取:6 http://packages.ros.org/ros/ubuntu bionic/main amd64 Packages [772 kB]  
命中:7 http://cn.archive.ubuntu.com/ubuntu bionic-backports InRelease          
错误:8 http://ppa.launchpad.net/bzindovic/suitesparse-bugfix-1319687/ubuntu bionic Release
  404  Not Found [IP: 91.189.95.85 80]
命中:9 http://packages.microsoft.com/repos/code stable InRelease               
获取:10 http://packages.ros.org/ros/ubuntu bionic/main i386 Packages [26.3 kB] 
正在读取软件包列表... 完成           
E: 仓库 “http://ppa.launchpad.net/bzindovic/suitesparse-bugfix-1319687/ubuntu bionic Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。

解决方案

sudo rm /etc/apt/sources.list.d/bzindovic-ubuntu-suitesparse-bugfix-1319687-bionic.list


sudo rm /etc/apt/sources.list.d/bzindovic-ubuntu-suitesparse-bugfix-1319687-bionic.list.save
rm: 无法删除'/etc/apt/sources.list.d/bzindovic-ubuntu-suitesparse-bugfix-1319687-bionic.list.save': 没有那个文件或目录

 

下载 joint_state_publisher_gui  成功后  ,在roslaunch中启动  joint_state_publisher 和  joint_state_publisher_gui 时,分别报错

两个都启动

process[rviz-2]: started with pid [9550]
process[joint_state_publisher-3]: started with pid [9551]
process[robot_state_publisher-4]: started with pid [9552]
process[joint_state_publisher_gui-5]: started with pid [9553]
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/joint_state_publisher/joint_state_publisher", line 44, in <module>
    jsp = joint_state_publisher.JointStatePublisher()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/joint_state_publisher/__init__.py", line 159, in __init__
    robot = xml.dom.minidom.parseString(description)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1928, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 940, in parseString
    return builder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 223, in parseString
    parser.Parse(string, True)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 30-36: ordinal not in range(128)
[joint_state_publisher-3] process has died [pid 9551, exit code 1, cmd /opt/ros/melodic/lib/joint_state_publisher/joint_state_publisher __name:=joint_state_publisher __log:=/home/zzh/.ros/log/debfea98-0f81-11ec-96ea-a4b1c16de85e/joint_state_publisher-3.log].
log file: /home/zzh/.ros/log/debfea98-0f81-11ec-96ea-a4b1c16de85e/joint_state_publisher-3*.log
^C[joint_state_publisher_gui-5] killing on exit
[robot_state_publisher-4] killing on exit
[rviz-2] killing on exit
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

只启动gui

process[rviz-1]: started with pid [4654]
process[joint_state_publisher-2]: started with pid [4655]
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/joint_state_publisher/joint_state_publisher", line 44, in <module>
    jsp = joint_state_publisher.JointStatePublisher()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/joint_state_publisher/__init__.py", line 159, in __init__
    robot = xml.dom.minidom.parseString(description)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1928, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 940, in parseString
    return builder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 223, in parseString
    parser.Parse(string, True)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 30-36: ordinal not in range(128)
[joint_state_publisher-2] process has died [pid 4655, exit code 1, cmd /opt/ros/melodic/lib/joint_state_publisher/joint_state_publisher __name:=joint_state_publisher __log:=/home/zzh/.ros/log/ae450144-0f79-11ec-96ea-a4b1c16de85e/joint_state_publisher-2.log].
log file: /home/zzh/.ros/log/ae450144-0f79-11ec-96ea-a4b1c16de85e/joint_state_publisher-2*.log
^C[rviz-1] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

解决方案: 问题可能是urdf文件里有中文注释        在相应路径 /opt/ros/melodic/lib/joint_state_publisher_gui               /opt/ros/melodic/lib/joint_state_publisher  给相关文件添加权限 

sudo chmod 777 joint_state_publisher

分别在相应py文件里添加 

    import sys  
    reload(sys)  
    sys.setdefaultencoding('utf8')   

 

posted @ 2021-09-07 10:00  星火-AI  阅读(3031)  评论(0编辑  收藏  举报