1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ROS Loggerの表示形式の変更

Last updated at Posted at 2020-05-09

例えば以下のようなプログラムがあったとします。

#!/usr/bin/env python
import rospy

def main():
    rospy.loginfo('hello!')

if __name__=='__main__':
    rospy.init_node('sample_node')
    main()

標準ではコンソール出力は以下のようになります。

[INFO][1589040511.929980]:hello!

ROSではログの表示形式を設定できるようになっており、例えば以下のように設定すると

export ROSCONSOLE_FORMAT='[${severity}] [${node}] [${function}] [${line}] [${time}]:${message}'

出力が以下のようになり、デバッグなどがしやすくなります。

[INFO] [/sample_node] [main] [6] [1589040511.929980]:hello!

詳細は http://wiki.ros.org/rosconsole ここに書いてあるので参考にどうぞ。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?