You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The timestamp to be used by the TimeStampStatus class will be
extracted from message.header.stamp.
"""
self.tick(Time.from_msg(message.header.stamp))
self.publisher.publish(message)
See below a redacted example of the traceback when publishing a String message:
Traceback (most recent call last):
File "/home/username/catkin_ws/src/package/nodes/node.py", line 90, in <module>
test_node.run()
File "/home/username/catkin_ws/src/package/nodes/node.py", line 219, in run
self.monitored_pub.publish(m)
File "/opt/ros/melodic/lib/python2.7/dist-packages/diagnostic_updater/_publisher.py", line 143, in publish
self.tick(message.header.stamp)
AttributeError: 'String' object has no attribute 'header'
[test_node-1] process has died [pid 17561, exit code 1, cmd /home/username/catkin_ws/src/package/nodes/node.py __name:=test_node __log:=/home/username/.ros/log/c92fbda4-158b-11ee-9322-080027d21e5a/test_node-1.log].
log file: /home/username/.ros/log/c92fbda4-158b-11ee-9322-080027d21e5a/test_node-1*.log
I experienced this issue using the library in ROS 1, but the same situation is evidently present in the ROS 2 code.
The text was updated successfully, but these errors were encountered:
@ct2034 Following the pattern of the rest of this module a new class HeaderlessDiagnosedPublisher could be added.
This could look something like:
classHeaderlessDiagnosedPublisher(HeaderlessTopicDiagnostic):
""" A HeaderlessTopicDiagnostic combined with a ros::Publisher. For a standard ros::Publisher, this class allows the ros::Publisher and the HeaderlessTopicDiagnostic to be combined for added convenience. """def__init__(self, pub, diag, freq):
""" Construct a HeaderlessDiagnosedPublisher. @param pub The publisher on which statistics are being collected. @param diag The diagnostic_updater that the CompositeDiagnosticTask should add itself to. @param freq The parameters for the FrequencyStatus class that will be computing statistics. """HeaderlessTopicDiagnostic.__init__(self, pub.topic_name, diag, freq)
self.publisher=pubdefpublish(self, message):
""" Collect statistics and publishes the message. """self.tick()
self.publisher.publish(message)
When publishing a headerless topic the node crashes with an AttributeError.
This is because:
The issue is within the following lines:
diagnostics/diagnostic_updater/diagnostic_updater/_publisher.py
Lines 116 to 147 in c8941bb
See below a redacted example of the traceback when publishing a String message:
I experienced this issue using the library in ROS 1, but the same situation is evidently present in the ROS 2 code.
The text was updated successfully, but these errors were encountered: