$search
00001 """autogenerated by genmsg_py from ApplyBodyWrenchRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import roslib.rostime 00007 00008 class ApplyBodyWrenchRequest(roslib.message.Message): 00009 _md5sum = "e37e6adf97eba5095baa77dffb71e5bd" 00010 _type = "gazebo/ApplyBodyWrenchRequest" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """ 00013 00014 00015 00016 00017 string body_name 00018 00019 string reference_frame 00020 00021 geometry_msgs/Point reference_point 00022 geometry_msgs/Wrench wrench 00023 time start_time 00024 00025 00026 duration duration 00027 00028 00029 00030 00031 00032 ================================================================================ 00033 MSG: geometry_msgs/Point 00034 # This contains the position of a point in free space 00035 float64 x 00036 float64 y 00037 float64 z 00038 00039 ================================================================================ 00040 MSG: geometry_msgs/Wrench 00041 # This represents force in free space, seperated into 00042 # it's linear and angular parts. 00043 Vector3 force 00044 Vector3 torque 00045 00046 ================================================================================ 00047 MSG: geometry_msgs/Vector3 00048 # This represents a vector in free space. 00049 00050 float64 x 00051 float64 y 00052 float64 z 00053 """ 00054 __slots__ = ['body_name','reference_frame','reference_point','wrench','start_time','duration'] 00055 _slot_types = ['string','string','geometry_msgs/Point','geometry_msgs/Wrench','time','duration'] 00056 00057 def __init__(self, *args, **kwds): 00058 """ 00059 Constructor. Any message fields that are implicitly/explicitly 00060 set to None will be assigned a default value. The recommend 00061 use is keyword arguments as this is more robust to future message 00062 changes. You cannot mix in-order arguments and keyword arguments. 00063 00064 The available fields are: 00065 body_name,reference_frame,reference_point,wrench,start_time,duration 00066 00067 @param args: complete set of field values, in .msg order 00068 @param kwds: use keyword arguments corresponding to message field names 00069 to set specific fields. 00070 """ 00071 if args or kwds: 00072 super(ApplyBodyWrenchRequest, self).__init__(*args, **kwds) 00073 #message fields cannot be None, assign default values for those that are 00074 if self.body_name is None: 00075 self.body_name = '' 00076 if self.reference_frame is None: 00077 self.reference_frame = '' 00078 if self.reference_point is None: 00079 self.reference_point = geometry_msgs.msg.Point() 00080 if self.wrench is None: 00081 self.wrench = geometry_msgs.msg.Wrench() 00082 if self.start_time is None: 00083 self.start_time = roslib.rostime.Time() 00084 if self.duration is None: 00085 self.duration = roslib.rostime.Duration() 00086 else: 00087 self.body_name = '' 00088 self.reference_frame = '' 00089 self.reference_point = geometry_msgs.msg.Point() 00090 self.wrench = geometry_msgs.msg.Wrench() 00091 self.start_time = roslib.rostime.Time() 00092 self.duration = roslib.rostime.Duration() 00093 00094 def _get_types(self): 00095 """ 00096 internal API method 00097 """ 00098 return self._slot_types 00099 00100 def serialize(self, buff): 00101 """ 00102 serialize message into buffer 00103 @param buff: buffer 00104 @type buff: StringIO 00105 """ 00106 try: 00107 _x = self.body_name 00108 length = len(_x) 00109 buff.write(struct.pack('<I%ss'%length, length, _x)) 00110 _x = self.reference_frame 00111 length = len(_x) 00112 buff.write(struct.pack('<I%ss'%length, length, _x)) 00113 _x = self 00114 buff.write(_struct_9d2I2i.pack(_x.reference_point.x, _x.reference_point.y, _x.reference_point.z, _x.wrench.force.x, _x.wrench.force.y, _x.wrench.force.z, _x.wrench.torque.x, _x.wrench.torque.y, _x.wrench.torque.z, _x.start_time.secs, _x.start_time.nsecs, _x.duration.secs, _x.duration.nsecs)) 00115 except struct.error as se: self._check_types(se) 00116 except TypeError as te: self._check_types(te) 00117 00118 def deserialize(self, str): 00119 """ 00120 unpack serialized message in str into this message instance 00121 @param str: byte array of serialized message 00122 @type str: str 00123 """ 00124 try: 00125 if self.reference_point is None: 00126 self.reference_point = geometry_msgs.msg.Point() 00127 if self.wrench is None: 00128 self.wrench = geometry_msgs.msg.Wrench() 00129 if self.start_time is None: 00130 self.start_time = roslib.rostime.Time() 00131 if self.duration is None: 00132 self.duration = roslib.rostime.Duration() 00133 end = 0 00134 start = end 00135 end += 4 00136 (length,) = _struct_I.unpack(str[start:end]) 00137 start = end 00138 end += length 00139 self.body_name = str[start:end] 00140 start = end 00141 end += 4 00142 (length,) = _struct_I.unpack(str[start:end]) 00143 start = end 00144 end += length 00145 self.reference_frame = str[start:end] 00146 _x = self 00147 start = end 00148 end += 88 00149 (_x.reference_point.x, _x.reference_point.y, _x.reference_point.z, _x.wrench.force.x, _x.wrench.force.y, _x.wrench.force.z, _x.wrench.torque.x, _x.wrench.torque.y, _x.wrench.torque.z, _x.start_time.secs, _x.start_time.nsecs, _x.duration.secs, _x.duration.nsecs,) = _struct_9d2I2i.unpack(str[start:end]) 00150 self.start_time.canon() 00151 self.duration.canon() 00152 return self 00153 except struct.error as e: 00154 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00155 00156 00157 def serialize_numpy(self, buff, numpy): 00158 """ 00159 serialize message with numpy array types into buffer 00160 @param buff: buffer 00161 @type buff: StringIO 00162 @param numpy: numpy python module 00163 @type numpy module 00164 """ 00165 try: 00166 _x = self.body_name 00167 length = len(_x) 00168 buff.write(struct.pack('<I%ss'%length, length, _x)) 00169 _x = self.reference_frame 00170 length = len(_x) 00171 buff.write(struct.pack('<I%ss'%length, length, _x)) 00172 _x = self 00173 buff.write(_struct_9d2I2i.pack(_x.reference_point.x, _x.reference_point.y, _x.reference_point.z, _x.wrench.force.x, _x.wrench.force.y, _x.wrench.force.z, _x.wrench.torque.x, _x.wrench.torque.y, _x.wrench.torque.z, _x.start_time.secs, _x.start_time.nsecs, _x.duration.secs, _x.duration.nsecs)) 00174 except struct.error as se: self._check_types(se) 00175 except TypeError as te: self._check_types(te) 00176 00177 def deserialize_numpy(self, str, numpy): 00178 """ 00179 unpack serialized message in str into this message instance using numpy for array types 00180 @param str: byte array of serialized message 00181 @type str: str 00182 @param numpy: numpy python module 00183 @type numpy: module 00184 """ 00185 try: 00186 if self.reference_point is None: 00187 self.reference_point = geometry_msgs.msg.Point() 00188 if self.wrench is None: 00189 self.wrench = geometry_msgs.msg.Wrench() 00190 if self.start_time is None: 00191 self.start_time = roslib.rostime.Time() 00192 if self.duration is None: 00193 self.duration = roslib.rostime.Duration() 00194 end = 0 00195 start = end 00196 end += 4 00197 (length,) = _struct_I.unpack(str[start:end]) 00198 start = end 00199 end += length 00200 self.body_name = str[start:end] 00201 start = end 00202 end += 4 00203 (length,) = _struct_I.unpack(str[start:end]) 00204 start = end 00205 end += length 00206 self.reference_frame = str[start:end] 00207 _x = self 00208 start = end 00209 end += 88 00210 (_x.reference_point.x, _x.reference_point.y, _x.reference_point.z, _x.wrench.force.x, _x.wrench.force.y, _x.wrench.force.z, _x.wrench.torque.x, _x.wrench.torque.y, _x.wrench.torque.z, _x.start_time.secs, _x.start_time.nsecs, _x.duration.secs, _x.duration.nsecs,) = _struct_9d2I2i.unpack(str[start:end]) 00211 self.start_time.canon() 00212 self.duration.canon() 00213 return self 00214 except struct.error as e: 00215 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00216 00217 _struct_I = roslib.message.struct_I 00218 _struct_9d2I2i = struct.Struct("<9d2I2i") 00219 """autogenerated by genmsg_py from ApplyBodyWrenchResponse.msg. Do not edit.""" 00220 import roslib.message 00221 import struct 00222 00223 00224 class ApplyBodyWrenchResponse(roslib.message.Message): 00225 _md5sum = "2ec6f3eff0161f4257b808b12bc830c2" 00226 _type = "gazebo/ApplyBodyWrenchResponse" 00227 _has_header = False #flag to mark the presence of a Header object 00228 _full_text = """bool success 00229 string status_message 00230 00231 00232 """ 00233 __slots__ = ['success','status_message'] 00234 _slot_types = ['bool','string'] 00235 00236 def __init__(self, *args, **kwds): 00237 """ 00238 Constructor. Any message fields that are implicitly/explicitly 00239 set to None will be assigned a default value. The recommend 00240 use is keyword arguments as this is more robust to future message 00241 changes. You cannot mix in-order arguments and keyword arguments. 00242 00243 The available fields are: 00244 success,status_message 00245 00246 @param args: complete set of field values, in .msg order 00247 @param kwds: use keyword arguments corresponding to message field names 00248 to set specific fields. 00249 """ 00250 if args or kwds: 00251 super(ApplyBodyWrenchResponse, self).__init__(*args, **kwds) 00252 #message fields cannot be None, assign default values for those that are 00253 if self.success is None: 00254 self.success = False 00255 if self.status_message is None: 00256 self.status_message = '' 00257 else: 00258 self.success = False 00259 self.status_message = '' 00260 00261 def _get_types(self): 00262 """ 00263 internal API method 00264 """ 00265 return self._slot_types 00266 00267 def serialize(self, buff): 00268 """ 00269 serialize message into buffer 00270 @param buff: buffer 00271 @type buff: StringIO 00272 """ 00273 try: 00274 buff.write(_struct_B.pack(self.success)) 00275 _x = self.status_message 00276 length = len(_x) 00277 buff.write(struct.pack('<I%ss'%length, length, _x)) 00278 except struct.error as se: self._check_types(se) 00279 except TypeError as te: self._check_types(te) 00280 00281 def deserialize(self, str): 00282 """ 00283 unpack serialized message in str into this message instance 00284 @param str: byte array of serialized message 00285 @type str: str 00286 """ 00287 try: 00288 end = 0 00289 start = end 00290 end += 1 00291 (self.success,) = _struct_B.unpack(str[start:end]) 00292 self.success = bool(self.success) 00293 start = end 00294 end += 4 00295 (length,) = _struct_I.unpack(str[start:end]) 00296 start = end 00297 end += length 00298 self.status_message = str[start:end] 00299 return self 00300 except struct.error as e: 00301 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00302 00303 00304 def serialize_numpy(self, buff, numpy): 00305 """ 00306 serialize message with numpy array types into buffer 00307 @param buff: buffer 00308 @type buff: StringIO 00309 @param numpy: numpy python module 00310 @type numpy module 00311 """ 00312 try: 00313 buff.write(_struct_B.pack(self.success)) 00314 _x = self.status_message 00315 length = len(_x) 00316 buff.write(struct.pack('<I%ss'%length, length, _x)) 00317 except struct.error as se: self._check_types(se) 00318 except TypeError as te: self._check_types(te) 00319 00320 def deserialize_numpy(self, str, numpy): 00321 """ 00322 unpack serialized message in str into this message instance using numpy for array types 00323 @param str: byte array of serialized message 00324 @type str: str 00325 @param numpy: numpy python module 00326 @type numpy: module 00327 """ 00328 try: 00329 end = 0 00330 start = end 00331 end += 1 00332 (self.success,) = _struct_B.unpack(str[start:end]) 00333 self.success = bool(self.success) 00334 start = end 00335 end += 4 00336 (length,) = _struct_I.unpack(str[start:end]) 00337 start = end 00338 end += length 00339 self.status_message = str[start:end] 00340 return self 00341 except struct.error as e: 00342 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00343 00344 _struct_I = roslib.message.struct_I 00345 _struct_B = struct.Struct("<B") 00346 class ApplyBodyWrench(roslib.message.ServiceDefinition): 00347 _type = 'gazebo/ApplyBodyWrench' 00348 _md5sum = '585b9f9618aa0581b207e2f2d90866bc' 00349 _request_class = ApplyBodyWrenchRequest 00350 _response_class = ApplyBodyWrenchResponse