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启动命令写在一个脚本里执行就可以了,这样使用更方便的。

发布了72 篇原创文章 · 获赞 190 · 访问量 15万+

猜你喜欢

转载自blog.csdn.net/moyu123456789/article/details/100161503