00001 """autogenerated by genpy from gazebo_msgs/ApplyJointEffortRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import genpy
00008
00009 class ApplyJointEffortRequest(genpy.Message):
00010 _md5sum = "2c3396ab9af67a509ecd2167a8fe41a2"
00011 _type = "gazebo_msgs/ApplyJointEffortRequest"
00012 _has_header = False
00013 _full_text = """
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
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 = genpy.Time()
00051 if self.duration is None:
00052 self.duration = genpy.Duration()
00053 else:
00054 self.joint_name = ''
00055 self.effort = 0.
00056 self.start_time = genpy.Time()
00057 self.duration = genpy.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, ``StringIO``
00069 """
00070 try:
00071 _x = self.joint_name
00072 length = len(_x)
00073 if python3 or type(_x) == unicode:
00074 _x = _x.encode('utf-8')
00075 length = len(_x)
00076 buff.write(struct.pack('<I%ss'%length, length, _x))
00077 _x = self
00078 buff.write(_struct_d2I2i.pack(_x.effort, _x.start_time.secs, _x.start_time.nsecs, _x.duration.secs, _x.duration.nsecs))
00079 except struct.error as se: self._check_types(se)
00080 except TypeError as te: self._check_types(te)
00081
00082 def deserialize(self, str):
00083 """
00084 unpack serialized message in str into this message instance
00085 :param str: byte array of serialized message, ``str``
00086 """
00087 try:
00088 if self.start_time is None:
00089 self.start_time = genpy.Time()
00090 if self.duration is None:
00091 self.duration = genpy.Duration()
00092 end = 0
00093 start = end
00094 end += 4
00095 (length,) = _struct_I.unpack(str[start:end])
00096 start = end
00097 end += length
00098 if python3:
00099 self.joint_name = str[start:end].decode('utf-8')
00100 else:
00101 self.joint_name = str[start:end]
00102 _x = self
00103 start = end
00104 end += 24
00105 (_x.effort, _x.start_time.secs, _x.start_time.nsecs, _x.duration.secs, _x.duration.nsecs,) = _struct_d2I2i.unpack(str[start:end])
00106 self.start_time.canon()
00107 self.duration.canon()
00108 return self
00109 except struct.error as e:
00110 raise genpy.DeserializationError(e)
00111
00112
00113 def serialize_numpy(self, buff, numpy):
00114 """
00115 serialize message with numpy array types into buffer
00116 :param buff: buffer, ``StringIO``
00117 :param numpy: numpy python module
00118 """
00119 try:
00120 _x = self.joint_name
00121 length = len(_x)
00122 if python3 or type(_x) == unicode:
00123 _x = _x.encode('utf-8')
00124 length = len(_x)
00125 buff.write(struct.pack('<I%ss'%length, length, _x))
00126 _x = self
00127 buff.write(_struct_d2I2i.pack(_x.effort, _x.start_time.secs, _x.start_time.nsecs, _x.duration.secs, _x.duration.nsecs))
00128 except struct.error as se: self._check_types(se)
00129 except TypeError as te: self._check_types(te)
00130
00131 def deserialize_numpy(self, str, numpy):
00132 """
00133 unpack serialized message in str into this message instance using numpy for array types
00134 :param str: byte array of serialized message, ``str``
00135 :param numpy: numpy python module
00136 """
00137 try:
00138 if self.start_time is None:
00139 self.start_time = genpy.Time()
00140 if self.duration is None:
00141 self.duration = genpy.Duration()
00142 end = 0
00143 start = end
00144 end += 4
00145 (length,) = _struct_I.unpack(str[start:end])
00146 start = end
00147 end += length
00148 if python3:
00149 self.joint_name = str[start:end].decode('utf-8')
00150 else:
00151 self.joint_name = str[start:end]
00152 _x = self
00153 start = end
00154 end += 24
00155 (_x.effort, _x.start_time.secs, _x.start_time.nsecs, _x.duration.secs, _x.duration.nsecs,) = _struct_d2I2i.unpack(str[start:end])
00156 self.start_time.canon()
00157 self.duration.canon()
00158 return self
00159 except struct.error as e:
00160 raise genpy.DeserializationError(e)
00161
00162 _struct_I = genpy.struct_I
00163 _struct_d2I2i = struct.Struct("<d2I2i")
00164 """autogenerated by genpy from gazebo_msgs/ApplyJointEffortResponse.msg. Do not edit."""
00165 import sys
00166 python3 = True if sys.hexversion > 0x03000000 else False
00167 import genpy
00168 import struct
00169
00170
00171 class ApplyJointEffortResponse(genpy.Message):
00172 _md5sum = "2ec6f3eff0161f4257b808b12bc830c2"
00173 _type = "gazebo_msgs/ApplyJointEffortResponse"
00174 _has_header = False
00175 _full_text = """bool success
00176 string status_message
00177
00178
00179 """
00180 __slots__ = ['success','status_message']
00181 _slot_types = ['bool','string']
00182
00183 def __init__(self, *args, **kwds):
00184 """
00185 Constructor. Any message fields that are implicitly/explicitly
00186 set to None will be assigned a default value. The recommend
00187 use is keyword arguments as this is more robust to future message
00188 changes. You cannot mix in-order arguments and keyword arguments.
00189
00190 The available fields are:
00191 success,status_message
00192
00193 :param args: complete set of field values, in .msg order
00194 :param kwds: use keyword arguments corresponding to message field names
00195 to set specific fields.
00196 """
00197 if args or kwds:
00198 super(ApplyJointEffortResponse, self).__init__(*args, **kwds)
00199
00200 if self.success is None:
00201 self.success = False
00202 if self.status_message is None:
00203 self.status_message = ''
00204 else:
00205 self.success = False
00206 self.status_message = ''
00207
00208 def _get_types(self):
00209 """
00210 internal API method
00211 """
00212 return self._slot_types
00213
00214 def serialize(self, buff):
00215 """
00216 serialize message into buffer
00217 :param buff: buffer, ``StringIO``
00218 """
00219 try:
00220 buff.write(_struct_B.pack(self.success))
00221 _x = self.status_message
00222 length = len(_x)
00223 if python3 or type(_x) == unicode:
00224 _x = _x.encode('utf-8')
00225 length = len(_x)
00226 buff.write(struct.pack('<I%ss'%length, length, _x))
00227 except struct.error as se: self._check_types(se)
00228 except TypeError as te: self._check_types(te)
00229
00230 def deserialize(self, str):
00231 """
00232 unpack serialized message in str into this message instance
00233 :param str: byte array of serialized message, ``str``
00234 """
00235 try:
00236 end = 0
00237 start = end
00238 end += 1
00239 (self.success,) = _struct_B.unpack(str[start:end])
00240 self.success = bool(self.success)
00241 start = end
00242 end += 4
00243 (length,) = _struct_I.unpack(str[start:end])
00244 start = end
00245 end += length
00246 if python3:
00247 self.status_message = str[start:end].decode('utf-8')
00248 else:
00249 self.status_message = str[start:end]
00250 return self
00251 except struct.error as e:
00252 raise genpy.DeserializationError(e)
00253
00254
00255 def serialize_numpy(self, buff, numpy):
00256 """
00257 serialize message with numpy array types into buffer
00258 :param buff: buffer, ``StringIO``
00259 :param numpy: numpy python module
00260 """
00261 try:
00262 buff.write(_struct_B.pack(self.success))
00263 _x = self.status_message
00264 length = len(_x)
00265 if python3 or type(_x) == unicode:
00266 _x = _x.encode('utf-8')
00267 length = len(_x)
00268 buff.write(struct.pack('<I%ss'%length, length, _x))
00269 except struct.error as se: self._check_types(se)
00270 except TypeError as te: self._check_types(te)
00271
00272 def deserialize_numpy(self, str, numpy):
00273 """
00274 unpack serialized message in str into this message instance using numpy for array types
00275 :param str: byte array of serialized message, ``str``
00276 :param numpy: numpy python module
00277 """
00278 try:
00279 end = 0
00280 start = end
00281 end += 1
00282 (self.success,) = _struct_B.unpack(str[start:end])
00283 self.success = bool(self.success)
00284 start = end
00285 end += 4
00286 (length,) = _struct_I.unpack(str[start:end])
00287 start = end
00288 end += length
00289 if python3:
00290 self.status_message = str[start:end].decode('utf-8')
00291 else:
00292 self.status_message = str[start:end]
00293 return self
00294 except struct.error as e:
00295 raise genpy.DeserializationError(e)
00296
00297 _struct_I = genpy.struct_I
00298 _struct_B = struct.Struct("<B")
00299 class ApplyJointEffort(object):
00300 _type = 'gazebo_msgs/ApplyJointEffort'
00301 _md5sum = 'c0039811b8cc919490b3cff748cdf46b'
00302 _request_class = ApplyJointEffortRequest
00303 _response_class = ApplyJointEffortResponse