jsk-ros-pkg / jsk_common

common programs for jsk-ros-pkg
42 stars 81 forks source link

[jsk_topic_tools/HzMeasureNodelet] Add diagnostics to monitor hz #1743

Closed iory closed 2 years ago

iory commented 2 years ago

What is this?

Enable publishing diagnostics on HzMeasureNodelet. This PR also adds a document. The difference from sanity_diagnostics.py is that you can ignore the communication overhead when using it with nodelet.

This node publishes `hz` of target topic and `diagnostics`.

User can specify `~warning_hz` param.

If target `hz` is smaller than `~warning_hz`, this node outputs `diagnostics` at `WARN` level (if `~use_warn` is `True`) or `ERROR` level.

Use case

For example, use it when you want to monitor the topic in the nodelet.

Screenshot 2022-06-07 23:11:17

At first, the topic (/head_camera/depth_registered/hw_registered/image_rect_raw) like this works with normal hz. If hz drops for some reason, it will output error level diagnostics as follows:

Screenshot 2022-06-07 23:20:37

tkmtnt7000 commented 2 years ago

Nice feature! I confirmed that this node works well in Fetch15 and Fetch1075.

[http://fetch15:11311][133.11.216.217] fetch@fetch15:~$ rostopic echo /head_camera/rgb/image_raw/measured_hz
data: 29.7914276123
---
data: 29.7830791473
---