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

rqt_plot: Plot bools #420

Closed
wants to merge 1 commit into from
Closed

Conversation

DLu
Copy link
Contributor

@DLu DLu commented Jan 6, 2017

Enhancement to allow plotting boolean fields/topics. Open to style suggestions.

if type(val)==std_msgs.msg.Bool:
val = val.data
if type(val)==bool:
return 1.0 if val else 0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

These two lines are not necessary. The following line already achieve the same conversion: float(True) -> 1.0 and float(False) -> 1.0.

@@ -42,7 +42,7 @@
import roslib.message
import roslib.names
import rospy

import std_msgs.msg
Copy link
Contributor

Choose a reason for hiding this comment

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

The package currently does not depend on std_msgs.

@dirk-thomas
Copy link
Contributor

Thank you for the patch. I applied the change to automatically extract the field from std_msgs.Bool in 097a3b3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants