_PointCloudMessage.py
Go to the documentation of this file.
1 """autogenerated by genpy from next_best_view/PointCloudMessage.msg. Do not edit."""
2 import sys
3 python3 = True if sys.hexversion > 0x03000000 else False
4 import genpy
5 import struct
6 
7 import geometry_msgs.msg
8 import asr_next_best_view.msg
9 
10 class PointCloudMessage(genpy.Message):
11  _md5sum = "fc8288a0cdd89ce554a8f9e4bb864989"
12  _type = "asr_next_best_view/PointCloudMessage"
13  _has_header = False #flag to mark the presence of a Header object
14  _full_text = """# PointCloud Elements
15 PointCloudElement[] elements
16 ================================================================================
17 MSG: asr_next_best_view/PointCloudElement
18 
19 string object_type
20 geometry_msgs/Pose pose
21 ================================================================================
22 MSG: geometry_msgs/Pose
23 # A representation of pose in free space, composed of postion and orientation.
24 Point position
25 Quaternion orientation
26 
27 ================================================================================
28 MSG: geometry_msgs/Point
29 # This contains the position of a point in free space
30 float64 x
31 float64 y
32 float64 z
33 
34 ================================================================================
35 MSG: geometry_msgs/Quaternion
36 # This represents an orientation in free space in quaternion form.
37 
38 float64 x
39 float64 y
40 float64 z
41 float64 w
42 
43 """
44  __slots__ = ['elements']
45  _slot_types = ['asr_next_best_view/PointCloudElement[]']
46 
47  def __init__(self, *args, **kwds):
48  """
49  Constructor. Any message fields that are implicitly/explicitly
50  set to None will be assigned a default value. The recommend
51  use is keyword arguments as this is more robust to future message
52  changes. You cannot mix in-order arguments and keyword arguments.
53 
54  The available fields are:
55  elements
56 
57  :param args: complete set of field values, in .msg order
58  :param kwds: use keyword arguments corresponding to message field names
59  to set specific fields.
60  """
61  if args or kwds:
62  super(PointCloudMessage, self).__init__(*args, **kwds)
63  #message fields cannot be None, assign default values for those that are
64  if self.elements is None:
65  self.elements = []
66  else:
67  self.elements = []
68 
69  def _get_types(self):
70  """
71  internal API method
72  """
73  return self._slot_types
74 
75  def serialize(self, buff):
76  """
77  serialize message into buffer
78  :param buff: buffer, ``StringIO``
79  """
80  try:
81  length = len(self.elements)
82  buff.write(_struct_I.pack(length))
83  for val1 in self.elements:
84  _x = val1.object_type
85  length = len(_x)
86  if python3 or type(_x) == unicode:
87  _x = _x.encode('utf-8')
88  length = len(_x)
89  buff.write(struct.pack('<I%ss'%length, length, _x))
90  _v1 = val1.pose
91  _v2 = _v1.position
92  _x = _v2
93  buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
94  _v3 = _v1.orientation
95  _x = _v3
96  buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
97  except struct.error as se: self._check_types(se)
98  except TypeError as te: self._check_types(te)
99 
100  def deserialize(self, str):
101  """
102  unpack serialized message in str into this message instance
103  :param str: byte array of serialized message, ``str``
104  """
105  try:
106  if self.elements is None:
107  self.elements = None
108  end = 0
109  start = end
110  end += 4
111  (length,) = _struct_I.unpack(str[start:end])
112  self.elements = []
113  for i in range(0, length):
114  val1 = asr_next_best_view.msg.PointCloudElement()
115  start = end
116  end += 4
117  (length,) = _struct_I.unpack(str[start:end])
118  start = end
119  end += length
120  if python3:
121  val1.object_type = str[start:end].decode('utf-8')
122  else:
123  val1.object_type = str[start:end]
124  _v4 = val1.pose
125  _v5 = _v4.position
126  _x = _v5
127  start = end
128  end += 24
129  (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
130  _v6 = _v4.orientation
131  _x = _v6
132  start = end
133  end += 32
134  (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
135  self.elements.append(val1)
136  return self
137  except struct.error as e:
138  raise genpy.DeserializationError(e) #most likely buffer underfill
139 
140 
141  def serialize_numpy(self, buff, numpy):
142  """
143  serialize message with numpy array types into buffer
144  :param buff: buffer, ``StringIO``
145  :param numpy: numpy python module
146  """
147  try:
148  length = len(self.elements)
149  buff.write(_struct_I.pack(length))
150  for val1 in self.elements:
151  _x = val1.object_type
152  length = len(_x)
153  if python3 or type(_x) == unicode:
154  _x = _x.encode('utf-8')
155  length = len(_x)
156  buff.write(struct.pack('<I%ss'%length, length, _x))
157  _v7 = val1.pose
158  _v8 = _v7.position
159  _x = _v8
160  buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
161  _v9 = _v7.orientation
162  _x = _v9
163  buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
164  except struct.error as se: self._check_types(se)
165  except TypeError as te: self._check_types(te)
166 
167  def deserialize_numpy(self, str, numpy):
168  """
169  unpack serialized message in str into this message instance using numpy for array types
170  :param str: byte array of serialized message, ``str``
171  :param numpy: numpy python module
172  """
173  try:
174  if self.elements is None:
175  self.elements = None
176  end = 0
177  start = end
178  end += 4
179  (length,) = _struct_I.unpack(str[start:end])
180  self.elements = []
181  for i in range(0, length):
182  val1 = asr_next_best_view.msg.PointCloudElement()
183  start = end
184  end += 4
185  (length,) = _struct_I.unpack(str[start:end])
186  start = end
187  end += length
188  if python3:
189  val1.object_type = str[start:end].decode('utf-8')
190  else:
191  val1.object_type = str[start:end]
192  _v10 = val1.pose
193  _v11 = _v10.position
194  _x = _v11
195  start = end
196  end += 24
197  (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
198  _v12 = _v10.orientation
199  _x = _v12
200  start = end
201  end += 32
202  (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
203  self.elements.append(val1)
204  return self
205  except struct.error as e:
206  raise genpy.DeserializationError(e) #most likely buffer underfill
207 
208 _struct_I = genpy.struct_I
209 _struct_4d = struct.Struct("<4d")
210 _struct_3d = struct.Struct("<3d")


asr_next_best_view
Author(s): Aumann Florian, Borella Jocelyn, Heller Florian, Meißner Pascal, Schleicher Ralf, Stöckle Patrick, Stroh Daniel, Trautmann Jeremias, Walter Milena, Wittenbeck Valerij
autogenerated on Thu Jan 9 2020 07:20:18