_IOadrCommand.py
Go to the documentation of this file.
00001 """autogenerated by genpy from art_msgs/IOadrCommand.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import std_msgs.msg
00008 
00009 class IOadrCommand(genpy.Message):
00010   _md5sum = "1ba0a21767ee8a4bb7c80945f20b670c"
00011   _type = "art_msgs/IOadrCommand"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """# NCD IOADR8x controller command message for ART vehicle
00014 #
00015 # Sets or clears relays.  See: IOadrState for bit definitions.
00016 
00017 # $Id: IOadrCommand.msg 644 2010-09-28 03:19:07Z jack.oquin $
00018 
00019 Header  header          # standard ROS message header
00020 
00021 uint8 relays_on         # relays to set
00022 uint8 relays_off        # relays to clear
00023 
00024 ================================================================================
00025 MSG: std_msgs/Header
00026 # Standard metadata for higher-level stamped data types.
00027 # This is generally used to communicate timestamped data 
00028 # in a particular coordinate frame.
00029 # 
00030 # sequence ID: consecutively increasing ID 
00031 uint32 seq
00032 #Two-integer timestamp that is expressed as:
00033 # * stamp.secs: seconds (stamp_secs) since epoch
00034 # * stamp.nsecs: nanoseconds since stamp_secs
00035 # time-handling sugar is provided by the client library
00036 time stamp
00037 #Frame this data is associated with
00038 # 0: no frame
00039 # 1: global frame
00040 string frame_id
00041 
00042 """
00043   __slots__ = ['header','relays_on','relays_off']
00044   _slot_types = ['std_msgs/Header','uint8','uint8']
00045 
00046   def __init__(self, *args, **kwds):
00047     """
00048     Constructor. Any message fields that are implicitly/explicitly
00049     set to None will be assigned a default value. The recommend
00050     use is keyword arguments as this is more robust to future message
00051     changes.  You cannot mix in-order arguments and keyword arguments.
00052 
00053     The available fields are:
00054        header,relays_on,relays_off
00055 
00056     :param args: complete set of field values, in .msg order
00057     :param kwds: use keyword arguments corresponding to message field names
00058     to set specific fields.
00059     """
00060     if args or kwds:
00061       super(IOadrCommand, self).__init__(*args, **kwds)
00062       #message fields cannot be None, assign default values for those that are
00063       if self.header is None:
00064         self.header = std_msgs.msg.Header()
00065       if self.relays_on is None:
00066         self.relays_on = 0
00067       if self.relays_off is None:
00068         self.relays_off = 0
00069     else:
00070       self.header = std_msgs.msg.Header()
00071       self.relays_on = 0
00072       self.relays_off = 0
00073 
00074   def _get_types(self):
00075     """
00076     internal API method
00077     """
00078     return self._slot_types
00079 
00080   def serialize(self, buff):
00081     """
00082     serialize message into buffer
00083     :param buff: buffer, ``StringIO``
00084     """
00085     try:
00086       _x = self
00087       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00088       _x = self.header.frame_id
00089       length = len(_x)
00090       if python3 or type(_x) == unicode:
00091         _x = _x.encode('utf-8')
00092         length = len(_x)
00093       buff.write(struct.pack('<I%ss'%length, length, _x))
00094       _x = self
00095       buff.write(_struct_2B.pack(_x.relays_on, _x.relays_off))
00096     except struct.error as se: self._check_types(se)
00097     except TypeError as te: self._check_types(te)
00098 
00099   def deserialize(self, str):
00100     """
00101     unpack serialized message in str into this message instance
00102     :param str: byte array of serialized message, ``str``
00103     """
00104     try:
00105       if self.header is None:
00106         self.header = std_msgs.msg.Header()
00107       end = 0
00108       _x = self
00109       start = end
00110       end += 12
00111       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00112       start = end
00113       end += 4
00114       (length,) = _struct_I.unpack(str[start:end])
00115       start = end
00116       end += length
00117       if python3:
00118         self.header.frame_id = str[start:end].decode('utf-8')
00119       else:
00120         self.header.frame_id = str[start:end]
00121       _x = self
00122       start = end
00123       end += 2
00124       (_x.relays_on, _x.relays_off,) = _struct_2B.unpack(str[start:end])
00125       return self
00126     except struct.error as e:
00127       raise genpy.DeserializationError(e) #most likely buffer underfill
00128 
00129 
00130   def serialize_numpy(self, buff, numpy):
00131     """
00132     serialize message with numpy array types into buffer
00133     :param buff: buffer, ``StringIO``
00134     :param numpy: numpy python module
00135     """
00136     try:
00137       _x = self
00138       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00139       _x = self.header.frame_id
00140       length = len(_x)
00141       if python3 or type(_x) == unicode:
00142         _x = _x.encode('utf-8')
00143         length = len(_x)
00144       buff.write(struct.pack('<I%ss'%length, length, _x))
00145       _x = self
00146       buff.write(_struct_2B.pack(_x.relays_on, _x.relays_off))
00147     except struct.error as se: self._check_types(se)
00148     except TypeError as te: self._check_types(te)
00149 
00150   def deserialize_numpy(self, str, numpy):
00151     """
00152     unpack serialized message in str into this message instance using numpy for array types
00153     :param str: byte array of serialized message, ``str``
00154     :param numpy: numpy python module
00155     """
00156     try:
00157       if self.header is None:
00158         self.header = std_msgs.msg.Header()
00159       end = 0
00160       _x = self
00161       start = end
00162       end += 12
00163       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00164       start = end
00165       end += 4
00166       (length,) = _struct_I.unpack(str[start:end])
00167       start = end
00168       end += length
00169       if python3:
00170         self.header.frame_id = str[start:end].decode('utf-8')
00171       else:
00172         self.header.frame_id = str[start:end]
00173       _x = self
00174       start = end
00175       end += 2
00176       (_x.relays_on, _x.relays_off,) = _struct_2B.unpack(str[start:end])
00177       return self
00178     except struct.error as e:
00179       raise genpy.DeserializationError(e) #most likely buffer underfill
00180 
00181 _struct_I = genpy.struct_I
00182 _struct_3I = struct.Struct("<3I")
00183 _struct_2B = struct.Struct("<2B")


art_msgs
Author(s): Jack O'Quin
autogenerated on Fri Jan 3 2014 11:08:05