_CameraCalibration.py
Go to the documentation of this file.
00001 """autogenerated by genpy from camera_pose_calibration/CameraCalibration.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 genpy
00009 
00010 class CameraCalibration(genpy.Message):
00011   _md5sum = "3cc5d376bac75efd371d4df5fb750ad6"
00012   _type = "camera_pose_calibration/CameraCalibration"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """geometry_msgs/Pose[] camera_pose
00015 string[] camera_id
00016 time[] time_stamp
00017 int32 m_count
00018 
00019 ================================================================================
00020 MSG: geometry_msgs/Pose
00021 # A representation of pose in free space, composed of postion and orientation. 
00022 Point position
00023 Quaternion orientation
00024 
00025 ================================================================================
00026 MSG: geometry_msgs/Point
00027 # This contains the position of a point in free space
00028 float64 x
00029 float64 y
00030 float64 z
00031 
00032 ================================================================================
00033 MSG: geometry_msgs/Quaternion
00034 # This represents an orientation in free space in quaternion form.
00035 
00036 float64 x
00037 float64 y
00038 float64 z
00039 float64 w
00040 
00041 """
00042   __slots__ = ['camera_pose','camera_id','time_stamp','m_count']
00043   _slot_types = ['geometry_msgs/Pose[]','string[]','time[]','int32']
00044 
00045   def __init__(self, *args, **kwds):
00046     """
00047     Constructor. Any message fields that are implicitly/explicitly
00048     set to None will be assigned a default value. The recommend
00049     use is keyword arguments as this is more robust to future message
00050     changes.  You cannot mix in-order arguments and keyword arguments.
00051 
00052     The available fields are:
00053        camera_pose,camera_id,time_stamp,m_count
00054 
00055     :param args: complete set of field values, in .msg order
00056     :param kwds: use keyword arguments corresponding to message field names
00057     to set specific fields.
00058     """
00059     if args or kwds:
00060       super(CameraCalibration, self).__init__(*args, **kwds)
00061       #message fields cannot be None, assign default values for those that are
00062       if self.camera_pose is None:
00063         self.camera_pose = []
00064       if self.camera_id is None:
00065         self.camera_id = []
00066       if self.time_stamp is None:
00067         self.time_stamp = []
00068       if self.m_count is None:
00069         self.m_count = 0
00070     else:
00071       self.camera_pose = []
00072       self.camera_id = []
00073       self.time_stamp = []
00074       self.m_count = 0
00075 
00076   def _get_types(self):
00077     """
00078     internal API method
00079     """
00080     return self._slot_types
00081 
00082   def serialize(self, buff):
00083     """
00084     serialize message into buffer
00085     :param buff: buffer, ``StringIO``
00086     """
00087     try:
00088       length = len(self.camera_pose)
00089       buff.write(_struct_I.pack(length))
00090       for val1 in self.camera_pose:
00091         _v1 = val1.position
00092         _x = _v1
00093         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00094         _v2 = val1.orientation
00095         _x = _v2
00096         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00097       length = len(self.camera_id)
00098       buff.write(_struct_I.pack(length))
00099       for val1 in self.camera_id:
00100         length = len(val1)
00101         if python3 or type(val1) == unicode:
00102           val1 = val1.encode('utf-8')
00103           length = len(val1)
00104         buff.write(struct.pack('<I%ss'%length, length, val1))
00105       length = len(self.time_stamp)
00106       buff.write(_struct_I.pack(length))
00107       for val1 in self.time_stamp:
00108         _x = val1
00109         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00110       buff.write(_struct_i.pack(self.m_count))
00111     except struct.error as se: self._check_types(se)
00112     except TypeError as te: self._check_types(te)
00113 
00114   def deserialize(self, str):
00115     """
00116     unpack serialized message in str into this message instance
00117     :param str: byte array of serialized message, ``str``
00118     """
00119     try:
00120       if self.camera_pose is None:
00121         self.camera_pose = None
00122       if self.time_stamp is None:
00123         self.time_stamp = None
00124       end = 0
00125       start = end
00126       end += 4
00127       (length,) = _struct_I.unpack(str[start:end])
00128       self.camera_pose = []
00129       for i in range(0, length):
00130         val1 = geometry_msgs.msg.Pose()
00131         _v3 = val1.position
00132         _x = _v3
00133         start = end
00134         end += 24
00135         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00136         _v4 = val1.orientation
00137         _x = _v4
00138         start = end
00139         end += 32
00140         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00141         self.camera_pose.append(val1)
00142       start = end
00143       end += 4
00144       (length,) = _struct_I.unpack(str[start:end])
00145       self.camera_id = []
00146       for i in range(0, length):
00147         start = end
00148         end += 4
00149         (length,) = _struct_I.unpack(str[start:end])
00150         start = end
00151         end += length
00152         if python3:
00153           val1 = str[start:end].decode('utf-8')
00154         else:
00155           val1 = str[start:end]
00156         self.camera_id.append(val1)
00157       start = end
00158       end += 4
00159       (length,) = _struct_I.unpack(str[start:end])
00160       self.time_stamp = []
00161       for i in range(0, length):
00162         val1 = genpy.Time()
00163         _x = val1
00164         start = end
00165         end += 8
00166         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00167         self.time_stamp.append(val1)
00168       start = end
00169       end += 4
00170       (self.m_count,) = _struct_i.unpack(str[start:end])
00171       return self
00172     except struct.error as e:
00173       raise genpy.DeserializationError(e) #most likely buffer underfill
00174 
00175 
00176   def serialize_numpy(self, buff, numpy):
00177     """
00178     serialize message with numpy array types into buffer
00179     :param buff: buffer, ``StringIO``
00180     :param numpy: numpy python module
00181     """
00182     try:
00183       length = len(self.camera_pose)
00184       buff.write(_struct_I.pack(length))
00185       for val1 in self.camera_pose:
00186         _v5 = val1.position
00187         _x = _v5
00188         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00189         _v6 = val1.orientation
00190         _x = _v6
00191         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00192       length = len(self.camera_id)
00193       buff.write(_struct_I.pack(length))
00194       for val1 in self.camera_id:
00195         length = len(val1)
00196         if python3 or type(val1) == unicode:
00197           val1 = val1.encode('utf-8')
00198           length = len(val1)
00199         buff.write(struct.pack('<I%ss'%length, length, val1))
00200       length = len(self.time_stamp)
00201       buff.write(_struct_I.pack(length))
00202       for val1 in self.time_stamp:
00203         _x = val1
00204         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00205       buff.write(_struct_i.pack(self.m_count))
00206     except struct.error as se: self._check_types(se)
00207     except TypeError as te: self._check_types(te)
00208 
00209   def deserialize_numpy(self, str, numpy):
00210     """
00211     unpack serialized message in str into this message instance using numpy for array types
00212     :param str: byte array of serialized message, ``str``
00213     :param numpy: numpy python module
00214     """
00215     try:
00216       if self.camera_pose is None:
00217         self.camera_pose = None
00218       if self.time_stamp is None:
00219         self.time_stamp = None
00220       end = 0
00221       start = end
00222       end += 4
00223       (length,) = _struct_I.unpack(str[start:end])
00224       self.camera_pose = []
00225       for i in range(0, length):
00226         val1 = geometry_msgs.msg.Pose()
00227         _v7 = val1.position
00228         _x = _v7
00229         start = end
00230         end += 24
00231         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00232         _v8 = val1.orientation
00233         _x = _v8
00234         start = end
00235         end += 32
00236         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00237         self.camera_pose.append(val1)
00238       start = end
00239       end += 4
00240       (length,) = _struct_I.unpack(str[start:end])
00241       self.camera_id = []
00242       for i in range(0, length):
00243         start = end
00244         end += 4
00245         (length,) = _struct_I.unpack(str[start:end])
00246         start = end
00247         end += length
00248         if python3:
00249           val1 = str[start:end].decode('utf-8')
00250         else:
00251           val1 = str[start:end]
00252         self.camera_id.append(val1)
00253       start = end
00254       end += 4
00255       (length,) = _struct_I.unpack(str[start:end])
00256       self.time_stamp = []
00257       for i in range(0, length):
00258         val1 = genpy.Time()
00259         _x = val1
00260         start = end
00261         end += 8
00262         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00263         self.time_stamp.append(val1)
00264       start = end
00265       end += 4
00266       (self.m_count,) = _struct_i.unpack(str[start:end])
00267       return self
00268     except struct.error as e:
00269       raise genpy.DeserializationError(e) #most likely buffer underfill
00270 
00271 _struct_I = genpy.struct_I
00272 _struct_i = struct.Struct("<i")
00273 _struct_4d = struct.Struct("<4d")
00274 _struct_2I = struct.Struct("<2I")
00275 _struct_3d = struct.Struct("<3d")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


camera_pose_calibration
Author(s): Vijay Pradeep, Wim Meeussen
autogenerated on Thu Aug 15 2013 12:02:24