CGR Localization
 All Classes Namespaces Files Functions Variables Macros Pages
_LocalizationInterfaceSrv.py
1 """autogenerated by genpy from cgr_localization/LocalizationInterfaceSrvRequest.msg. Do not edit."""
2 import sys
3 python3 = True if sys.hexversion > 0x03000000 else False
4 import genpy
5 import struct
6 
7 
8 class LocalizationInterfaceSrvRequest(genpy.Message):
9  _md5sum = "2ceaebd9cb848e7bc40a33bc0eec2cf4"
10  _type = "cgr_localization/LocalizationInterfaceSrvRequest"
11  _has_header = False #flag to mark the presence of a Header object
12  _full_text = """float32 loc_x
13 float32 loc_y
14 float32 orientation
15 string map
16 
17 
18 """
19  __slots__ = ['loc_x','loc_y','orientation','map']
20  _slot_types = ['float32','float32','float32','string']
21 
22  def __init__(self, *args, **kwds):
23  """
24  Constructor. Any message fields that are implicitly/explicitly
25  set to None will be assigned a default value. The recommend
26  use is keyword arguments as this is more robust to future message
27  changes. You cannot mix in-order arguments and keyword arguments.
28 
29  The available fields are:
30  loc_x,loc_y,orientation,map
31 
32  :param args: complete set of field values, in .msg order
33  :param kwds: use keyword arguments corresponding to message field names
34  to set specific fields.
35  """
36  if args or kwds:
37  super(LocalizationInterfaceSrvRequest, self).__init__(*args, **kwds)
38  #message fields cannot be None, assign default values for those that are
39  if self.loc_x is None:
40  self.loc_x = 0.
41  if self.loc_y is None:
42  self.loc_y = 0.
43  if self.orientation is None:
44  self.orientation = 0.
45  if self.map is None:
46  self.map = ''
47  else:
48  self.loc_x = 0.
49  self.loc_y = 0.
50  self.orientation = 0.
51  self.map = ''
52 
53  def _get_types(self):
54  """
55  internal API method
56  """
57  return self._slot_types
58 
59  def serialize(self, buff):
60  """
61  serialize message into buffer
62  :param buff: buffer, ``StringIO``
63  """
64  try:
65  _x = self
66  buff.write(_struct_3f.pack(_x.loc_x, _x.loc_y, _x.orientation))
67  _x = self.map
68  length = len(_x)
69  if python3 or type(_x) == unicode:
70  _x = _x.encode('utf-8')
71  length = len(_x)
72  if python3:
73  buff.write(struct.pack('<I%sB'%length, length, *_x))
74  else:
75  buff.write(struct.pack('<I%ss'%length, length, _x))
76  except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
77  except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
78 
79  def deserialize(self, str):
80  """
81  unpack serialized message in str into this message instance
82  :param str: byte array of serialized message, ``str``
83  """
84  try:
85  end = 0
86  _x = self
87  start = end
88  end += 12
89  (_x.loc_x, _x.loc_y, _x.orientation,) = _struct_3f.unpack(str[start:end])
90  start = end
91  end += 4
92  (length,) = _struct_I.unpack(str[start:end])
93  start = end
94  end += length
95  if python3:
96  self.map = str[start:end].decode('utf-8')
97  else:
98  self.map = str[start:end]
99  return self
100  except struct.error as e:
101  raise genpy.DeserializationError(e) #most likely buffer underfill
102 
103 
104  def serialize_numpy(self, buff, numpy):
105  """
106  serialize message with numpy array types into buffer
107  :param buff: buffer, ``StringIO``
108  :param numpy: numpy python module
109  """
110  try:
111  _x = self
112  buff.write(_struct_3f.pack(_x.loc_x, _x.loc_y, _x.orientation))
113  _x = self.map
114  length = len(_x)
115  if python3 or type(_x) == unicode:
116  _x = _x.encode('utf-8')
117  length = len(_x)
118  if python3:
119  buff.write(struct.pack('<I%sB'%length, length, *_x))
120  else:
121  buff.write(struct.pack('<I%ss'%length, length, _x))
122  except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
123  except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
124 
125  def deserialize_numpy(self, str, numpy):
126  """
127  unpack serialized message in str into this message instance using numpy for array types
128  :param str: byte array of serialized message, ``str``
129  :param numpy: numpy python module
130  """
131  try:
132  end = 0
133  _x = self
134  start = end
135  end += 12
136  (_x.loc_x, _x.loc_y, _x.orientation,) = _struct_3f.unpack(str[start:end])
137  start = end
138  end += 4
139  (length,) = _struct_I.unpack(str[start:end])
140  start = end
141  end += length
142  if python3:
143  self.map = str[start:end].decode('utf-8')
144  else:
145  self.map = str[start:end]
146  return self
147  except struct.error as e:
148  raise genpy.DeserializationError(e) #most likely buffer underfill
149 
150 _struct_I = genpy.struct_I
151 _struct_3f = struct.Struct("<3f")
152 """autogenerated by genpy from cgr_localization/LocalizationInterfaceSrvResponse.msg. Do not edit."""
153 import sys
154 python3 = True if sys.hexversion > 0x03000000 else False
155 import genpy
156 import struct
157 
158 
159 class LocalizationInterfaceSrvResponse(genpy.Message):
160  _md5sum = "d026719f68bb9c5550cfad15e8b7c86c"
161  _type = "cgr_localization/LocalizationInterfaceSrvResponse"
162  _has_header = False #flag to mark the presence of a Header object
163  _full_text = """
164 float32 loc_x
165 float32 loc_y
166 float32 orientation
167 
168 
169 """
170  __slots__ = ['loc_x','loc_y','orientation']
171  _slot_types = ['float32','float32','float32']
172 
173  def __init__(self, *args, **kwds):
174  """
175  Constructor. Any message fields that are implicitly/explicitly
176  set to None will be assigned a default value. The recommend
177  use is keyword arguments as this is more robust to future message
178  changes. You cannot mix in-order arguments and keyword arguments.
179 
180  The available fields are:
181  loc_x,loc_y,orientation
182 
183  :param args: complete set of field values, in .msg order
184  :param kwds: use keyword arguments corresponding to message field names
185  to set specific fields.
186  """
187  if args or kwds:
188  super(LocalizationInterfaceSrvResponse, self).__init__(*args, **kwds)
189  #message fields cannot be None, assign default values for those that are
190  if self.loc_x is None:
191  self.loc_x = 0.
192  if self.loc_y is None:
193  self.loc_y = 0.
194  if self.orientation is None:
195  self.orientation = 0.
196  else:
197  self.loc_x = 0.
198  self.loc_y = 0.
199  self.orientation = 0.
200 
201  def _get_types(self):
202  """
203  internal API method
204  """
205  return self._slot_types
206 
207  def serialize(self, buff):
208  """
209  serialize message into buffer
210  :param buff: buffer, ``StringIO``
211  """
212  try:
213  _x = self
214  buff.write(_struct_3f.pack(_x.loc_x, _x.loc_y, _x.orientation))
215  except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
216  except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
217 
218  def deserialize(self, str):
219  """
220  unpack serialized message in str into this message instance
221  :param str: byte array of serialized message, ``str``
222  """
223  try:
224  end = 0
225  _x = self
226  start = end
227  end += 12
228  (_x.loc_x, _x.loc_y, _x.orientation,) = _struct_3f.unpack(str[start:end])
229  return self
230  except struct.error as e:
231  raise genpy.DeserializationError(e) #most likely buffer underfill
232 
233 
234  def serialize_numpy(self, buff, numpy):
235  """
236  serialize message with numpy array types into buffer
237  :param buff: buffer, ``StringIO``
238  :param numpy: numpy python module
239  """
240  try:
241  _x = self
242  buff.write(_struct_3f.pack(_x.loc_x, _x.loc_y, _x.orientation))
243  except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
244  except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
245 
246  def deserialize_numpy(self, str, numpy):
247  """
248  unpack serialized message in str into this message instance using numpy for array types
249  :param str: byte array of serialized message, ``str``
250  :param numpy: numpy python module
251  """
252  try:
253  end = 0
254  _x = self
255  start = end
256  end += 12
257  (_x.loc_x, _x.loc_y, _x.orientation,) = _struct_3f.unpack(str[start:end])
258  return self
259  except struct.error as e:
260  raise genpy.DeserializationError(e) #most likely buffer underfill
261 
262 _struct_I = genpy.struct_I
263 _struct_3f = struct.Struct("<3f")
265  _type = 'cgr_localization/LocalizationInterfaceSrv'
266  _md5sum = 'a0134c4275a788c78e585db0543085bb'
267  _request_class = LocalizationInterfaceSrvRequest
268  _response_class = LocalizationInterfaceSrvResponse