$search
00001 """autogenerated by genmsg_py from ContactInformation.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import std_msgs.msg 00007 00008 class ContactInformation(roslib.message.Message): 00009 _md5sum = "85f341c0166ad4e68b4421391bbd2e15" 00010 _type = "arm_navigation_msgs/ContactInformation" 00011 _has_header = True #flag to mark the presence of a Header object 00012 _full_text = """# Standard ROS header contains information 00013 # about the frame in which this 00014 # contact is specified 00015 Header header 00016 00017 # Position of the contact point 00018 geometry_msgs/Point position 00019 00020 # Normal corresponding to the contact point 00021 geometry_msgs/Vector3 normal 00022 00023 # Depth of contact point 00024 float64 depth 00025 00026 # Name of the first body that is in contact 00027 # This could be a link or a namespace that represents a body 00028 string contact_body_1 00029 string attached_body_1 00030 uint32 body_type_1 00031 00032 # Name of the second body that is in contact 00033 # This could be a link or a namespace that represents a body 00034 string contact_body_2 00035 string attached_body_2 00036 uint32 body_type_2 00037 00038 uint32 ROBOT_LINK=0 00039 uint32 OBJECT=1 00040 uint32 ATTACHED_BODY=2 00041 ================================================================================ 00042 MSG: std_msgs/Header 00043 # Standard metadata for higher-level stamped data types. 00044 # This is generally used to communicate timestamped data 00045 # in a particular coordinate frame. 00046 # 00047 # sequence ID: consecutively increasing ID 00048 uint32 seq 00049 #Two-integer timestamp that is expressed as: 00050 # * stamp.secs: seconds (stamp_secs) since epoch 00051 # * stamp.nsecs: nanoseconds since stamp_secs 00052 # time-handling sugar is provided by the client library 00053 time stamp 00054 #Frame this data is associated with 00055 # 0: no frame 00056 # 1: global frame 00057 string frame_id 00058 00059 ================================================================================ 00060 MSG: geometry_msgs/Point 00061 # This contains the position of a point in free space 00062 float64 x 00063 float64 y 00064 float64 z 00065 00066 ================================================================================ 00067 MSG: geometry_msgs/Vector3 00068 # This represents a vector in free space. 00069 00070 float64 x 00071 float64 y 00072 float64 z 00073 """ 00074 # Pseudo-constants 00075 ROBOT_LINK = 0 00076 OBJECT = 1 00077 ATTACHED_BODY = 2 00078 00079 __slots__ = ['header','position','normal','depth','contact_body_1','attached_body_1','body_type_1','contact_body_2','attached_body_2','body_type_2'] 00080 _slot_types = ['Header','geometry_msgs/Point','geometry_msgs/Vector3','float64','string','string','uint32','string','string','uint32'] 00081 00082 def __init__(self, *args, **kwds): 00083 """ 00084 Constructor. Any message fields that are implicitly/explicitly 00085 set to None will be assigned a default value. The recommend 00086 use is keyword arguments as this is more robust to future message 00087 changes. You cannot mix in-order arguments and keyword arguments. 00088 00089 The available fields are: 00090 header,position,normal,depth,contact_body_1,attached_body_1,body_type_1,contact_body_2,attached_body_2,body_type_2 00091 00092 @param args: complete set of field values, in .msg order 00093 @param kwds: use keyword arguments corresponding to message field names 00094 to set specific fields. 00095 """ 00096 if args or kwds: 00097 super(ContactInformation, self).__init__(*args, **kwds) 00098 #message fields cannot be None, assign default values for those that are 00099 if self.header is None: 00100 self.header = std_msgs.msg._Header.Header() 00101 if self.position is None: 00102 self.position = geometry_msgs.msg.Point() 00103 if self.normal is None: 00104 self.normal = geometry_msgs.msg.Vector3() 00105 if self.depth is None: 00106 self.depth = 0. 00107 if self.contact_body_1 is None: 00108 self.contact_body_1 = '' 00109 if self.attached_body_1 is None: 00110 self.attached_body_1 = '' 00111 if self.body_type_1 is None: 00112 self.body_type_1 = 0 00113 if self.contact_body_2 is None: 00114 self.contact_body_2 = '' 00115 if self.attached_body_2 is None: 00116 self.attached_body_2 = '' 00117 if self.body_type_2 is None: 00118 self.body_type_2 = 0 00119 else: 00120 self.header = std_msgs.msg._Header.Header() 00121 self.position = geometry_msgs.msg.Point() 00122 self.normal = geometry_msgs.msg.Vector3() 00123 self.depth = 0. 00124 self.contact_body_1 = '' 00125 self.attached_body_1 = '' 00126 self.body_type_1 = 0 00127 self.contact_body_2 = '' 00128 self.attached_body_2 = '' 00129 self.body_type_2 = 0 00130 00131 def _get_types(self): 00132 """ 00133 internal API method 00134 """ 00135 return self._slot_types 00136 00137 def serialize(self, buff): 00138 """ 00139 serialize message into buffer 00140 @param buff: buffer 00141 @type buff: StringIO 00142 """ 00143 try: 00144 _x = self 00145 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00146 _x = self.header.frame_id 00147 length = len(_x) 00148 buff.write(struct.pack('<I%ss'%length, length, _x)) 00149 _x = self 00150 buff.write(_struct_7d.pack(_x.position.x, _x.position.y, _x.position.z, _x.normal.x, _x.normal.y, _x.normal.z, _x.depth)) 00151 _x = self.contact_body_1 00152 length = len(_x) 00153 buff.write(struct.pack('<I%ss'%length, length, _x)) 00154 _x = self.attached_body_1 00155 length = len(_x) 00156 buff.write(struct.pack('<I%ss'%length, length, _x)) 00157 buff.write(_struct_I.pack(self.body_type_1)) 00158 _x = self.contact_body_2 00159 length = len(_x) 00160 buff.write(struct.pack('<I%ss'%length, length, _x)) 00161 _x = self.attached_body_2 00162 length = len(_x) 00163 buff.write(struct.pack('<I%ss'%length, length, _x)) 00164 buff.write(_struct_I.pack(self.body_type_2)) 00165 except struct.error as se: self._check_types(se) 00166 except TypeError as te: self._check_types(te) 00167 00168 def deserialize(self, str): 00169 """ 00170 unpack serialized message in str into this message instance 00171 @param str: byte array of serialized message 00172 @type str: str 00173 """ 00174 try: 00175 if self.header is None: 00176 self.header = std_msgs.msg._Header.Header() 00177 if self.position is None: 00178 self.position = geometry_msgs.msg.Point() 00179 if self.normal is None: 00180 self.normal = geometry_msgs.msg.Vector3() 00181 end = 0 00182 _x = self 00183 start = end 00184 end += 12 00185 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00186 start = end 00187 end += 4 00188 (length,) = _struct_I.unpack(str[start:end]) 00189 start = end 00190 end += length 00191 self.header.frame_id = str[start:end] 00192 _x = self 00193 start = end 00194 end += 56 00195 (_x.position.x, _x.position.y, _x.position.z, _x.normal.x, _x.normal.y, _x.normal.z, _x.depth,) = _struct_7d.unpack(str[start:end]) 00196 start = end 00197 end += 4 00198 (length,) = _struct_I.unpack(str[start:end]) 00199 start = end 00200 end += length 00201 self.contact_body_1 = 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.attached_body_1 = str[start:end] 00208 start = end 00209 end += 4 00210 (self.body_type_1,) = _struct_I.unpack(str[start:end]) 00211 start = end 00212 end += 4 00213 (length,) = _struct_I.unpack(str[start:end]) 00214 start = end 00215 end += length 00216 self.contact_body_2 = str[start:end] 00217 start = end 00218 end += 4 00219 (length,) = _struct_I.unpack(str[start:end]) 00220 start = end 00221 end += length 00222 self.attached_body_2 = str[start:end] 00223 start = end 00224 end += 4 00225 (self.body_type_2,) = _struct_I.unpack(str[start:end]) 00226 return self 00227 except struct.error as e: 00228 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00229 00230 00231 def serialize_numpy(self, buff, numpy): 00232 """ 00233 serialize message with numpy array types into buffer 00234 @param buff: buffer 00235 @type buff: StringIO 00236 @param numpy: numpy python module 00237 @type numpy module 00238 """ 00239 try: 00240 _x = self 00241 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00242 _x = self.header.frame_id 00243 length = len(_x) 00244 buff.write(struct.pack('<I%ss'%length, length, _x)) 00245 _x = self 00246 buff.write(_struct_7d.pack(_x.position.x, _x.position.y, _x.position.z, _x.normal.x, _x.normal.y, _x.normal.z, _x.depth)) 00247 _x = self.contact_body_1 00248 length = len(_x) 00249 buff.write(struct.pack('<I%ss'%length, length, _x)) 00250 _x = self.attached_body_1 00251 length = len(_x) 00252 buff.write(struct.pack('<I%ss'%length, length, _x)) 00253 buff.write(_struct_I.pack(self.body_type_1)) 00254 _x = self.contact_body_2 00255 length = len(_x) 00256 buff.write(struct.pack('<I%ss'%length, length, _x)) 00257 _x = self.attached_body_2 00258 length = len(_x) 00259 buff.write(struct.pack('<I%ss'%length, length, _x)) 00260 buff.write(_struct_I.pack(self.body_type_2)) 00261 except struct.error as se: self._check_types(se) 00262 except TypeError as te: self._check_types(te) 00263 00264 def deserialize_numpy(self, str, numpy): 00265 """ 00266 unpack serialized message in str into this message instance using numpy for array types 00267 @param str: byte array of serialized message 00268 @type str: str 00269 @param numpy: numpy python module 00270 @type numpy: module 00271 """ 00272 try: 00273 if self.header is None: 00274 self.header = std_msgs.msg._Header.Header() 00275 if self.position is None: 00276 self.position = geometry_msgs.msg.Point() 00277 if self.normal is None: 00278 self.normal = geometry_msgs.msg.Vector3() 00279 end = 0 00280 _x = self 00281 start = end 00282 end += 12 00283 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00284 start = end 00285 end += 4 00286 (length,) = _struct_I.unpack(str[start:end]) 00287 start = end 00288 end += length 00289 self.header.frame_id = str[start:end] 00290 _x = self 00291 start = end 00292 end += 56 00293 (_x.position.x, _x.position.y, _x.position.z, _x.normal.x, _x.normal.y, _x.normal.z, _x.depth,) = _struct_7d.unpack(str[start:end]) 00294 start = end 00295 end += 4 00296 (length,) = _struct_I.unpack(str[start:end]) 00297 start = end 00298 end += length 00299 self.contact_body_1 = str[start:end] 00300 start = end 00301 end += 4 00302 (length,) = _struct_I.unpack(str[start:end]) 00303 start = end 00304 end += length 00305 self.attached_body_1 = str[start:end] 00306 start = end 00307 end += 4 00308 (self.body_type_1,) = _struct_I.unpack(str[start:end]) 00309 start = end 00310 end += 4 00311 (length,) = _struct_I.unpack(str[start:end]) 00312 start = end 00313 end += length 00314 self.contact_body_2 = str[start:end] 00315 start = end 00316 end += 4 00317 (length,) = _struct_I.unpack(str[start:end]) 00318 start = end 00319 end += length 00320 self.attached_body_2 = str[start:end] 00321 start = end 00322 end += 4 00323 (self.body_type_2,) = _struct_I.unpack(str[start:end]) 00324 return self 00325 except struct.error as e: 00326 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00327 00328 _struct_I = roslib.message.struct_I 00329 _struct_3I = struct.Struct("<3I") 00330 _struct_7d = struct.Struct("<7d")