class DiagnosticStatusWrapper(DiagnosticStatus):
Constructor: DiagnosticStatusWrapper(*args, **kwds)
Wrapper for the diagnostic_msgs::DiagnosticStatus message that makes it easier to update.
This class handles common string formatting and vector handling issues for filling the diagnostic_msgs::DiagnosticStatus message. It is a subclass of diagnostic_msgs::DiagnosticStatus, so it can be passed directly to diagnostic publish calls.
Method | __init__ |
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix in-order arguments and keyword arguments. |
Method | add |
Add a key-value pair. |
Method | clear |
Clears the summary, setting the level to zero and the message to "". |
Method | merge |
Merges a level and message with the existing ones. |
Method | summary |
Fills out the level and message fields of the DiagnosticStatus. |
Instance Variable | level |
Undocumented |
Instance Variable | message |
Undocumented |
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix in-order arguments and keyword arguments.
The available fields are: level,name,message,hardware_id,values
@param args: complete set of field values, in .msg order @param kwds: use keyword arguments corresponding to message field names to set specific fields.
Add a key-value pair.
This method adds a key-value pair. Any type that has a << stream operator can be passed as the second argument. Formatting is done using a std::stringstream.
@type key string @param key Key to be added. @type value string @param value Value to be added.
Merges a level and message with the existing ones.
It is sometimes useful to merge two DiagnosticStatus messages. In that case, the key value pairs can be unioned, but the level and summary message have to be merged more intelligently. This function does the merge in an intelligent manner, combining the summary in *this, with the one that is passed in.
The combined level is the greater of the two levels to be merged. If both levels are non-zero (not OK), the messages are combined with a semicolon separator. If only one level is zero, and the other is non-zero, the message for the zero level is discarded. If both are zero, the new message is ignored.
Usage: mergeSummary(diagnostic_status): merge from a DiagnosticStatus message mergeSummary(lvl,msg): sets from lvl and msg