ROS master.log分析

master.log 分析

可以查看 ROS启动 及 launch文件中node启动情况

如下:

[rosmaster.main][INFO] 2019-03-21 08:55:47,381: initialization complete, waiting for shutdown
[rosmaster.main][INFO] 2019-03-21 08:55:47,381: Starting ROS Master Node
[xmlrpc][INFO] 2019-03-21 08:55:47,382: XML-RPC server binding to 0.0.0.0:11311
[xmlrpc][INFO] 2019-03-21 08:55:47,382: Started XML-RPC server [http://ros-desktop:11311/]
[xmlrpc][INFO] 2019-03-21 08:55:47,383: xml rpc node: starting XML-RPC server
[rosmaster.master][INFO] 2019-03-21 08:55:47,383: Master initialized: port[11311], uri[http://ros-desktop:11311/]
[rosmaster.master][INFO] 2019-03-21 08:55:47,420: +PARAM [/run_id] by /roslaunch
[rosmaster.master][INFO] 2019-03-21 08:55:47,422: +PARAM [/roslaunch/uris/host_ros_desktop__40343] by /roslaunch
[rosmaster.master][INFO] 2019-03-21 08:55:47,565: +SERVICE [/rosout/get_loggers] /rosout http://ros-desktop:44951/
[rosmaster.master][INFO] 2019-03-21 08:55:47,566: +SERVICE [/rosout/set_logger_level] /rosout http://ros-desktop:44951/
[rosmaster.master][INFO] 2019-03-21 08:55:47,568: +PUB [/rosout_agg] /rosout http://ros-desktop:44951/
[rosmaster.master][INFO] 2019-03-21 08:55:47,572: +SUB [/rosout] /rosout http://ros-desktop:44951/
[rosmaster.master][INFO] 2019-03-21 08:55:47,922: +PARAM [/device_node/chassis/absolute_coordinates_sensor/direct] by /roslaunch

上面的内容说明了rosmaster.main的启动内容:

  • 首先初始化,然后运行 Master Node
  • 启动XML-RPC server (binding to 0.0.0.0:11311)
  • 解析加载 roslaunch中 PARAM
  • 启动 +SERVICE
  • 启动node /rosout

查看启动节点情况

使用命令:

ros@ros-KL20:~/logs/$ grep "rosout" master.log | grep "PUB"

注意: 如果没有指定logs 路径,ros log保存在 ~/.ros/logs 下

例如:

[rosmaster.master][INFO] 2019-05-08 10:00:26,348: +PUB [/rosout] /lidar_node http://ros-KL20:44915/
[rosmaster.master][INFO] 2019-05-08 10:00:26,623: -PUB [/rosout] /lidar_node http://ros-KL20:44915/
[rosmaster.master][INFO] 2019-05-08 10:00:27,325: -PUB [/rosout] /camera_filters http://ros-KL20:33801/
[rosmaster.master][INFO] 2019-05-08 10:00:27,478: +PUB [/rosout] /camera_filters http://ros-KL20:37661/

其中 +PUB [/rosout] /lidar_node 表示 启动的node为 /lidar_node publisher[/rosout] (topic)
-PUB [/rosout] /lidar_node 表示 启动的node 挂掉了
如果launch中加了重启属性就是再重新启动node 如下:

[rosmaster.master][INFO] 2019-05-08 10:00:27,325: -PUB [/rosout] /camera_filters http://ros-KL20:33801/
[rosmaster.master][INFO] 2019-05-08 10:00:27,478: +PUB [/rosout] /camera_filters http://ros-KL20:37661/

可以看出port改变了。

你可能感兴趣的:(ROS master.log分析)