PlotJuggler的安裝遇到的問題記錄

1.PlogJuggler的安裝

在基於ROS系統進行開發的工程中,我們常常需要根據訂閱的rostopic來進行邏輯判斷進而執行操作,當遇到問題需要調試的時候,經常需要對接收的topic進行數據分析。通常的做法是對操作過程進行錄包(也就是錄操作過程中的rosbag包),然後調試的時候進行回放,並通過rostopic echo命令查看數據變化,但是這樣操作不夠直觀。經常遇到這種情況時,我們開發人員都會想如果有一個可視化的工具,能夠對隨着時間進行變換的topic的值進行顯示分析該多好啊。

PlotJuggler就很好的滿足了這個需求。

PlotJuggler提供可視化界面來顯示topic數據的實時變化,方便我們將時間和數據對應起來分析問題。它能夠接收ROS系統中所有的topic,並給用戶提供方法,根據用戶需要來選擇性的顯示某些topic的數據變化。也可以對topic進行重新發布。更多的功能我們可以根據需求去學習瞭解,目前我只用到了消息的數值可視化,感覺蠻好用的。

先感受下官方提供的一個動態數據展示圖:

我使用過程中的截圖:

具體的安裝可以看github上的項目鏈接https://github.com/facontidavide/PlotJuggler

需要說明的是提供了兩種安裝方式,一種是源碼下載編譯安裝,另一種是sudo apt-get install的命令行安裝方式。我自己傾向於命令行安裝方式,因爲我不需要閱讀源碼或者對源碼進行二次開發。當然,如果有閱讀源碼的需求或者進行擴展開發的需求的話,就需要下載源碼。

使用命令行安裝步驟:

1)先安裝必要的依賴:

sudo apt-get install qtbase5-dev libqt5svg5-dev ros-kinetic-ros-type-introspection

2)再安裝PlotJuggler:

sudo apt-get install ros-kinetic-plotjuggler

安裝後,每次啓動的時候在命令行中輸入命令:

rosrun plotjuggler PlotJuggler 

啓動後頁面如下:

我們直接點擊上邊的Streaming tab,選擇裏邊的Start ROS_Topic_Streamer選項就可以了,加再完後,就會將所有的topic在頁面的左側列出來,這時候我們要分析那些topic,直接選中往右側拉就可以進行可視化顯示了。

數據可視化的時候,可以將多個字段的數值變化放在要給座標系下顯示,也可以放在多個座標系下顯示,可以根據需要點擊右下側的幾個按鈕。

此時頁面中有多個座標系,將我們關心個各個字段拖到各自座標系就可以看到不同座標系中顯示的不同字段的數值變化情況了。

如果想對比觀察足夠長時間的message變化的話,需要設置時間buffer,修改下面頁面中的buffer就可以了。但是,遺憾的是這個功能在2.4版本以後就沒有了,2.4版本以後buffer最大是100sec。

這裏重點說一下我在幾個電腦上安裝過程中遇到的幾個問題和解決方法。

2.安裝遇到的問題解決

1)sudo apt-get install安裝失敗
nvidia@tegra-ubuntu:~$ sudo apt-get install ros-kinetic-plotjuggler
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  binutils-dev ros-kinetic-abseil-cpp ros-kinetic-ros-type-introspection
The following NEW packages will be installed:
  binutils-dev ros-kinetic-abseil-cpp ros-kinetic-plotjuggler ros-kinetic-ros-type-introspection
0 upgraded, 4 newly installed, 0 to remove and 175 not upgraded.
Need to get 4,795 kB/6,972 kB of archives.
After this operation, 28.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu xenial/main amd64 ros-kinetic-abseil-cpp amd64 0.2.3-0xenial-20180809-134929-0800
  404  Not Found [IP: 101.6.8.193 80]
Err:2 http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu xenial/main amd64 ros-kinetic-ros-type-introspection amd64 1.3.2-0xenial-20190417-115741-0800
  404  Not Found [IP: 101.6.8.193 80]
Err:3 http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu xenial/main amd64 ros-kinetic-plotjuggler amd64 2.1.10-0xenial-20190417-120349-0800
  404  Not Found [IP: 101.6.8.193 80]
E: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/pool/main/r/ros-kinetic-abseil-cpp/ros-kinetic-abseil-cpp_0.2.3-0xenial-20180809-134929-0800_amd64.deb  404  Not Found [IP: 101.6.8.193 80]

E: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/pool/main/r/ros-kinetic-ros-type-introspection/ros-kinetic-ros-type-introspection_1.3.2-0xenial-20190417-115741-0800_amd64.deb  404  Not Found [IP: 101.6.8.193 80]

E: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/pool/main/r/ros-kinetic-plotjuggler/ros-kinetic-plotjuggler_2.1.10-0xenial-20190417-120349-0800_amd64.deb  404  Not Found [IP: 101.6.8.193 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
解決辦法:

方法一:先嚐試使用命令sudo apt-get update,在該命令正常執行後仍不能解決問題的時候嘗試方法二;

方法二:修改/etc/apt/sources.list文件,也就是pkg獲取的源頭。

國內比較好用的有清華的、163的、阿里雲的 等等,自己可以網上找找進行替換。

下面這個是163的。


deb http://mirrors.163.com/ubuntu/ precise main universerestricted multiverse 
deb-src http://mirrors.163.com/ubuntu/ precise main universerestricted multiverse 
deb http://mirrors.163.com/ubuntu/ precise-security universemain multiverse restricted 
deb-src http://mirrors.163.com/ubuntu/ precise-securityuniverse main multiverse restricted 
deb http://mirrors.163.com/ubuntu/ precise-updates universemain multiverse restricted 
deb http://mirrors.163.com/ubuntu/ precise-proposed universemain multiverse restricted 
deb-src http://mirrors.163.com/ubuntu/ precise-proposeduniverse main multiverse restricted 
deb http://mirrors.163.com/ubuntu/ precise-backports universemain multiverse restricted 
deb-src http://mirrors.163.com/ubuntu/ precise-backportsuniverse main multiverse restricted 
deb-src http://mirrors.163.com/ubuntu/ precise-updatesuniverse main multiverse restricted

2)數字簽名問題

當直接輸入命令

sudo apt-get install ros-kinetic-plotjuggler 

進行安裝的時候,如果源找不到的話,需要進行sudo apt-get update來更新源。但是更新過程中又會爆出下面日誌的問題:

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://packages.ros.org/ros/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
W: Failed to fetch http://packages.ros.org/ros/ubuntu/dists/xenial/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654

解決方法:

nvidia@tegra-ubuntu:~$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654

問題解決參考鏈接:sudo apt-get update數字簽名錯誤解決方法

3)不能正常安裝依賴庫

輸入sudo apt-get install qtbase5-dev libqt5svg5-dev ros-kinetic-ros-type-introspection命令安裝依賴的時候遇到了下面問題:

nvidia@tegra-ubuntu:~$ sudo apt-get install qtbase5-dev libqt5svg5-dev ros-kinetic-ros-type-introspection

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)

E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

nvidia@tegra-ubuntu:~$ sudo apt-get install qtbase5-dev libqt5svg5-dev ros-kinetic-ros-type-introspection

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)

E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

解決辦法:

使用ps -A | grep apt命令查看another process using it,然後使用sudo kill -9命令來殺掉進程就好了。

sudo kill -9 processnumber

4)E: Unable to correct problems, you have held broken packages.問題的解決

nvidia@tegra-ubuntu:~$ sudo apt-get install ros-kinetic-plotjuggler
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 ros-kinetic-plotjuggler : Depends: binutils-dev but it is not installable
E: Unable to correct problems, you have held broken packages.
 

問題分析和解決:從日誌來看是binutils-dev沒有安裝引起的,然後我就嘗試安裝binutils-dev:sudo apt-get install binutils-dev,但是我的源裏邊找不到這個包,這時候我換了另一個源(也就是替換/etc/apt/sources.list文件)後問題解決了。

電腦上或者開發板上安裝過PlotJuggler之後,每次使用的時候沒必要再敲一次rosrun命令來啓動,直接將rosrun啓動命令寫在一個腳本里執行就可以了,這樣使用更方便的。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章