_TransformArray.py
Go to the documentation of this file.
00001 """autogenerated by genpy from visp_hand2eye_calibration/TransformArray.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 TransformArray(genpy.Message):
00011   _md5sum = "69339633e969be70367b6ff0fe206328"
00012   _type = "visp_hand2eye_calibration/TransformArray"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """# An array of transforms with a header for global reference.
00015 
00016 Header header
00017 
00018 geometry_msgs/Transform[] transforms
00019 ================================================================================
00020 MSG: std_msgs/Header
00021 # Standard metadata for higher-level stamped data types.
00022 # This is generally used to communicate timestamped data 
00023 # in a particular coordinate frame.
00024 # 
00025 # sequence ID: consecutively increasing ID 
00026 uint32 seq
00027 #Two-integer timestamp that is expressed as:
00028 # * stamp.secs: seconds (stamp_secs) since epoch
00029 # * stamp.nsecs: nanoseconds since stamp_secs
00030 # time-handling sugar is provided by the client library
00031 time stamp
00032 #Frame this data is associated with
00033 # 0: no frame
00034 # 1: global frame
00035 string frame_id
00036 
00037 ================================================================================
00038 MSG: geometry_msgs/Transform
00039 # This represents the transform between two coordinate frames in free space.
00040 
00041 Vector3 translation
00042 Quaternion rotation
00043 
00044 ================================================================================
00045 MSG: geometry_msgs/Vector3
00046 # This represents a vector in free space. 
00047 
00048 float64 x
00049 float64 y
00050 float64 z
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   __slots__ = ['header','transforms']
00062   _slot_types = ['std_msgs/Header','geometry_msgs/Transform[]']
00063 
00064   def __init__(self, *args, **kwds):
00065     """
00066     Constructor. Any message fields that are implicitly/explicitly
00067     set to None will be assigned a default value. The recommend
00068     use is keyword arguments as this is more robust to future message
00069     changes.  You cannot mix in-order arguments and keyword arguments.
00070 
00071     The available fields are:
00072        header,transforms
00073 
00074     :param args: complete set of field values, in .msg order
00075     :param kwds: use keyword arguments corresponding to message field names
00076     to set specific fields.
00077     """
00078     if args or kwds:
00079       super(TransformArray, self).__init__(*args, **kwds)
00080       #message fields cannot be None, assign default values for those that are
00081       if self.header is None:
00082         self.header = std_msgs.msg.Header()
00083       if self.transforms is None:
00084         self.transforms = []
00085     else:
00086       self.header = std_msgs.msg.Header()
00087       self.transforms = []
00088 
00089   def _get_types(self):
00090     """
00091     internal API method
00092     """
00093     return self._slot_types
00094 
00095   def serialize(self, buff):
00096     """
00097     serialize message into buffer
00098     :param buff: buffer, ``StringIO``
00099     """
00100     try:
00101       _x = self
00102       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00103       _x = self.header.frame_id
00104       length = len(_x)
00105       if python3 or type(_x) == unicode:
00106         _x = _x.encode('utf-8')
00107         length = len(_x)
00108       buff.write(struct.pack('<I%ss'%length, length, _x))
00109       length = len(self.transforms)
00110       buff.write(_struct_I.pack(length))
00111       for val1 in self.transforms:
00112         _v1 = val1.translation
00113         _x = _v1
00114         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00115         _v2 = val1.rotation
00116         _x = _v2
00117         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00118     except struct.error as se: self._check_types(se)
00119     except TypeError as te: self._check_types(te)
00120 
00121   def deserialize(self, str):
00122     """
00123     unpack serialized message in str into this message instance
00124     :param str: byte array of serialized message, ``str``
00125     """
00126     try:
00127       if self.header is None:
00128         self.header = std_msgs.msg.Header()
00129       if self.transforms is None:
00130         self.transforms = None
00131       end = 0
00132       _x = self
00133       start = end
00134       end += 12
00135       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00136       start = end
00137       end += 4
00138       (length,) = _struct_I.unpack(str[start:end])
00139       start = end
00140       end += length
00141       if python3:
00142         self.header.frame_id = str[start:end].decode('utf-8')
00143       else:
00144         self.header.frame_id = str[start:end]
00145       start = end
00146       end += 4
00147       (length,) = _struct_I.unpack(str[start:end])
00148       self.transforms = []
00149       for i in range(0, length):
00150         val1 = geometry_msgs.msg.Transform()
00151         _v3 = val1.translation
00152         _x = _v3
00153         start = end
00154         end += 24
00155         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00156         _v4 = val1.rotation
00157         _x = _v4
00158         start = end
00159         end += 32
00160         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00161         self.transforms.append(val1)
00162       return self
00163     except struct.error as e:
00164       raise genpy.DeserializationError(e) #most likely buffer underfill
00165 
00166 
00167   def serialize_numpy(self, buff, numpy):
00168     """
00169     serialize message with numpy array types into buffer
00170     :param buff: buffer, ``StringIO``
00171     :param numpy: numpy python module
00172     """
00173     try:
00174       _x = self
00175       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00176       _x = self.header.frame_id
00177       length = len(_x)
00178       if python3 or type(_x) == unicode:
00179         _x = _x.encode('utf-8')
00180         length = len(_x)
00181       buff.write(struct.pack('<I%ss'%length, length, _x))
00182       length = len(self.transforms)
00183       buff.write(_struct_I.pack(length))
00184       for val1 in self.transforms:
00185         _v5 = val1.translation
00186         _x = _v5
00187         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00188         _v6 = val1.rotation
00189         _x = _v6
00190         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00191     except struct.error as se: self._check_types(se)
00192     except TypeError as te: self._check_types(te)
00193 
00194   def deserialize_numpy(self, str, numpy):
00195     """
00196     unpack serialized message in str into this message instance using numpy for array types
00197     :param str: byte array of serialized message, ``str``
00198     :param numpy: numpy python module
00199     """
00200     try:
00201       if self.header is None:
00202         self.header = std_msgs.msg.Header()
00203       if self.transforms is None:
00204         self.transforms = None
00205       end = 0
00206       _x = self
00207       start = end
00208       end += 12
00209       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00210       start = end
00211       end += 4
00212       (length,) = _struct_I.unpack(str[start:end])
00213       start = end
00214       end += length
00215       if python3:
00216         self.header.frame_id = str[start:end].decode('utf-8')
00217       else:
00218         self.header.frame_id = str[start:end]
00219       start = end
00220       end += 4
00221       (length,) = _struct_I.unpack(str[start:end])
00222       self.transforms = []
00223       for i in range(0, length):
00224         val1 = geometry_msgs.msg.Transform()
00225         _v7 = val1.translation
00226         _x = _v7
00227         start = end
00228         end += 24
00229         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00230         _v8 = val1.rotation
00231         _x = _v8
00232         start = end
00233         end += 32
00234         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00235         self.transforms.append(val1)
00236       return self
00237     except struct.error as e:
00238       raise genpy.DeserializationError(e) #most likely buffer underfill
00239 
00240 _struct_I = genpy.struct_I
00241 _struct_3I = struct.Struct("<3I")
00242 _struct_4d = struct.Struct("<4d")
00243 _struct_3d = struct.Struct("<3d")


visp_hand2eye_calibration
Author(s): Filip Novotny
autogenerated on Sat Dec 28 2013 17:45:52