$search
00001 """autogenerated by genmsg_py from SetPenRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class SetPenRequest(roslib.message.Message): 00007 _md5sum = "9f452acce566bf0c0954594f69a8e41b" 00008 _type = "turtlesim/SetPenRequest" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """uint8 r 00011 uint8 g 00012 uint8 b 00013 uint8 width 00014 uint8 off 00015 00016 """ 00017 __slots__ = ['r','g','b','width','off'] 00018 _slot_types = ['uint8','uint8','uint8','uint8','uint8'] 00019 00020 def __init__(self, *args, **kwds): 00021 """ 00022 Constructor. Any message fields that are implicitly/explicitly 00023 set to None will be assigned a default value. The recommend 00024 use is keyword arguments as this is more robust to future message 00025 changes. You cannot mix in-order arguments and keyword arguments. 00026 00027 The available fields are: 00028 r,g,b,width,off 00029 00030 @param args: complete set of field values, in .msg order 00031 @param kwds: use keyword arguments corresponding to message field names 00032 to set specific fields. 00033 """ 00034 if args or kwds: 00035 super(SetPenRequest, self).__init__(*args, **kwds) 00036 #message fields cannot be None, assign default values for those that are 00037 if self.r is None: 00038 self.r = 0 00039 if self.g is None: 00040 self.g = 0 00041 if self.b is None: 00042 self.b = 0 00043 if self.width is None: 00044 self.width = 0 00045 if self.off is None: 00046 self.off = 0 00047 else: 00048 self.r = 0 00049 self.g = 0 00050 self.b = 0 00051 self.width = 0 00052 self.off = 0 00053 00054 def _get_types(self): 00055 """ 00056 internal API method 00057 """ 00058 return self._slot_types 00059 00060 def serialize(self, buff): 00061 """ 00062 serialize message into buffer 00063 @param buff: buffer 00064 @type buff: StringIO 00065 """ 00066 try: 00067 _x = self 00068 buff.write(_struct_5B.pack(_x.r, _x.g, _x.b, _x.width, _x.off)) 00069 except struct.error as se: self._check_types(se) 00070 except TypeError as te: self._check_types(te) 00071 00072 def deserialize(self, str): 00073 """ 00074 unpack serialized message in str into this message instance 00075 @param str: byte array of serialized message 00076 @type str: str 00077 """ 00078 try: 00079 end = 0 00080 _x = self 00081 start = end 00082 end += 5 00083 (_x.r, _x.g, _x.b, _x.width, _x.off,) = _struct_5B.unpack(str[start:end]) 00084 return self 00085 except struct.error as e: 00086 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00087 00088 00089 def serialize_numpy(self, buff, numpy): 00090 """ 00091 serialize message with numpy array types into buffer 00092 @param buff: buffer 00093 @type buff: StringIO 00094 @param numpy: numpy python module 00095 @type numpy module 00096 """ 00097 try: 00098 _x = self 00099 buff.write(_struct_5B.pack(_x.r, _x.g, _x.b, _x.width, _x.off)) 00100 except struct.error as se: self._check_types(se) 00101 except TypeError as te: self._check_types(te) 00102 00103 def deserialize_numpy(self, str, numpy): 00104 """ 00105 unpack serialized message in str into this message instance using numpy for array types 00106 @param str: byte array of serialized message 00107 @type str: str 00108 @param numpy: numpy python module 00109 @type numpy: module 00110 """ 00111 try: 00112 end = 0 00113 _x = self 00114 start = end 00115 end += 5 00116 (_x.r, _x.g, _x.b, _x.width, _x.off,) = _struct_5B.unpack(str[start:end]) 00117 return self 00118 except struct.error as e: 00119 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00120 00121 _struct_I = roslib.message.struct_I 00122 _struct_5B = struct.Struct("<5B") 00123 """autogenerated by genmsg_py from SetPenResponse.msg. Do not edit.""" 00124 import roslib.message 00125 import struct 00126 00127 00128 class SetPenResponse(roslib.message.Message): 00129 _md5sum = "d41d8cd98f00b204e9800998ecf8427e" 00130 _type = "turtlesim/SetPenResponse" 00131 _has_header = False #flag to mark the presence of a Header object 00132 _full_text = """ 00133 00134 """ 00135 __slots__ = [] 00136 _slot_types = [] 00137 00138 def __init__(self, *args, **kwds): 00139 """ 00140 Constructor. Any message fields that are implicitly/explicitly 00141 set to None will be assigned a default value. The recommend 00142 use is keyword arguments as this is more robust to future message 00143 changes. You cannot mix in-order arguments and keyword arguments. 00144 00145 The available fields are: 00146 00147 00148 @param args: complete set of field values, in .msg order 00149 @param kwds: use keyword arguments corresponding to message field names 00150 to set specific fields. 00151 """ 00152 if args or kwds: 00153 super(SetPenResponse, self).__init__(*args, **kwds) 00154 00155 def _get_types(self): 00156 """ 00157 internal API method 00158 """ 00159 return self._slot_types 00160 00161 def serialize(self, buff): 00162 """ 00163 serialize message into buffer 00164 @param buff: buffer 00165 @type buff: StringIO 00166 """ 00167 try: 00168 pass 00169 except struct.error as se: self._check_types(se) 00170 except TypeError as te: self._check_types(te) 00171 00172 def deserialize(self, str): 00173 """ 00174 unpack serialized message in str into this message instance 00175 @param str: byte array of serialized message 00176 @type str: str 00177 """ 00178 try: 00179 end = 0 00180 return self 00181 except struct.error as e: 00182 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00183 00184 00185 def serialize_numpy(self, buff, numpy): 00186 """ 00187 serialize message with numpy array types into buffer 00188 @param buff: buffer 00189 @type buff: StringIO 00190 @param numpy: numpy python module 00191 @type numpy module 00192 """ 00193 try: 00194 pass 00195 except struct.error as se: self._check_types(se) 00196 except TypeError as te: self._check_types(te) 00197 00198 def deserialize_numpy(self, str, numpy): 00199 """ 00200 unpack serialized message in str into this message instance using numpy for array types 00201 @param str: byte array of serialized message 00202 @type str: str 00203 @param numpy: numpy python module 00204 @type numpy: module 00205 """ 00206 try: 00207 end = 0 00208 return self 00209 except struct.error as e: 00210 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00211 00212 _struct_I = roslib.message.struct_I 00213 class SetPen(roslib.message.ServiceDefinition): 00214 _type = 'turtlesim/SetPen' 00215 _md5sum = '9f452acce566bf0c0954594f69a8e41b' 00216 _request_class = SetPenRequest 00217 _response_class = SetPenResponse