ROS学习笔记(十六)- roswtf工具

roswtf工具的基本介绍

1 检查你的安装

roswft可以检查你的系统是不是有什么错误:

$ roscd
$ roswtf

你会看到如下信息:

Stack: ros
======================================================
Static checks summary:

No errors or warnings
======================================================

Cannot communicate with master, ignoring graph checks

如果你的安装是正确的,你就会看到类似上面的东西:
-“Stack:ros”:rosetf从你当前的目录来决定你想让它检查什么东西。这一句就是告诉你,它是从ros stack启动的。
-“Static checks summary”:静态检查总结。这是一个文件系统问题报告,它告诉我们这里不存在任何error。
-“Cannot communicate with master, ignoring graph checks”:这个是说肉score没有运行,所以没有进行在线检查。
我的运行出来是这样的:

Loaded plugin tf.tfwtf
No package or stack in context
================================================================================
Static checks summary:

No errors or warnings
================================================================================

ROS Master does not appear to be running.
Online graph checks will not be run.
ROS_MASTER_URI is [http://localhost:11311]

2 尝试在线检查

首先启动ROS:
roscore
打开一个新窗口,重复刚才的步骤:

roscd
roswtf

你会看到类似这样的东西:

Stack: ros
======================================================
Static checks summary:

No errors or warnings
======================================================
Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules

Online checks summary:

Found 1 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:
 * /rosout:
   * /rosout

我的显示的是下面这样的:

Loaded plugin tf.tfwtf
No package or stack in context
================================================================================
Static checks summary:

No errors or warnings
================================================================================
Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules

Online checks summary:

Found 1 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:
 * /rosout:
   * /rosout

roswtf在你rosscore运行的情况下做了一些在线检测,它要运行多长时间才能完成取决于你运行了多少ROS node,它有时候是可以花费很长很长时间的。在这次检查中,它提示了一个warning:

WARNING The following node subscriptions are unconnected:
 * /rosout:
   * /rosout

这个是提示我们rosout订阅了一个根本没有人发布东西的topic。这是因为现在还没有别的东西在运行,我们可以忽略这个warning。

3 Errors

roswtf会警告你那些看起来可疑但是可能在你的系统里是正常的东西。它还会把它知道是错误的东西通过error报告给你。
这部分,我们会把 ROS_PACKAGE_PATH设置成一个错误的值,我们还要关掉roscore,这样能使检查结果精简一点。
然后输入:

$ roscd
$ ROS_PACKAGE_PATH=bad:$ROS_PACKAGE_PATH roswtf

这次你会看到:

Stack: ros
======================================================
Static checks summary:

Found 1 error(s).

ERROR Not all paths in ROS_PACKAGE_PATH [bad] point to an existing directory: 
 * bad

======================================================

Cannot communicate with master, ignoring graph checks

这次,roswtf给出了关于 ROS_PACKAGE_PATH 设置的error提示。它还可以检查出许多别的错误,如果你被编译或者通讯的问题困扰住了,可以试一下它能不能指出问题在哪里。

你可能感兴趣的:(ROS学习笔记(十六)- roswtf工具)