00001 """autogenerated by genpy from nasa_r2_common_msgs/PoseState.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import geometry_msgs.msg
00008 import std_msgs.msg
00009
00010 class PoseState(genpy.Message):
00011 _md5sum = "69e7de9596413863e5d6f72f4d5cd77e"
00012 _type = "nasa_r2_common_msgs/PoseState"
00013 _has_header = True
00014 _full_text = """Header header
00015 string[] name
00016 geometry_msgs/Pose[] positions
00017 geometry_msgs/Twist[] velocities
00018 geometry_msgs/Twist[] accelerations
00019
00020 ================================================================================
00021 MSG: std_msgs/Header
00022 # Standard metadata for higher-level stamped data types.
00023 # This is generally used to communicate timestamped data
00024 # in a particular coordinate frame.
00025 #
00026 # sequence ID: consecutively increasing ID
00027 uint32 seq
00028 #Two-integer timestamp that is expressed as:
00029 # * stamp.secs: seconds (stamp_secs) since epoch
00030 # * stamp.nsecs: nanoseconds since stamp_secs
00031 # time-handling sugar is provided by the client library
00032 time stamp
00033 #Frame this data is associated with
00034 # 0: no frame
00035 # 1: global frame
00036 string frame_id
00037
00038 ================================================================================
00039 MSG: geometry_msgs/Pose
00040 # A representation of pose in free space, composed of postion and orientation.
00041 Point position
00042 Quaternion orientation
00043
00044 ================================================================================
00045 MSG: geometry_msgs/Point
00046 # This contains the position of a point in free space
00047 float64 x
00048 float64 y
00049 float64 z
00050
00051 ================================================================================
00052 MSG: geometry_msgs/Quaternion
00053 # This represents an orientation in free space in quaternion form.
00054
00055 float64 x
00056 float64 y
00057 float64 z
00058 float64 w
00059
00060 ================================================================================
00061 MSG: geometry_msgs/Twist
00062 # This expresses velocity in free space broken into its linear and angular parts.
00063 Vector3 linear
00064 Vector3 angular
00065
00066 ================================================================================
00067 MSG: geometry_msgs/Vector3
00068 # This represents a vector in free space.
00069
00070 float64 x
00071 float64 y
00072 float64 z
00073 """
00074 __slots__ = ['header','name','positions','velocities','accelerations']
00075 _slot_types = ['std_msgs/Header','string[]','geometry_msgs/Pose[]','geometry_msgs/Twist[]','geometry_msgs/Twist[]']
00076
00077 def __init__(self, *args, **kwds):
00078 """
00079 Constructor. Any message fields that are implicitly/explicitly
00080 set to None will be assigned a default value. The recommend
00081 use is keyword arguments as this is more robust to future message
00082 changes. You cannot mix in-order arguments and keyword arguments.
00083
00084 The available fields are:
00085 header,name,positions,velocities,accelerations
00086
00087 :param args: complete set of field values, in .msg order
00088 :param kwds: use keyword arguments corresponding to message field names
00089 to set specific fields.
00090 """
00091 if args or kwds:
00092 super(PoseState, self).__init__(*args, **kwds)
00093
00094 if self.header is None:
00095 self.header = std_msgs.msg.Header()
00096 if self.name is None:
00097 self.name = []
00098 if self.positions is None:
00099 self.positions = []
00100 if self.velocities is None:
00101 self.velocities = []
00102 if self.accelerations is None:
00103 self.accelerations = []
00104 else:
00105 self.header = std_msgs.msg.Header()
00106 self.name = []
00107 self.positions = []
00108 self.velocities = []
00109 self.accelerations = []
00110
00111 def _get_types(self):
00112 """
00113 internal API method
00114 """
00115 return self._slot_types
00116
00117 def serialize(self, buff):
00118 """
00119 serialize message into buffer
00120 :param buff: buffer, ``StringIO``
00121 """
00122 try:
00123 _x = self
00124 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00125 _x = self.header.frame_id
00126 length = len(_x)
00127 if python3 or type(_x) == unicode:
00128 _x = _x.encode('utf-8')
00129 length = len(_x)
00130 buff.write(struct.pack('<I%ss'%length, length, _x))
00131 length = len(self.name)
00132 buff.write(_struct_I.pack(length))
00133 for val1 in self.name:
00134 length = len(val1)
00135 if python3 or type(val1) == unicode:
00136 val1 = val1.encode('utf-8')
00137 length = len(val1)
00138 buff.write(struct.pack('<I%ss'%length, length, val1))
00139 length = len(self.positions)
00140 buff.write(_struct_I.pack(length))
00141 for val1 in self.positions:
00142 _v1 = val1.position
00143 _x = _v1
00144 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00145 _v2 = val1.orientation
00146 _x = _v2
00147 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00148 length = len(self.velocities)
00149 buff.write(_struct_I.pack(length))
00150 for val1 in self.velocities:
00151 _v3 = val1.linear
00152 _x = _v3
00153 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00154 _v4 = val1.angular
00155 _x = _v4
00156 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00157 length = len(self.accelerations)
00158 buff.write(_struct_I.pack(length))
00159 for val1 in self.accelerations:
00160 _v5 = val1.linear
00161 _x = _v5
00162 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00163 _v6 = val1.angular
00164 _x = _v6
00165 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00166 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00167 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00168
00169 def deserialize(self, str):
00170 """
00171 unpack serialized message in str into this message instance
00172 :param str: byte array of serialized message, ``str``
00173 """
00174 try:
00175 if self.header is None:
00176 self.header = std_msgs.msg.Header()
00177 if self.positions is None:
00178 self.positions = None
00179 if self.velocities is None:
00180 self.velocities = None
00181 if self.accelerations is None:
00182 self.accelerations = None
00183 end = 0
00184 _x = self
00185 start = end
00186 end += 12
00187 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00188 start = end
00189 end += 4
00190 (length,) = _struct_I.unpack(str[start:end])
00191 start = end
00192 end += length
00193 if python3:
00194 self.header.frame_id = str[start:end].decode('utf-8')
00195 else:
00196 self.header.frame_id = str[start:end]
00197 start = end
00198 end += 4
00199 (length,) = _struct_I.unpack(str[start:end])
00200 self.name = []
00201 for i in range(0, length):
00202 start = end
00203 end += 4
00204 (length,) = _struct_I.unpack(str[start:end])
00205 start = end
00206 end += length
00207 if python3:
00208 val1 = str[start:end].decode('utf-8')
00209 else:
00210 val1 = str[start:end]
00211 self.name.append(val1)
00212 start = end
00213 end += 4
00214 (length,) = _struct_I.unpack(str[start:end])
00215 self.positions = []
00216 for i in range(0, length):
00217 val1 = geometry_msgs.msg.Pose()
00218 _v7 = val1.position
00219 _x = _v7
00220 start = end
00221 end += 24
00222 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00223 _v8 = val1.orientation
00224 _x = _v8
00225 start = end
00226 end += 32
00227 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00228 self.positions.append(val1)
00229 start = end
00230 end += 4
00231 (length,) = _struct_I.unpack(str[start:end])
00232 self.velocities = []
00233 for i in range(0, length):
00234 val1 = geometry_msgs.msg.Twist()
00235 _v9 = val1.linear
00236 _x = _v9
00237 start = end
00238 end += 24
00239 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00240 _v10 = val1.angular
00241 _x = _v10
00242 start = end
00243 end += 24
00244 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00245 self.velocities.append(val1)
00246 start = end
00247 end += 4
00248 (length,) = _struct_I.unpack(str[start:end])
00249 self.accelerations = []
00250 for i in range(0, length):
00251 val1 = geometry_msgs.msg.Twist()
00252 _v11 = val1.linear
00253 _x = _v11
00254 start = end
00255 end += 24
00256 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00257 _v12 = val1.angular
00258 _x = _v12
00259 start = end
00260 end += 24
00261 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00262 self.accelerations.append(val1)
00263 return self
00264 except struct.error as e:
00265 raise genpy.DeserializationError(e)
00266
00267
00268 def serialize_numpy(self, buff, numpy):
00269 """
00270 serialize message with numpy array types into buffer
00271 :param buff: buffer, ``StringIO``
00272 :param numpy: numpy python module
00273 """
00274 try:
00275 _x = self
00276 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00277 _x = self.header.frame_id
00278 length = len(_x)
00279 if python3 or type(_x) == unicode:
00280 _x = _x.encode('utf-8')
00281 length = len(_x)
00282 buff.write(struct.pack('<I%ss'%length, length, _x))
00283 length = len(self.name)
00284 buff.write(_struct_I.pack(length))
00285 for val1 in self.name:
00286 length = len(val1)
00287 if python3 or type(val1) == unicode:
00288 val1 = val1.encode('utf-8')
00289 length = len(val1)
00290 buff.write(struct.pack('<I%ss'%length, length, val1))
00291 length = len(self.positions)
00292 buff.write(_struct_I.pack(length))
00293 for val1 in self.positions:
00294 _v13 = val1.position
00295 _x = _v13
00296 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00297 _v14 = val1.orientation
00298 _x = _v14
00299 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00300 length = len(self.velocities)
00301 buff.write(_struct_I.pack(length))
00302 for val1 in self.velocities:
00303 _v15 = val1.linear
00304 _x = _v15
00305 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00306 _v16 = val1.angular
00307 _x = _v16
00308 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00309 length = len(self.accelerations)
00310 buff.write(_struct_I.pack(length))
00311 for val1 in self.accelerations:
00312 _v17 = val1.linear
00313 _x = _v17
00314 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00315 _v18 = val1.angular
00316 _x = _v18
00317 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00318 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00319 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00320
00321 def deserialize_numpy(self, str, numpy):
00322 """
00323 unpack serialized message in str into this message instance using numpy for array types
00324 :param str: byte array of serialized message, ``str``
00325 :param numpy: numpy python module
00326 """
00327 try:
00328 if self.header is None:
00329 self.header = std_msgs.msg.Header()
00330 if self.positions is None:
00331 self.positions = None
00332 if self.velocities is None:
00333 self.velocities = None
00334 if self.accelerations is None:
00335 self.accelerations = None
00336 end = 0
00337 _x = self
00338 start = end
00339 end += 12
00340 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00341 start = end
00342 end += 4
00343 (length,) = _struct_I.unpack(str[start:end])
00344 start = end
00345 end += length
00346 if python3:
00347 self.header.frame_id = str[start:end].decode('utf-8')
00348 else:
00349 self.header.frame_id = str[start:end]
00350 start = end
00351 end += 4
00352 (length,) = _struct_I.unpack(str[start:end])
00353 self.name = []
00354 for i in range(0, length):
00355 start = end
00356 end += 4
00357 (length,) = _struct_I.unpack(str[start:end])
00358 start = end
00359 end += length
00360 if python3:
00361 val1 = str[start:end].decode('utf-8')
00362 else:
00363 val1 = str[start:end]
00364 self.name.append(val1)
00365 start = end
00366 end += 4
00367 (length,) = _struct_I.unpack(str[start:end])
00368 self.positions = []
00369 for i in range(0, length):
00370 val1 = geometry_msgs.msg.Pose()
00371 _v19 = val1.position
00372 _x = _v19
00373 start = end
00374 end += 24
00375 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00376 _v20 = val1.orientation
00377 _x = _v20
00378 start = end
00379 end += 32
00380 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00381 self.positions.append(val1)
00382 start = end
00383 end += 4
00384 (length,) = _struct_I.unpack(str[start:end])
00385 self.velocities = []
00386 for i in range(0, length):
00387 val1 = geometry_msgs.msg.Twist()
00388 _v21 = val1.linear
00389 _x = _v21
00390 start = end
00391 end += 24
00392 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00393 _v22 = val1.angular
00394 _x = _v22
00395 start = end
00396 end += 24
00397 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00398 self.velocities.append(val1)
00399 start = end
00400 end += 4
00401 (length,) = _struct_I.unpack(str[start:end])
00402 self.accelerations = []
00403 for i in range(0, length):
00404 val1 = geometry_msgs.msg.Twist()
00405 _v23 = val1.linear
00406 _x = _v23
00407 start = end
00408 end += 24
00409 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00410 _v24 = val1.angular
00411 _x = _v24
00412 start = end
00413 end += 24
00414 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00415 self.accelerations.append(val1)
00416 return self
00417 except struct.error as e:
00418 raise genpy.DeserializationError(e)
00419
00420 _struct_I = genpy.struct_I
00421 _struct_3I = struct.Struct("<3I")
00422 _struct_4d = struct.Struct("<4d")
00423 _struct_3d = struct.Struct("<3d")