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