ros日志,ros::console

ros节点日志文件输出到~/.ros/log文件夹。可以通过修改环境变量(ROS_HOME 或者 ROS_LOG_DIR )来修改路径。但与具体工程无关。如果使用roslaunch启动程序,可以通过roslaunch-logs命令指定日志的输出路径。

ros日志显示输出的级别

DEBUG:输出程序正常运行需要的信息

Information that you never need to see if the system is working properly. Examples:
    "Received a message on topic X from caller Y"
    "Sent 20 bytes on socket 9". 
  • INFO:输出大量用户需要的信息
Small amounts of information that may be useful to a user. Examples:
    "Node initialized"
    "Advertised on topic X with message type Y"
    "New subscriber to topic X: Y" 
  • WARN:输出警告,或许影响程序的应用,但系统仍处于可控的预期状态
Information that the user may find alarming, and may affect the output of the application, but is part of the expected working of the system. Examples:

    "Could not load configuration file from <path>. Using defaults." 
  • ERROR:输出严重错误(但错误可恢复)
Something serious (but recoverable) has gone wrong. Examples:
    "Haven't received an update on topic X for 10 seconds. Stopping robot until X continues broadcasting."
    "Received unexpected NaN value in transform X. Skipping..." 
  • FATAL:输出不可恢复的崩溃式错误

ros中改变日志显示输出的级别设置

可以使用以下方法,具体可以查阅ros::console::set_logger_level函数

#include <ros/console.h>
if( ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Debug) ) {
   ros::console::notifyLoggerLevelsChanged();
}
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值