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