$search
00001 """autogenerated by genmsg_py from ImageClick.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import pr2_object_manipulation_msgs.msg 00006 import geometry_msgs.msg 00007 import std_msgs.msg 00008 00009 class ImageClick(roslib.message.Message): 00010 _md5sum = "6549d856fa5d392f2ffbeaf0a2f80931" 00011 _type = "pr2_object_manipulation_msgs/ImageClick" 00012 _has_header = False #flag to mark the presence of a Header object 00013 _full_text = """# Info about a user click on an image 00014 00015 # The ray in 3d space resulting from the click 00016 Ray ray 00017 00018 # The frame_if of the camera that the click was in 00019 string camera_frame_id 00020 ================================================================================ 00021 MSG: pr2_object_manipulation_msgs/Ray 00022 # Represents a ray through space. 00023 # Could probably move to a more general location 00024 00025 Header header 00026 00027 # the origin of the ray 00028 geometry_msgs/Point origin 00029 00030 # the direction of the ray 00031 geometry_msgs/Vector3 direction 00032 ================================================================================ 00033 MSG: std_msgs/Header 00034 # Standard metadata for higher-level stamped data types. 00035 # This is generally used to communicate timestamped data 00036 # in a particular coordinate frame. 00037 # 00038 # sequence ID: consecutively increasing ID 00039 uint32 seq 00040 #Two-integer timestamp that is expressed as: 00041 # * stamp.secs: seconds (stamp_secs) since epoch 00042 # * stamp.nsecs: nanoseconds since stamp_secs 00043 # time-handling sugar is provided by the client library 00044 time stamp 00045 #Frame this data is associated with 00046 # 0: no frame 00047 # 1: global frame 00048 string frame_id 00049 00050 ================================================================================ 00051 MSG: geometry_msgs/Point 00052 # This contains the position of a point in free space 00053 float64 x 00054 float64 y 00055 float64 z 00056 00057 ================================================================================ 00058 MSG: geometry_msgs/Vector3 00059 # This represents a vector in free space. 00060 00061 float64 x 00062 float64 y 00063 float64 z 00064 """ 00065 __slots__ = ['ray','camera_frame_id'] 00066 _slot_types = ['pr2_object_manipulation_msgs/Ray','string'] 00067 00068 def __init__(self, *args, **kwds): 00069 """ 00070 Constructor. Any message fields that are implicitly/explicitly 00071 set to None will be assigned a default value. The recommend 00072 use is keyword arguments as this is more robust to future message 00073 changes. You cannot mix in-order arguments and keyword arguments. 00074 00075 The available fields are: 00076 ray,camera_frame_id 00077 00078 @param args: complete set of field values, in .msg order 00079 @param kwds: use keyword arguments corresponding to message field names 00080 to set specific fields. 00081 """ 00082 if args or kwds: 00083 super(ImageClick, self).__init__(*args, **kwds) 00084 #message fields cannot be None, assign default values for those that are 00085 if self.ray is None: 00086 self.ray = pr2_object_manipulation_msgs.msg.Ray() 00087 if self.camera_frame_id is None: 00088 self.camera_frame_id = '' 00089 else: 00090 self.ray = pr2_object_manipulation_msgs.msg.Ray() 00091 self.camera_frame_id = '' 00092 00093 def _get_types(self): 00094 """ 00095 internal API method 00096 """ 00097 return self._slot_types 00098 00099 def serialize(self, buff): 00100 """ 00101 serialize message into buffer 00102 @param buff: buffer 00103 @type buff: StringIO 00104 """ 00105 try: 00106 _x = self 00107 buff.write(_struct_3I.pack(_x.ray.header.seq, _x.ray.header.stamp.secs, _x.ray.header.stamp.nsecs)) 00108 _x = self.ray.header.frame_id 00109 length = len(_x) 00110 buff.write(struct.pack('<I%ss'%length, length, _x)) 00111 _x = self 00112 buff.write(_struct_6d.pack(_x.ray.origin.x, _x.ray.origin.y, _x.ray.origin.z, _x.ray.direction.x, _x.ray.direction.y, _x.ray.direction.z)) 00113 _x = self.camera_frame_id 00114 length = len(_x) 00115 buff.write(struct.pack('<I%ss'%length, length, _x)) 00116 except struct.error as se: self._check_types(se) 00117 except TypeError as te: self._check_types(te) 00118 00119 def deserialize(self, str): 00120 """ 00121 unpack serialized message in str into this message instance 00122 @param str: byte array of serialized message 00123 @type str: str 00124 """ 00125 try: 00126 if self.ray is None: 00127 self.ray = pr2_object_manipulation_msgs.msg.Ray() 00128 end = 0 00129 _x = self 00130 start = end 00131 end += 12 00132 (_x.ray.header.seq, _x.ray.header.stamp.secs, _x.ray.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00133 start = end 00134 end += 4 00135 (length,) = _struct_I.unpack(str[start:end]) 00136 start = end 00137 end += length 00138 self.ray.header.frame_id = str[start:end] 00139 _x = self 00140 start = end 00141 end += 48 00142 (_x.ray.origin.x, _x.ray.origin.y, _x.ray.origin.z, _x.ray.direction.x, _x.ray.direction.y, _x.ray.direction.z,) = _struct_6d.unpack(str[start:end]) 00143 start = end 00144 end += 4 00145 (length,) = _struct_I.unpack(str[start:end]) 00146 start = end 00147 end += length 00148 self.camera_frame_id = str[start:end] 00149 return self 00150 except struct.error as e: 00151 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00152 00153 00154 def serialize_numpy(self, buff, numpy): 00155 """ 00156 serialize message with numpy array types into buffer 00157 @param buff: buffer 00158 @type buff: StringIO 00159 @param numpy: numpy python module 00160 @type numpy module 00161 """ 00162 try: 00163 _x = self 00164 buff.write(_struct_3I.pack(_x.ray.header.seq, _x.ray.header.stamp.secs, _x.ray.header.stamp.nsecs)) 00165 _x = self.ray.header.frame_id 00166 length = len(_x) 00167 buff.write(struct.pack('<I%ss'%length, length, _x)) 00168 _x = self 00169 buff.write(_struct_6d.pack(_x.ray.origin.x, _x.ray.origin.y, _x.ray.origin.z, _x.ray.direction.x, _x.ray.direction.y, _x.ray.direction.z)) 00170 _x = self.camera_frame_id 00171 length = len(_x) 00172 buff.write(struct.pack('<I%ss'%length, length, _x)) 00173 except struct.error as se: self._check_types(se) 00174 except TypeError as te: self._check_types(te) 00175 00176 def deserialize_numpy(self, str, numpy): 00177 """ 00178 unpack serialized message in str into this message instance using numpy for array types 00179 @param str: byte array of serialized message 00180 @type str: str 00181 @param numpy: numpy python module 00182 @type numpy: module 00183 """ 00184 try: 00185 if self.ray is None: 00186 self.ray = pr2_object_manipulation_msgs.msg.Ray() 00187 end = 0 00188 _x = self 00189 start = end 00190 end += 12 00191 (_x.ray.header.seq, _x.ray.header.stamp.secs, _x.ray.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00192 start = end 00193 end += 4 00194 (length,) = _struct_I.unpack(str[start:end]) 00195 start = end 00196 end += length 00197 self.ray.header.frame_id = str[start:end] 00198 _x = self 00199 start = end 00200 end += 48 00201 (_x.ray.origin.x, _x.ray.origin.y, _x.ray.origin.z, _x.ray.direction.x, _x.ray.direction.y, _x.ray.direction.z,) = _struct_6d.unpack(str[start:end]) 00202 start = end 00203 end += 4 00204 (length,) = _struct_I.unpack(str[start:end]) 00205 start = end 00206 end += length 00207 self.camera_frame_id = str[start:end] 00208 return self 00209 except struct.error as e: 00210 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00211 00212 _struct_I = roslib.message.struct_I 00213 _struct_3I = struct.Struct("<3I") 00214 _struct_6d = struct.Struct("<6d")