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