Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsk_topic_tools] Add diagnostic transport to ConnectionBasedTransport #1711

Merged
merged 16 commits into from May 30, 2022

Conversation

iory
Copy link
Member

@iory iory commented Feb 21, 2022

What is this?

This PR has added the ability to output diagnostics to the ConnectionBasedTransport.

Checking the node status by diagnostics

You can check diagnostics by setting ~enable_vital_check to true.

# terminal 1:
$ roslaunch jsk_topic_tools sample_connection_based_transport.launch

# terminal 2:
$ rostopic list
/diagnostics
/diagnostics_agg
/diagnostics_toplevel_state
/input
/input_dummy
/input_image
/mux/selected
/rosout
/rosout_agg
/simple_image_transport/output

# terminal 3:
$ rosrun rqt_robot_monitor rqt_robot_monitor

There is no one to subscribe to /simple_image_transport/output, so diagnostics is OK.

diagnostics_no_subscribers

# terminal 4:
rostopic echo /simple_image_transport/output

If you subscribe to /simple_image_transport/output,
it will change to the diagnostics message /simple_image_transport is running.

diagnostics_is_running

# terminal 5:
rosservice call /mux/select input_dummy

When changing input for simple_image_transport by mux, the error message will change to /simple_image_transport is not running.

diagnostics_is_not_running

You can check if the node is running correctly like these.

This class is a subclass of [`ConnectionBasedTransport`](python_connection_based_transport.html).
Instances of this class can publish diagnostics messages.
This is an abstruct class.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this feature is designed for human operator to observe the health of robot system on rqt_robot_monitor?, please add image of diagnostic viewer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I'll add it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -130,3 +134,47 @@ def advertise(self, *args, **kwargs):
pub = rospy.Publisher(*args, **kwargs)
self._publishers.append(pub)
return pub


class DiagnosticTransport(ConnectionBasedTransport):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of create new class, how about update ConnectionBasedTransport and enable this feature when /use_vital_check_on_connection_based_transport(or other good variable name) is true

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea!
I merge diagnostic function to ConnectionBasedTransport.
c8efdb1

@iory iory changed the title [jsk_topic_tools] Add diagnostic transport for python. [jsk_topic_tools] Add diagnostic transport to ConnectionBasedTransport Feb 22, 2022
Fixed vital_rate document.

Co-authored-by: Shingo Kitagawa <knorth55@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants