$search
00001 """autogenerated by genmsg_py from CameraPose.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 00007 class CameraPose(roslib.message.Message): 00008 _md5sum = "eb4c53d8c0c861e2c5d562bd921bb38e" 00009 _type = "camera_pose_calibration/CameraPose" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """string camera_id 00012 geometry_msgs/Pose pose 00013 00014 ================================================================================ 00015 MSG: geometry_msgs/Pose 00016 # A representation of pose in free space, composed of postion and orientation. 00017 Point position 00018 Quaternion orientation 00019 00020 ================================================================================ 00021 MSG: geometry_msgs/Point 00022 # This contains the position of a point in free space 00023 float64 x 00024 float64 y 00025 float64 z 00026 00027 ================================================================================ 00028 MSG: geometry_msgs/Quaternion 00029 # This represents an orientation in free space in quaternion form. 00030 00031 float64 x 00032 float64 y 00033 float64 z 00034 float64 w 00035 00036 """ 00037 __slots__ = ['camera_id','pose'] 00038 _slot_types = ['string','geometry_msgs/Pose'] 00039 00040 def __init__(self, *args, **kwds): 00041 """ 00042 Constructor. Any message fields that are implicitly/explicitly 00043 set to None will be assigned a default value. The recommend 00044 use is keyword arguments as this is more robust to future message 00045 changes. You cannot mix in-order arguments and keyword arguments. 00046 00047 The available fields are: 00048 camera_id,pose 00049 00050 @param args: complete set of field values, in .msg order 00051 @param kwds: use keyword arguments corresponding to message field names 00052 to set specific fields. 00053 """ 00054 if args or kwds: 00055 super(CameraPose, self).__init__(*args, **kwds) 00056 #message fields cannot be None, assign default values for those that are 00057 if self.camera_id is None: 00058 self.camera_id = '' 00059 if self.pose is None: 00060 self.pose = geometry_msgs.msg.Pose() 00061 else: 00062 self.camera_id = '' 00063 self.pose = geometry_msgs.msg.Pose() 00064 00065 def _get_types(self): 00066 """ 00067 internal API method 00068 """ 00069 return self._slot_types 00070 00071 def serialize(self, buff): 00072 """ 00073 serialize message into buffer 00074 @param buff: buffer 00075 @type buff: StringIO 00076 """ 00077 try: 00078 _x = self.camera_id 00079 length = len(_x) 00080 buff.write(struct.pack('<I%ss'%length, length, _x)) 00081 _x = self 00082 buff.write(_struct_7d.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w)) 00083 except struct.error as se: self._check_types(se) 00084 except TypeError as te: self._check_types(te) 00085 00086 def deserialize(self, str): 00087 """ 00088 unpack serialized message in str into this message instance 00089 @param str: byte array of serialized message 00090 @type str: str 00091 """ 00092 try: 00093 if self.pose is None: 00094 self.pose = geometry_msgs.msg.Pose() 00095 end = 0 00096 start = end 00097 end += 4 00098 (length,) = _struct_I.unpack(str[start:end]) 00099 start = end 00100 end += length 00101 self.camera_id = str[start:end] 00102 _x = self 00103 start = end 00104 end += 56 00105 (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w,) = _struct_7d.unpack(str[start:end]) 00106 return self 00107 except struct.error as e: 00108 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00109 00110 00111 def serialize_numpy(self, buff, numpy): 00112 """ 00113 serialize message with numpy array types into buffer 00114 @param buff: buffer 00115 @type buff: StringIO 00116 @param numpy: numpy python module 00117 @type numpy module 00118 """ 00119 try: 00120 _x = self.camera_id 00121 length = len(_x) 00122 buff.write(struct.pack('<I%ss'%length, length, _x)) 00123 _x = self 00124 buff.write(_struct_7d.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w)) 00125 except struct.error as se: self._check_types(se) 00126 except TypeError as te: self._check_types(te) 00127 00128 def deserialize_numpy(self, str, numpy): 00129 """ 00130 unpack serialized message in str into this message instance using numpy for array types 00131 @param str: byte array of serialized message 00132 @type str: str 00133 @param numpy: numpy python module 00134 @type numpy: module 00135 """ 00136 try: 00137 if self.pose is None: 00138 self.pose = geometry_msgs.msg.Pose() 00139 end = 0 00140 start = end 00141 end += 4 00142 (length,) = _struct_I.unpack(str[start:end]) 00143 start = end 00144 end += length 00145 self.camera_id = str[start:end] 00146 _x = self 00147 start = end 00148 end += 56 00149 (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w,) = _struct_7d.unpack(str[start:end]) 00150 return self 00151 except struct.error as e: 00152 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00153 00154 _struct_I = roslib.message.struct_I 00155 _struct_7d = struct.Struct("<7d")