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