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')
