[ROS]using roswtf

本贴最后更新于 3036 天前,其中的信息可能已经时过境迁

本文开始之前先把 roscore 关闭。

####1.检查安装

roswtf 检查系统并试图检查问题:

$ roscd
$ roswtf

可以看到类似的内容:

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

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

Cannot communicate with master, ignoring graph checks

如果安装有问题可以看到类似下面的输出:```

"Stack: ros": roswtf uses whatever your current directory is to determine what checks it does. This is telling us that you started roswtf in the ros stack.
"Static checks summary": this is a report on any filesystem issues. It's telling us that there were no errors.
"Cannot communicate with master, ignoring graph checks": the roscore isn't running, so roswtf didn't do any online checks.


####2.Trying it online
For this next step, we want a Master to be up, so go ahead and start a roscore.
首先通过roscore启动Master。运行:

$ 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
roswtf对roscore运行之后的图做了一些在线的检查。根据启动的节点的数量,检查所花费的时间也不同。检查完毕之后可以看大类似的输出:

WARNING The following node subscriptions are unconnected:

  • /rosout:
    • /rosout
roswtf警告rosout节点需要向一个主题订阅,但是没有一个节点发布。这种情况,因为我们本来就没有运行其他的节点,所以可以忽略这个警告。

####2.Errors

roswtf警告有些东西是有问题的,但是这可能很正常。roswtf也可以检查出错误,并可以报告错误。
这里我们向ROSPACKAGE_PATH设置一个错误的值。停止之前运行的Master节点让输出看起来简单一点。

$ roscd
ROS_PACKAGE_PATH=bad:ROS_PACKAGE_PATH roswtf
This time we see:

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检查出了ROSPACKAGE_PATH设置的错误。
roswtf可以检查出很多其他类型的错误。如果在编码的过程被构建和交流问题难倒,可以使用roswtf来看看能不能给出正确的方向。


  • ROS
    23 引用 • 2 关注

相关帖子

欢迎来到这里!

我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。

注册 关于
请输入回帖内容 ...