$search
00001 """autogenerated by genmsg_py from ApplyJointEffortRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 00007 class ApplyJointEffortRequest(roslib.message.Message): 00008 _md5sum = "2c3396ab9af67a509ecd2167a8fe41a2" 00009 _type = "gazebo/ApplyJointEffortRequest" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """ 00012 00013 00014 string joint_name 00015 float64 effort 00016 time start_time 00017 00018 duration duration 00019 00020 00021 00022 00023 00024 """ 00025 __slots__ = ['joint_name','effort','start_time','duration'] 00026 _slot_types = ['string','float64','time','duration'] 00027 00028 def __init__(self, *args, **kwds): 00029 """ 00030 Constructor. Any message fields that are implicitly/explicitly 00031 set to None will be assigned a default value. The recommend 00032 use is keyword arguments as this is more robust to future message 00033 changes. You cannot mix in-order arguments and keyword arguments. 00034 00035 The available fields are: 00036 joint_name,effort,start_time,duration 00037 00038 @param args: complete set of field values, in .msg order 00039 @param kwds: use keyword arguments corresponding to message field names 00040 to set specific fields. 00041 """ 00042 if args or kwds: 00043 super(ApplyJointEffortRequest, self).__init__(*args, **kwds) 00044 #message fields cannot be None, assign default values for those that are 00045 if self.joint_name is None: 00046 self.joint_name = '' 00047 if self.effort is None: 00048 self.effort = 0. 00049 if self.start_time is None: 00050 self.start_time = roslib.rostime.Time() 00051 if self.duration is None: 00052 self.duration = roslib.rostime.Duration() 00053 else: 00054 self.joint_name = '' 00055 self.effort = 0. 00056 self.start_time = roslib.rostime.Time() 00057 self.duration = roslib.rostime.Duration() 00058 00059 def _get_types(self): 00060 """ 00061 internal API method 00062 """ 00063 return self._slot_types 00064 00065 def serialize(self, buff): 00066 """ 00067 serialize message into buffer 00068 @param buff: buffer 00069 @type buff: StringIO 00070 """ 00071 try: 00072 _x = self.joint_name 00073 length = len(_x) 00074 buff.write(struct.pack('<I%ss'%length, length, _x)) 00075 _x = self 00076 buff.write(_struct_d2I2i.pack(_x.effort, _x.start_time.secs, _x.start_time.nsecs, _x.duration.secs, _x.duration.nsecs)) 00077 except struct.error as se: self._check_types(se) 00078 except TypeError as te: self._check_types(te) 00079 00080 def deserialize(self, str): 00081 """ 00082 unpack serialized message in str into this message instance 00083 @param str: byte array of serialized message 00084 @type str: str 00085 """ 00086 try: 00087 if self.start_time is None: 00088 self.start_time = roslib.rostime.Time() 00089 if self.duration is None: 00090 self.duration = roslib.rostime.Duration() 00091 end = 0 00092 start = end 00093 end += 4 00094 (length,) = _struct_I.unpack(str[start:end]) 00095 start = end 00096 end += length 00097 self.joint_name = str[start:end] 00098 _x = self 00099 start = end 00100 end += 24 00101 (_x.effort, _x.start_time.secs, _x.start_time.nsecs, _x.duration.secs, _x.duration.nsecs,) = _struct_d2I2i.unpack(str[start:end]) 00102 self.start_time.canon() 00103 self.duration.canon() 00104 return self 00105 except struct.error as e: 00106 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00107 00108 00109 def serialize_numpy(self, buff, numpy): 00110 """ 00111 serialize message with numpy array types into buffer 00112 @param buff: buffer 00113 @type buff: StringIO 00114 @param numpy: numpy python module 00115 @type numpy module 00116 """ 00117 try: 00118 _x = self.joint_name 00119 length = len(_x) 00120 buff.write(struct.pack('<I%ss'%length, length, _x)) 00121 _x = self 00122 buff.write(_struct_d2I2i.pack(_x.effort, _x.start_time.secs, _x.start_time.nsecs, _x.duration.secs, _x.duration.nsecs)) 00123 except struct.error as se: self._check_types(se) 00124 except TypeError as te: self._check_types(te) 00125 00126 def deserialize_numpy(self, str, numpy): 00127 """ 00128 unpack serialized message in str into this message instance using numpy for array types 00129 @param str: byte array of serialized message 00130 @type str: str 00131 @param numpy: numpy python module 00132 @type numpy: module 00133 """ 00134 try: 00135 if self.start_time is None: 00136 self.start_time = roslib.rostime.Time() 00137 if self.duration is None: 00138 self.duration = roslib.rostime.Duration() 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.joint_name = str[start:end] 00146 _x = self 00147 start = end 00148 end += 24 00149 (_x.effort, _x.start_time.secs, _x.start_time.nsecs, _x.duration.secs, _x.duration.nsecs,) = _struct_d2I2i.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 _struct_I = roslib.message.struct_I 00157 _struct_d2I2i = struct.Struct("<d2I2i") 00158 """autogenerated by genmsg_py from ApplyJointEffortResponse.msg. Do not edit.""" 00159 import roslib.message 00160 import struct 00161 00162 00163 class ApplyJointEffortResponse(roslib.message.Message): 00164 _md5sum = "2ec6f3eff0161f4257b808b12bc830c2" 00165 _type = "gazebo/ApplyJointEffortResponse" 00166 _has_header = False #flag to mark the presence of a Header object 00167 _full_text = """bool success 00168 string status_message 00169 00170 00171 """ 00172 __slots__ = ['success','status_message'] 00173 _slot_types = ['bool','string'] 00174 00175 def __init__(self, *args, **kwds): 00176 """ 00177 Constructor. Any message fields that are implicitly/explicitly 00178 set to None will be assigned a default value. The recommend 00179 use is keyword arguments as this is more robust to future message 00180 changes. You cannot mix in-order arguments and keyword arguments. 00181 00182 The available fields are: 00183 success,status_message 00184 00185 @param args: complete set of field values, in .msg order 00186 @param kwds: use keyword arguments corresponding to message field names 00187 to set specific fields. 00188 """ 00189 if args or kwds: 00190 super(ApplyJointEffortResponse, self).__init__(*args, **kwds) 00191 #message fields cannot be None, assign default values for those that are 00192 if self.success is None: 00193 self.success = False 00194 if self.status_message is None: 00195 self.status_message = '' 00196 else: 00197 self.success = False 00198 self.status_message = '' 00199 00200 def _get_types(self): 00201 """ 00202 internal API method 00203 """ 00204 return self._slot_types 00205 00206 def serialize(self, buff): 00207 """ 00208 serialize message into buffer 00209 @param buff: buffer 00210 @type buff: StringIO 00211 """ 00212 try: 00213 buff.write(_struct_B.pack(self.success)) 00214 _x = self.status_message 00215 length = len(_x) 00216 buff.write(struct.pack('<I%ss'%length, length, _x)) 00217 except struct.error as se: self._check_types(se) 00218 except TypeError as te: self._check_types(te) 00219 00220 def deserialize(self, str): 00221 """ 00222 unpack serialized message in str into this message instance 00223 @param str: byte array of serialized message 00224 @type str: str 00225 """ 00226 try: 00227 end = 0 00228 start = end 00229 end += 1 00230 (self.success,) = _struct_B.unpack(str[start:end]) 00231 self.success = bool(self.success) 00232 start = end 00233 end += 4 00234 (length,) = _struct_I.unpack(str[start:end]) 00235 start = end 00236 end += length 00237 self.status_message = str[start:end] 00238 return self 00239 except struct.error as e: 00240 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00241 00242 00243 def serialize_numpy(self, buff, numpy): 00244 """ 00245 serialize message with numpy array types into buffer 00246 @param buff: buffer 00247 @type buff: StringIO 00248 @param numpy: numpy python module 00249 @type numpy module 00250 """ 00251 try: 00252 buff.write(_struct_B.pack(self.success)) 00253 _x = self.status_message 00254 length = len(_x) 00255 buff.write(struct.pack('<I%ss'%length, length, _x)) 00256 except struct.error as se: self._check_types(se) 00257 except TypeError as te: self._check_types(te) 00258 00259 def deserialize_numpy(self, str, numpy): 00260 """ 00261 unpack serialized message in str into this message instance using numpy for array types 00262 @param str: byte array of serialized message 00263 @type str: str 00264 @param numpy: numpy python module 00265 @type numpy: module 00266 """ 00267 try: 00268 end = 0 00269 start = end 00270 end += 1 00271 (self.success,) = _struct_B.unpack(str[start:end]) 00272 self.success = bool(self.success) 00273 start = end 00274 end += 4 00275 (length,) = _struct_I.unpack(str[start:end]) 00276 start = end 00277 end += length 00278 self.status_message = str[start:end] 00279 return self 00280 except struct.error as e: 00281 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00282 00283 _struct_I = roslib.message.struct_I 00284 _struct_B = struct.Struct("<B") 00285 class ApplyJointEffort(roslib.message.ServiceDefinition): 00286 _type = 'gazebo/ApplyJointEffort' 00287 _md5sum = 'c0039811b8cc919490b3cff748cdf46b' 00288 _request_class = ApplyJointEffortRequest 00289 _response_class = ApplyJointEffortResponse