title: Converting Protobuf to ROS messages with similar functionality
body: <p>I recently inherited a large codebase at work utilizing MOOS &amp; Protobuf messages.</p>
  
  <p>At the request of my project lead, I am porting it to use exclusively ROS where ROS messages are used instead of protobuf. The code base heavily relies on utilizing protobuf functionality such as enumerator min / max, extracting a string from the variable field, ->has_variable() function, ->isValid(), etc.</p>
  
  <p>So far I have only been able to find very basic ROS message functionality from the wiki.</p>
  
  <p><strong>Are there any 'hacks' or the like to have this type of pliability?</strong></p>
  
  <p>Example: Protbufs support enumerators, but ROS messages don't, so I have:</p>
  
  <pre><code>  uint8 TYPE_FAILED        = 0
    uint8 TYPE_OPERATIONAL   = 1
    uint8 TYPE_INITIALIZING  = 2
  
    uint8 health_state_type
  </code></pre>
  
  <p>My <code>health_state_type</code> is my 'enumerator' but I don't have a min or max unless I hardcode one, and I can't extract <code>TYPE_FAILED</code> as a string.  I've been slowly finding workarounds for this by using </p>
  
  <pre><code>my_message::custom_msg health;
  health.health_state_type = health.TYPE_FAILED
  </code></pre>
  
  <p>But I'm having to modify many different areas that use it as a string, not integer.</p>