$search
00001 """autogenerated by genmsg_py from PoseRT.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class PoseRT(roslib.message.Message): 00007 _md5sum = "d6802a5a6d10cce0b5eea91c5defc39f" 00008 _type = "cob_object_detection_msgs/PoseRT" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """#3x1 rotation vector, Rodrigues axis angle form, 00011 #angle = norm(rvec) -- radians 00012 #axis = rvec/norm(rvec) -- unit length 00013 float64[3] rvec 00014 #3x1 translation vector, in meters 00015 float64[3] tvec 00016 """ 00017 __slots__ = ['rvec','tvec'] 00018 _slot_types = ['float64[3]','float64[3]'] 00019 00020 def __init__(self, *args, **kwds): 00021 """ 00022 Constructor. Any message fields that are implicitly/explicitly 00023 set to None will be assigned a default value. The recommend 00024 use is keyword arguments as this is more robust to future message 00025 changes. You cannot mix in-order arguments and keyword arguments. 00026 00027 The available fields are: 00028 rvec,tvec 00029 00030 @param args: complete set of field values, in .msg order 00031 @param kwds: use keyword arguments corresponding to message field names 00032 to set specific fields. 00033 """ 00034 if args or kwds: 00035 super(PoseRT, self).__init__(*args, **kwds) 00036 #message fields cannot be None, assign default values for those that are 00037 if self.rvec is None: 00038 self.rvec = [0.,0.,0.] 00039 if self.tvec is None: 00040 self.tvec = [0.,0.,0.] 00041 else: 00042 self.rvec = [0.,0.,0.] 00043 self.tvec = [0.,0.,0.] 00044 00045 def _get_types(self): 00046 """ 00047 internal API method 00048 """ 00049 return self._slot_types 00050 00051 def serialize(self, buff): 00052 """ 00053 serialize message into buffer 00054 @param buff: buffer 00055 @type buff: StringIO 00056 """ 00057 try: 00058 buff.write(_struct_3d.pack(*self.rvec)) 00059 buff.write(_struct_3d.pack(*self.tvec)) 00060 except struct.error as se: self._check_types(se) 00061 except TypeError as te: self._check_types(te) 00062 00063 def deserialize(self, str): 00064 """ 00065 unpack serialized message in str into this message instance 00066 @param str: byte array of serialized message 00067 @type str: str 00068 """ 00069 try: 00070 end = 0 00071 start = end 00072 end += 24 00073 self.rvec = _struct_3d.unpack(str[start:end]) 00074 start = end 00075 end += 24 00076 self.tvec = _struct_3d.unpack(str[start:end]) 00077 return self 00078 except struct.error as e: 00079 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00080 00081 00082 def serialize_numpy(self, buff, numpy): 00083 """ 00084 serialize message with numpy array types into buffer 00085 @param buff: buffer 00086 @type buff: StringIO 00087 @param numpy: numpy python module 00088 @type numpy module 00089 """ 00090 try: 00091 buff.write(self.rvec.tostring()) 00092 buff.write(self.tvec.tostring()) 00093 except struct.error as se: self._check_types(se) 00094 except TypeError as te: self._check_types(te) 00095 00096 def deserialize_numpy(self, str, numpy): 00097 """ 00098 unpack serialized message in str into this message instance using numpy for array types 00099 @param str: byte array of serialized message 00100 @type str: str 00101 @param numpy: numpy python module 00102 @type numpy: module 00103 """ 00104 try: 00105 end = 0 00106 start = end 00107 end += 24 00108 self.rvec = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=3) 00109 start = end 00110 end += 24 00111 self.tvec = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=3) 00112 return self 00113 except struct.error as e: 00114 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00115 00116 _struct_I = roslib.message.struct_I 00117 _struct_3d = struct.Struct("<3d")