关闭

ROS使用教程-关于ros_info

772人阅读 评论(0) 收藏 举报
分类:

ROS_INFO output

The ROS_INFO message is probably directed to a ROS log file. In your roslaunch file there probably something like:

level

严重级别
日志消息分为五个不同的严重级别:

DEBUG
INFO
WARN
ERROR
FATAL
划分各种重要级别旨在提供一种区分和管理日志消息的全局方法,这些级别本身对系统不包含任何额外的影响。

rosout

rosout是一个综合工具,它既包含了一个rosout节点用来订阅记录和重新发布信息,一个rosout_agg topic.一个信息rosgraph_msgs/Log,它定义了标准域以及详细级别.
用户API以及一个GUI工具.

client API 可以使用roscpp和rosconsole,其中rosconsole提供了一个基于macro的接口,允许以print和流的方式输出,另外也封装了log4cxx,支持体系日志和配置文件.
rosout is the name of the console log reporting mechanism in ROS. It can be thought as comprising several components:

ROS_DEBUG_STREAM_ONCE("This appears only once.");
ROS_INFO_STREAM_ONCE("This appears only once.");
ROS_WARN_STREAM_ONCE("This appears only once.");
ROS_ERROR_STREAM_ONCE("This appears only once.");
ROS_FATAL_STREAM_ONCE("This appears only once.");
  • The rosout node for subscribing, logging, and republishing the messages.
  • The /rosout topic
  • The /rosout_agg topic for subscribing to an aggregated feed
  • rosgraph_msgs/Log message type, which defines standard fields as well as verbosity levels.
  • client APIs to facilitate easy use of the rosout reporting mechanism GUI tools,
  • like rqt_console, for viewing the console log messages.

The rosout package only provides the rosout node.

roscpp uses the rosconsole package to provide its client-side API. That API takes the form of a number of ROS_ macros:

rosconsole provides four different types of logging statements, at 5 different verbosity levels, with both printf- and stream-style formatting.

configuration

rosconsole能够从$ROS_ROOT/config/rosconsole.config在初始化的load配置文件.
rosconsole允许定义自己的配置文件用于log4cxx,被环境变量ROSCONSOLE_CONFIG_FILE定义.

<launch>
  <env name="ROSCONSOLE_CONFIG_FILE" 
       value="$(find mypackage)/custom_rosconsole.conf"/>
  <node pkg="mypackage" type="mynode" name="mynode" output="screen"/>
</launch>

Loging output

Output
There are four potential places a log message may end up, depending on the verbosity level:

  1. stdout
    DEBUG and INFO messages arrive on stdout if they are enabled. Note that this may not be sent to the screen depending on the value of the roslaunch/XML/node output parameter.
  2. stderr
    WARN, ERROR and FATAL messages arrive on stderr if they are enabled.
  3. Node log file
    Everything enabled goes into the log file. Your node’s log file will be in ~/.ros/log unless you override it with the ROS_HOME or ROS_LOG_DIR environment variables. If you are using roslaunch, you can use the roslaunch-logs command to tell you the location of the log directory.
  4. /rosout topic
    Everything enabled is sent to the /rosout topic. Note that until the node is fully started, messages will not be sent, so you may not see initial messages.

refer

  1. http://chenjunjun.bitbucket.org/2016/03/17/ROS-%E7%A8%8B%E5%BA%8F%E7%BC%96%E5%86%99%E4%B9%8B%E6%97%A5%E5%BF%97/
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:100100次
    • 积分:2293
    • 等级:
    • 排名:第17404名
    • 原创:99篇
    • 转载:6篇
    • 译文:1篇
    • 评论:22条
    文章分类
    最新评论