text: // Auto-generated. Do not edit!
  
  // (in-package rover20_state_mach.msg)
  
  
  "use strict";
  
  const _serializer = _ros_msg_utils.Serialize;
  const _arraySerializer = _serializer.Array;
  const _deserializer = _ros_msg_utils.Deserialize;
  const _arrayDeserializer = _deserializer.Array;
  const _finder = _ros_msg_utils.Find;
  const _getByteLength = _ros_msg_utils.getByteLength;
  let std_msgs = _finder('std_msgs');
  
  //-----------------------------------------------------------
  
  class StateMsg {
    constructor(initObj={}) {
      if (initObj === null) {
        // initObj === null is a special case for deserialization where we don't initialize fields
        this.header = null;
        this.state = null;
      }
      else {
        if (initObj.hasOwnProperty('header')) {
          this.header = initObj.header
        }
        else {
          this.header = new std_msgs.msg.Header();
        }
        if (initObj.hasOwnProperty('state')) {
          this.state = initObj.state
        }
        else {
          this.state = 0;
        }
      }
    }
  
    static serialize(obj, buffer, bufferOffset) {
      // Serializes a message object of type StateMsg
      // Serialize message field [header]
      bufferOffset = std_msgs.msg.Header.serialize(obj.header, buffer, bufferOffset);
      // Serialize message field [state]
      bufferOffset = _serializer.byte(obj.state, buffer, bufferOffset);
      return bufferOffset;
    }
  
    static deserialize(buffer, bufferOffset=[0]) {
      //deserializes a message object of type StateMsg
      let len;
      let data = new StateMsg(null);
      // Deserialize message field [header]
      data.header = std_msgs.msg.Header.deserialize(buffer, bufferOffset);
      // Deserialize message field [state]
      data.state = _deserializer.byte(buffer, bufferOffset);
      return data;
    }
  
    static getMessageSize(object) {
      let length = 0;
      length += std_msgs.msg.Header.getMessageSize(object.header);
      return length + 1;
    }
  
    static datatype() {
      // Returns string type for a message object
      return 'rover20_state_mach/StateMsg';
    }
  
    static md5sum() {
      //Returns md5sum for a message object
      return 'bb3cba5455b3506b2a8435bf0f050c07';
    }
  
    static messageDefinition() {
      // Returns full string definition for message
      return `
      std_msgs/Header header
      
      byte INITIALISE = 0
      byte READY = 1
      byte REACH_GPS = 2
      byte FIND_ARTAG = 3
      byte REACH_ARTAG = 4
      byte APPROACH = 5
      byte PASS_GATE = 6
      byte DEINITIALISE = 7
      byte ERROR = 8
      
      
      byte state
      
      ================================================================================
      MSG: std_msgs/Header
      # Standard metadata for higher-level stamped data types.
      # This is generally used to communicate timestamped data 
      # in a particular coordinate frame.
      # 
      # sequence ID: consecutively increasing ID 
      uint32 seq
      #Two-integer timestamp that is expressed as:
      # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')
      # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')
      # time-handling sugar is provided by the client library
      time stamp
      #Frame this data is associated with
      # 0: no frame
      # 1: global frame
      string frame_id
      
      `;
    }
  
    static Resolve(msg) {
      // deep-construct a valid message object instance of whatever was passed in
      if (typeof msg !== 'object' || msg === null) {
        msg = {};
      }
      const resolved = new StateMsg(null);
      if (msg.header !== undefined) {
        resolved.header = std_msgs.msg.Header.Resolve(msg.header)
      }
      else {
        resolved.header = new std_msgs.msg.Header()
      }
  
      if (msg.state !== undefined) {
        resolved.state = msg.state;
      }
      else {
        resolved.state = 0
      }
  
      return resolved;
      }
  };
  
  // Constants for message
  StateMsg.Constants = {
    INITIALISE: 0,
    READY: 1,
    REACH_GPS: 2,
    FIND_ARTAG: 3,
    REACH_ARTAG: 4,
    APPROACH: 5,
    PASS_GATE: 6,
    DEINITIALISE: 7,
    ERROR: 8,
  }
  
  module.exports = StateMsg;
  