CGR Localization
 All Classes Namespaces Files Functions Variables Macros Pages
_DisplayMsg.py
1 """autogenerated by genpy from cgr_localization/DisplayMsg.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 DisplayMsg(genpy.Message):
9  _md5sum = "20f2e94b57c956606f1d7505b08c9d10"
10  _type = "cgr_localization/DisplayMsg"
11  _has_header = False #flag to mark the presence of a Header object
12  _full_text = """float64 timestamp
13 
14 float64 robotLocX
15 float64 robotLocY
16 float64 robotAngle
17 
18 float64 windowSize
19 
20 float32[] lines_p1x
21 float32[] lines_p1y
22 float32[] lines_p2x
23 float32[] lines_p2y
24 uint32[] lines_col
25 
26 float32[] points_x
27 float32[] points_y
28 uint32[] points_col
29 
30 float32[] circles_x
31 float32[] circles_y
32 uint32[] circles_col
33 
34 """
35  __slots__ = ['timestamp','robotLocX','robotLocY','robotAngle','windowSize','lines_p1x','lines_p1y','lines_p2x','lines_p2y','lines_col','points_x','points_y','points_col','circles_x','circles_y','circles_col']
36  _slot_types = ['float64','float64','float64','float64','float64','float32[]','float32[]','float32[]','float32[]','uint32[]','float32[]','float32[]','uint32[]','float32[]','float32[]','uint32[]']
37 
38  def __init__(self, *args, **kwds):
39  """
40  Constructor. Any message fields that are implicitly/explicitly
41  set to None will be assigned a default value. The recommend
42  use is keyword arguments as this is more robust to future message
43  changes. You cannot mix in-order arguments and keyword arguments.
44 
45  The available fields are:
46  timestamp,robotLocX,robotLocY,robotAngle,windowSize,lines_p1x,lines_p1y,lines_p2x,lines_p2y,lines_col,points_x,points_y,points_col,circles_x,circles_y,circles_col
47 
48  :param args: complete set of field values, in .msg order
49  :param kwds: use keyword arguments corresponding to message field names
50  to set specific fields.
51  """
52  if args or kwds:
53  super(DisplayMsg, self).__init__(*args, **kwds)
54  #message fields cannot be None, assign default values for those that are
55  if self.timestamp is None:
56  self.timestamp = 0.
57  if self.robotLocX is None:
58  self.robotLocX = 0.
59  if self.robotLocY is None:
60  self.robotLocY = 0.
61  if self.robotAngle is None:
62  self.robotAngle = 0.
63  if self.windowSize is None:
64  self.windowSize = 0.
65  if self.lines_p1x is None:
66  self.lines_p1x = []
67  if self.lines_p1y is None:
68  self.lines_p1y = []
69  if self.lines_p2x is None:
70  self.lines_p2x = []
71  if self.lines_p2y is None:
72  self.lines_p2y = []
73  if self.lines_col is None:
74  self.lines_col = []
75  if self.points_x is None:
76  self.points_x = []
77  if self.points_y is None:
78  self.points_y = []
79  if self.points_col is None:
80  self.points_col = []
81  if self.circles_x is None:
82  self.circles_x = []
83  if self.circles_y is None:
84  self.circles_y = []
85  if self.circles_col is None:
86  self.circles_col = []
87  else:
88  self.timestamp = 0.
89  self.robotLocX = 0.
90  self.robotLocY = 0.
91  self.robotAngle = 0.
92  self.windowSize = 0.
93  self.lines_p1x = []
94  self.lines_p1y = []
95  self.lines_p2x = []
96  self.lines_p2y = []
97  self.lines_col = []
98  self.points_x = []
99  self.points_y = []
100  self.points_col = []
101  self.circles_x = []
102  self.circles_y = []
103  self.circles_col = []
104 
105  def _get_types(self):
106  """
107  internal API method
108  """
109  return self._slot_types
110 
111  def serialize(self, buff):
112  """
113  serialize message into buffer
114  :param buff: buffer, ``StringIO``
115  """
116  try:
117  _x = self
118  buff.write(_struct_5d.pack(_x.timestamp, _x.robotLocX, _x.robotLocY, _x.robotAngle, _x.windowSize))
119  length = len(self.lines_p1x)
120  buff.write(_struct_I.pack(length))
121  pattern = '<%sf'%length
122  buff.write(struct.pack(pattern, *self.lines_p1x))
123  length = len(self.lines_p1y)
124  buff.write(_struct_I.pack(length))
125  pattern = '<%sf'%length
126  buff.write(struct.pack(pattern, *self.lines_p1y))
127  length = len(self.lines_p2x)
128  buff.write(_struct_I.pack(length))
129  pattern = '<%sf'%length
130  buff.write(struct.pack(pattern, *self.lines_p2x))
131  length = len(self.lines_p2y)
132  buff.write(_struct_I.pack(length))
133  pattern = '<%sf'%length
134  buff.write(struct.pack(pattern, *self.lines_p2y))
135  length = len(self.lines_col)
136  buff.write(_struct_I.pack(length))
137  pattern = '<%sI'%length
138  buff.write(struct.pack(pattern, *self.lines_col))
139  length = len(self.points_x)
140  buff.write(_struct_I.pack(length))
141  pattern = '<%sf'%length
142  buff.write(struct.pack(pattern, *self.points_x))
143  length = len(self.points_y)
144  buff.write(_struct_I.pack(length))
145  pattern = '<%sf'%length
146  buff.write(struct.pack(pattern, *self.points_y))
147  length = len(self.points_col)
148  buff.write(_struct_I.pack(length))
149  pattern = '<%sI'%length
150  buff.write(struct.pack(pattern, *self.points_col))
151  length = len(self.circles_x)
152  buff.write(_struct_I.pack(length))
153  pattern = '<%sf'%length
154  buff.write(struct.pack(pattern, *self.circles_x))
155  length = len(self.circles_y)
156  buff.write(_struct_I.pack(length))
157  pattern = '<%sf'%length
158  buff.write(struct.pack(pattern, *self.circles_y))
159  length = len(self.circles_col)
160  buff.write(_struct_I.pack(length))
161  pattern = '<%sI'%length
162  buff.write(struct.pack(pattern, *self.circles_col))
163  except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
164  except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
165 
166  def deserialize(self, str):
167  """
168  unpack serialized message in str into this message instance
169  :param str: byte array of serialized message, ``str``
170  """
171  try:
172  end = 0
173  _x = self
174  start = end
175  end += 40
176  (_x.timestamp, _x.robotLocX, _x.robotLocY, _x.robotAngle, _x.windowSize,) = _struct_5d.unpack(str[start:end])
177  start = end
178  end += 4
179  (length,) = _struct_I.unpack(str[start:end])
180  pattern = '<%sf'%length
181  start = end
182  end += struct.calcsize(pattern)
183  self.lines_p1x = struct.unpack(pattern, str[start:end])
184  start = end
185  end += 4
186  (length,) = _struct_I.unpack(str[start:end])
187  pattern = '<%sf'%length
188  start = end
189  end += struct.calcsize(pattern)
190  self.lines_p1y = struct.unpack(pattern, str[start:end])
191  start = end
192  end += 4
193  (length,) = _struct_I.unpack(str[start:end])
194  pattern = '<%sf'%length
195  start = end
196  end += struct.calcsize(pattern)
197  self.lines_p2x = struct.unpack(pattern, str[start:end])
198  start = end
199  end += 4
200  (length,) = _struct_I.unpack(str[start:end])
201  pattern = '<%sf'%length
202  start = end
203  end += struct.calcsize(pattern)
204  self.lines_p2y = struct.unpack(pattern, str[start:end])
205  start = end
206  end += 4
207  (length,) = _struct_I.unpack(str[start:end])
208  pattern = '<%sI'%length
209  start = end
210  end += struct.calcsize(pattern)
211  self.lines_col = struct.unpack(pattern, str[start:end])
212  start = end
213  end += 4
214  (length,) = _struct_I.unpack(str[start:end])
215  pattern = '<%sf'%length
216  start = end
217  end += struct.calcsize(pattern)
218  self.points_x = struct.unpack(pattern, str[start:end])
219  start = end
220  end += 4
221  (length,) = _struct_I.unpack(str[start:end])
222  pattern = '<%sf'%length
223  start = end
224  end += struct.calcsize(pattern)
225  self.points_y = struct.unpack(pattern, str[start:end])
226  start = end
227  end += 4
228  (length,) = _struct_I.unpack(str[start:end])
229  pattern = '<%sI'%length
230  start = end
231  end += struct.calcsize(pattern)
232  self.points_col = struct.unpack(pattern, str[start:end])
233  start = end
234  end += 4
235  (length,) = _struct_I.unpack(str[start:end])
236  pattern = '<%sf'%length
237  start = end
238  end += struct.calcsize(pattern)
239  self.circles_x = struct.unpack(pattern, str[start:end])
240  start = end
241  end += 4
242  (length,) = _struct_I.unpack(str[start:end])
243  pattern = '<%sf'%length
244  start = end
245  end += struct.calcsize(pattern)
246  self.circles_y = struct.unpack(pattern, str[start:end])
247  start = end
248  end += 4
249  (length,) = _struct_I.unpack(str[start:end])
250  pattern = '<%sI'%length
251  start = end
252  end += struct.calcsize(pattern)
253  self.circles_col = struct.unpack(pattern, str[start:end])
254  return self
255  except struct.error as e:
256  raise genpy.DeserializationError(e) #most likely buffer underfill
257 
258 
259  def serialize_numpy(self, buff, numpy):
260  """
261  serialize message with numpy array types into buffer
262  :param buff: buffer, ``StringIO``
263  :param numpy: numpy python module
264  """
265  try:
266  _x = self
267  buff.write(_struct_5d.pack(_x.timestamp, _x.robotLocX, _x.robotLocY, _x.robotAngle, _x.windowSize))
268  length = len(self.lines_p1x)
269  buff.write(_struct_I.pack(length))
270  pattern = '<%sf'%length
271  buff.write(self.lines_p1x.tostring())
272  length = len(self.lines_p1y)
273  buff.write(_struct_I.pack(length))
274  pattern = '<%sf'%length
275  buff.write(self.lines_p1y.tostring())
276  length = len(self.lines_p2x)
277  buff.write(_struct_I.pack(length))
278  pattern = '<%sf'%length
279  buff.write(self.lines_p2x.tostring())
280  length = len(self.lines_p2y)
281  buff.write(_struct_I.pack(length))
282  pattern = '<%sf'%length
283  buff.write(self.lines_p2y.tostring())
284  length = len(self.lines_col)
285  buff.write(_struct_I.pack(length))
286  pattern = '<%sI'%length
287  buff.write(self.lines_col.tostring())
288  length = len(self.points_x)
289  buff.write(_struct_I.pack(length))
290  pattern = '<%sf'%length
291  buff.write(self.points_x.tostring())
292  length = len(self.points_y)
293  buff.write(_struct_I.pack(length))
294  pattern = '<%sf'%length
295  buff.write(self.points_y.tostring())
296  length = len(self.points_col)
297  buff.write(_struct_I.pack(length))
298  pattern = '<%sI'%length
299  buff.write(self.points_col.tostring())
300  length = len(self.circles_x)
301  buff.write(_struct_I.pack(length))
302  pattern = '<%sf'%length
303  buff.write(self.circles_x.tostring())
304  length = len(self.circles_y)
305  buff.write(_struct_I.pack(length))
306  pattern = '<%sf'%length
307  buff.write(self.circles_y.tostring())
308  length = len(self.circles_col)
309  buff.write(_struct_I.pack(length))
310  pattern = '<%sI'%length
311  buff.write(self.circles_col.tostring())
312  except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
313  except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
314 
315  def deserialize_numpy(self, str, numpy):
316  """
317  unpack serialized message in str into this message instance using numpy for array types
318  :param str: byte array of serialized message, ``str``
319  :param numpy: numpy python module
320  """
321  try:
322  end = 0
323  _x = self
324  start = end
325  end += 40
326  (_x.timestamp, _x.robotLocX, _x.robotLocY, _x.robotAngle, _x.windowSize,) = _struct_5d.unpack(str[start:end])
327  start = end
328  end += 4
329  (length,) = _struct_I.unpack(str[start:end])
330  pattern = '<%sf'%length
331  start = end
332  end += struct.calcsize(pattern)
333  self.lines_p1x = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
334  start = end
335  end += 4
336  (length,) = _struct_I.unpack(str[start:end])
337  pattern = '<%sf'%length
338  start = end
339  end += struct.calcsize(pattern)
340  self.lines_p1y = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
341  start = end
342  end += 4
343  (length,) = _struct_I.unpack(str[start:end])
344  pattern = '<%sf'%length
345  start = end
346  end += struct.calcsize(pattern)
347  self.lines_p2x = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
348  start = end
349  end += 4
350  (length,) = _struct_I.unpack(str[start:end])
351  pattern = '<%sf'%length
352  start = end
353  end += struct.calcsize(pattern)
354  self.lines_p2y = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
355  start = end
356  end += 4
357  (length,) = _struct_I.unpack(str[start:end])
358  pattern = '<%sI'%length
359  start = end
360  end += struct.calcsize(pattern)
361  self.lines_col = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
362  start = end
363  end += 4
364  (length,) = _struct_I.unpack(str[start:end])
365  pattern = '<%sf'%length
366  start = end
367  end += struct.calcsize(pattern)
368  self.points_x = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
369  start = end
370  end += 4
371  (length,) = _struct_I.unpack(str[start:end])
372  pattern = '<%sf'%length
373  start = end
374  end += struct.calcsize(pattern)
375  self.points_y = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
376  start = end
377  end += 4
378  (length,) = _struct_I.unpack(str[start:end])
379  pattern = '<%sI'%length
380  start = end
381  end += struct.calcsize(pattern)
382  self.points_col = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
383  start = end
384  end += 4
385  (length,) = _struct_I.unpack(str[start:end])
386  pattern = '<%sf'%length
387  start = end
388  end += struct.calcsize(pattern)
389  self.circles_x = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
390  start = end
391  end += 4
392  (length,) = _struct_I.unpack(str[start:end])
393  pattern = '<%sf'%length
394  start = end
395  end += struct.calcsize(pattern)
396  self.circles_y = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
397  start = end
398  end += 4
399  (length,) = _struct_I.unpack(str[start:end])
400  pattern = '<%sI'%length
401  start = end
402  end += struct.calcsize(pattern)
403  self.circles_col = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
404  return self
405  except struct.error as e:
406  raise genpy.DeserializationError(e) #most likely buffer underfill
407 
408 _struct_I = genpy.struct_I
409 _struct_5d = struct.Struct("<5d")