jsk-ros-pkg / jsk_common

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

[jsk_tools] Add node to publish diagnostics based on topic and node status #1727

Closed 708yamaguchi closed 2 years ago

708yamaguchi commented 2 years ago

This node checks topic and node status and publishes /diagnostics topic.

I refine https://github.com/jsk-ros-pkg/jsk_robot/pull/1460 by using sanity_lib.py. https://github.com/jsk-ros-pkg/jsk_common/blob/a3d26ac5243c108cec25d4108d93b3f0fd57c503/jsk_tools/src/jsk_tools/sanity_lib.py

$ rostopic echo /diagnostics
header: 
  seq: 1
  stamp: 
    secs: 1652277254
    nsecs: 167789936
  frame_id: ''
status: 
  - 
    level: 0
    name: "/respeaker_node"
    message: "Node is alive"
    hardware_id: ''
    values: []
  - 
    level: 0
    name: "/kinect_head/kinect_head_nodelet_manager"
    message: "Node is alive"
    hardware_id: ''
    values: []
---
header: 
  seq: 2
  stamp: 
    secs: 1652277254
    nsecs: 601408004
  frame_id: ''
status: 
  - 
    level: 0
    name: "/kinect_head/rgb/image_raw"
    message: "Topic is published"
    hardware_id: ''
    values: []
  - 
    level: 0
    name: "/tf"
    message: "Topic is published"
    hardware_id: ''
    values: []

In the future, I think robot speaks /diagnostics topic with this script. https://github.com/jsk-ros-pkg/jsk_common/pull/1607

708yamaguchi commented 2 years ago

fetch1075's rqt robot monitor

sanity_diagnostics

iory commented 2 years ago

This looks good! Could you add a test and sample like https://github.com/jsk-ros-pkg/jsk_common/pull/1711/files

708yamaguchi commented 2 years ago

Thank you for your review.

I add sample

roslaunch jsk_tools sample_sanity_diagnostics.launch

and test

rostest jsk_tools test_sanity_diagnostics.test 

Result: sanity_diagnostics

708yamaguchi commented 2 years ago

Sorry for force-push. I summerize commits 23 -> 6.

iory commented 2 years ago

This looks good. https://github.com/jsk-ros-pkg/jsk_common/runs/6422833587?check_suite_focus=true#step:7:9433 Please fix the test error.

708yamaguchi commented 2 years ago

Thank you!

I updated the code and fixed the test error.