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