_partial_lo.py
Go to the documentation of this file.
00001 """autogenerated by genpy from vision_msgs/partial_lo.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class partial_lo(genpy.Message):
00009   _md5sum = "9a220ff1483742865ee698cfec57218c"
00010   _type = "vision_msgs/partial_lo"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# Message to quiey the lo-service, U. Klank klank@in.tum.de
00013 uint64 id                           #id of a frame, there should be unique mapping from a tf-name-string to such an id
00014 string name                     #optional parameter name representing a tf and knowledgebase correspondence
00015 uint64 parent_id        #id of parent frame
00016 float64[16] pose              #pose matrix, fully projective 4x4 matrix
00017 float64[36] cov         #covariance for 6 dof (xyz, rpy)
00018 uint16 type             #fixed connection with the parent (1) or free in space (0 = default)
00019 
00020 """
00021   __slots__ = ['id','name','parent_id','pose','cov','type']
00022   _slot_types = ['uint64','string','uint64','float64[16]','float64[36]','uint16']
00023 
00024   def __init__(self, *args, **kwds):
00025     """
00026     Constructor. Any message fields that are implicitly/explicitly
00027     set to None will be assigned a default value. The recommend
00028     use is keyword arguments as this is more robust to future message
00029     changes.  You cannot mix in-order arguments and keyword arguments.
00030 
00031     The available fields are:
00032        id,name,parent_id,pose,cov,type
00033 
00034     :param args: complete set of field values, in .msg order
00035     :param kwds: use keyword arguments corresponding to message field names
00036     to set specific fields.
00037     """
00038     if args or kwds:
00039       super(partial_lo, self).__init__(*args, **kwds)
00040       #message fields cannot be None, assign default values for those that are
00041       if self.id is None:
00042         self.id = 0
00043       if self.name is None:
00044         self.name = ''
00045       if self.parent_id is None:
00046         self.parent_id = 0
00047       if self.pose is None:
00048         self.pose = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00049       if self.cov is None:
00050         self.cov = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00051       if self.type is None:
00052         self.type = 0
00053     else:
00054       self.id = 0
00055       self.name = ''
00056       self.parent_id = 0
00057       self.pose = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00058       self.cov = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00059       self.type = 0
00060 
00061   def _get_types(self):
00062     """
00063     internal API method
00064     """
00065     return self._slot_types
00066 
00067   def serialize(self, buff):
00068     """
00069     serialize message into buffer
00070     :param buff: buffer, ``StringIO``
00071     """
00072     try:
00073       buff.write(_struct_Q.pack(self.id))
00074       _x = self.name
00075       length = len(_x)
00076       if python3 or type(_x) == unicode:
00077         _x = _x.encode('utf-8')
00078         length = len(_x)
00079       buff.write(struct.pack('<I%ss'%length, length, _x))
00080       buff.write(_struct_Q.pack(self.parent_id))
00081       buff.write(_struct_16d.pack(*self.pose))
00082       buff.write(_struct_36d.pack(*self.cov))
00083       buff.write(_struct_H.pack(self.type))
00084     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00085     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00086 
00087   def deserialize(self, str):
00088     """
00089     unpack serialized message in str into this message instance
00090     :param str: byte array of serialized message, ``str``
00091     """
00092     try:
00093       end = 0
00094       start = end
00095       end += 8
00096       (self.id,) = _struct_Q.unpack(str[start:end])
00097       start = end
00098       end += 4
00099       (length,) = _struct_I.unpack(str[start:end])
00100       start = end
00101       end += length
00102       if python3:
00103         self.name = str[start:end].decode('utf-8')
00104       else:
00105         self.name = str[start:end]
00106       start = end
00107       end += 8
00108       (self.parent_id,) = _struct_Q.unpack(str[start:end])
00109       start = end
00110       end += 128
00111       self.pose = _struct_16d.unpack(str[start:end])
00112       start = end
00113       end += 288
00114       self.cov = _struct_36d.unpack(str[start:end])
00115       start = end
00116       end += 2
00117       (self.type,) = _struct_H.unpack(str[start:end])
00118       return self
00119     except struct.error as e:
00120       raise genpy.DeserializationError(e) #most likely buffer underfill
00121 
00122 
00123   def serialize_numpy(self, buff, numpy):
00124     """
00125     serialize message with numpy array types into buffer
00126     :param buff: buffer, ``StringIO``
00127     :param numpy: numpy python module
00128     """
00129     try:
00130       buff.write(_struct_Q.pack(self.id))
00131       _x = self.name
00132       length = len(_x)
00133       if python3 or type(_x) == unicode:
00134         _x = _x.encode('utf-8')
00135         length = len(_x)
00136       buff.write(struct.pack('<I%ss'%length, length, _x))
00137       buff.write(_struct_Q.pack(self.parent_id))
00138       buff.write(self.pose.tostring())
00139       buff.write(self.cov.tostring())
00140       buff.write(_struct_H.pack(self.type))
00141     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00142     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00143 
00144   def deserialize_numpy(self, str, numpy):
00145     """
00146     unpack serialized message in str into this message instance using numpy for array types
00147     :param str: byte array of serialized message, ``str``
00148     :param numpy: numpy python module
00149     """
00150     try:
00151       end = 0
00152       start = end
00153       end += 8
00154       (self.id,) = _struct_Q.unpack(str[start:end])
00155       start = end
00156       end += 4
00157       (length,) = _struct_I.unpack(str[start:end])
00158       start = end
00159       end += length
00160       if python3:
00161         self.name = str[start:end].decode('utf-8')
00162       else:
00163         self.name = str[start:end]
00164       start = end
00165       end += 8
00166       (self.parent_id,) = _struct_Q.unpack(str[start:end])
00167       start = end
00168       end += 128
00169       self.pose = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=16)
00170       start = end
00171       end += 288
00172       self.cov = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=36)
00173       start = end
00174       end += 2
00175       (self.type,) = _struct_H.unpack(str[start:end])
00176       return self
00177     except struct.error as e:
00178       raise genpy.DeserializationError(e) #most likely buffer underfill
00179 
00180 _struct_I = genpy.struct_I
00181 _struct_Q = struct.Struct("<Q")
00182 _struct_16d = struct.Struct("<16d")
00183 _struct_36d = struct.Struct("<36d")
00184 _struct_H = struct.Struct("<H")


vision_msgs
Author(s): Ulrich F Klank
autogenerated on Mon Oct 6 2014 00:47:37