00001 """autogenerated by genpy from sr_utilities/getJointStateRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class getJointStateRequest(genpy.Message):
00009 _md5sum = "d41d8cd98f00b204e9800998ecf8427e"
00010 _type = "sr_utilities/getJointStateRequest"
00011 _has_header = False
00012 _full_text = """
00013
00014 """
00015 __slots__ = []
00016 _slot_types = []
00017
00018 def __init__(self, *args, **kwds):
00019 """
00020 Constructor. Any message fields that are implicitly/explicitly
00021 set to None will be assigned a default value. The recommend
00022 use is keyword arguments as this is more robust to future message
00023 changes. You cannot mix in-order arguments and keyword arguments.
00024
00025 The available fields are:
00026
00027
00028 :param args: complete set of field values, in .msg order
00029 :param kwds: use keyword arguments corresponding to message field names
00030 to set specific fields.
00031 """
00032 if args or kwds:
00033 super(getJointStateRequest, self).__init__(*args, **kwds)
00034
00035 def _get_types(self):
00036 """
00037 internal API method
00038 """
00039 return self._slot_types
00040
00041 def serialize(self, buff):
00042 """
00043 serialize message into buffer
00044 :param buff: buffer, ``StringIO``
00045 """
00046 try:
00047 pass
00048 except struct.error as se: self._check_types(se)
00049 except TypeError as te: self._check_types(te)
00050
00051 def deserialize(self, str):
00052 """
00053 unpack serialized message in str into this message instance
00054 :param str: byte array of serialized message, ``str``
00055 """
00056 try:
00057 end = 0
00058 return self
00059 except struct.error as e:
00060 raise genpy.DeserializationError(e)
00061
00062
00063 def serialize_numpy(self, buff, numpy):
00064 """
00065 serialize message with numpy array types into buffer
00066 :param buff: buffer, ``StringIO``
00067 :param numpy: numpy python module
00068 """
00069 try:
00070 pass
00071 except struct.error as se: self._check_types(se)
00072 except TypeError as te: self._check_types(te)
00073
00074 def deserialize_numpy(self, str, numpy):
00075 """
00076 unpack serialized message in str into this message instance using numpy for array types
00077 :param str: byte array of serialized message, ``str``
00078 :param numpy: numpy python module
00079 """
00080 try:
00081 end = 0
00082 return self
00083 except struct.error as e:
00084 raise genpy.DeserializationError(e)
00085
00086 _struct_I = genpy.struct_I
00087 """autogenerated by genpy from sr_utilities/getJointStateResponse.msg. Do not edit."""
00088 import sys
00089 python3 = True if sys.hexversion > 0x03000000 else False
00090 import genpy
00091 import struct
00092
00093 import std_msgs.msg
00094 import sensor_msgs.msg
00095
00096 class getJointStateResponse(genpy.Message):
00097 _md5sum = "9ca061465ef0ed08771ed240c43789f5"
00098 _type = "sr_utilities/getJointStateResponse"
00099 _has_header = False
00100 _full_text = """sensor_msgs/JointState joint_state
00101
00102
00103 ================================================================================
00104 MSG: sensor_msgs/JointState
00105 # This is a message that holds data to describe the state of a set of torque controlled joints.
00106 #
00107 # The state of each joint (revolute or prismatic) is defined by:
00108 # * the position of the joint (rad or m),
00109 # * the velocity of the joint (rad/s or m/s) and
00110 # * the effort that is applied in the joint (Nm or N).
00111 #
00112 # Each joint is uniquely identified by its name
00113 # The header specifies the time at which the joint states were recorded. All the joint states
00114 # in one message have to be recorded at the same time.
00115 #
00116 # This message consists of a multiple arrays, one for each part of the joint state.
00117 # The goal is to make each of the fields optional. When e.g. your joints have no
00118 # effort associated with them, you can leave the effort array empty.
00119 #
00120 # All arrays in this message should have the same size, or be empty.
00121 # This is the only way to uniquely associate the joint name with the correct
00122 # states.
00123
00124
00125 Header header
00126
00127 string[] name
00128 float64[] position
00129 float64[] velocity
00130 float64[] effort
00131
00132 ================================================================================
00133 MSG: std_msgs/Header
00134 # Standard metadata for higher-level stamped data types.
00135 # This is generally used to communicate timestamped data
00136 # in a particular coordinate frame.
00137 #
00138 # sequence ID: consecutively increasing ID
00139 uint32 seq
00140 #Two-integer timestamp that is expressed as:
00141 # * stamp.secs: seconds (stamp_secs) since epoch
00142 # * stamp.nsecs: nanoseconds since stamp_secs
00143 # time-handling sugar is provided by the client library
00144 time stamp
00145 #Frame this data is associated with
00146 # 0: no frame
00147 # 1: global frame
00148 string frame_id
00149
00150 """
00151 __slots__ = ['joint_state']
00152 _slot_types = ['sensor_msgs/JointState']
00153
00154 def __init__(self, *args, **kwds):
00155 """
00156 Constructor. Any message fields that are implicitly/explicitly
00157 set to None will be assigned a default value. The recommend
00158 use is keyword arguments as this is more robust to future message
00159 changes. You cannot mix in-order arguments and keyword arguments.
00160
00161 The available fields are:
00162 joint_state
00163
00164 :param args: complete set of field values, in .msg order
00165 :param kwds: use keyword arguments corresponding to message field names
00166 to set specific fields.
00167 """
00168 if args or kwds:
00169 super(getJointStateResponse, self).__init__(*args, **kwds)
00170
00171 if self.joint_state is None:
00172 self.joint_state = sensor_msgs.msg.JointState()
00173 else:
00174 self.joint_state = sensor_msgs.msg.JointState()
00175
00176 def _get_types(self):
00177 """
00178 internal API method
00179 """
00180 return self._slot_types
00181
00182 def serialize(self, buff):
00183 """
00184 serialize message into buffer
00185 :param buff: buffer, ``StringIO``
00186 """
00187 try:
00188 _x = self
00189 buff.write(_struct_3I.pack(_x.joint_state.header.seq, _x.joint_state.header.stamp.secs, _x.joint_state.header.stamp.nsecs))
00190 _x = self.joint_state.header.frame_id
00191 length = len(_x)
00192 if python3 or type(_x) == unicode:
00193 _x = _x.encode('utf-8')
00194 length = len(_x)
00195 buff.write(struct.pack('<I%ss'%length, length, _x))
00196 length = len(self.joint_state.name)
00197 buff.write(_struct_I.pack(length))
00198 for val1 in self.joint_state.name:
00199 length = len(val1)
00200 if python3 or type(val1) == unicode:
00201 val1 = val1.encode('utf-8')
00202 length = len(val1)
00203 buff.write(struct.pack('<I%ss'%length, length, val1))
00204 length = len(self.joint_state.position)
00205 buff.write(_struct_I.pack(length))
00206 pattern = '<%sd'%length
00207 buff.write(struct.pack(pattern, *self.joint_state.position))
00208 length = len(self.joint_state.velocity)
00209 buff.write(_struct_I.pack(length))
00210 pattern = '<%sd'%length
00211 buff.write(struct.pack(pattern, *self.joint_state.velocity))
00212 length = len(self.joint_state.effort)
00213 buff.write(_struct_I.pack(length))
00214 pattern = '<%sd'%length
00215 buff.write(struct.pack(pattern, *self.joint_state.effort))
00216 except struct.error as se: self._check_types(se)
00217 except TypeError as te: self._check_types(te)
00218
00219 def deserialize(self, str):
00220 """
00221 unpack serialized message in str into this message instance
00222 :param str: byte array of serialized message, ``str``
00223 """
00224 try:
00225 if self.joint_state is None:
00226 self.joint_state = sensor_msgs.msg.JointState()
00227 end = 0
00228 _x = self
00229 start = end
00230 end += 12
00231 (_x.joint_state.header.seq, _x.joint_state.header.stamp.secs, _x.joint_state.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00232 start = end
00233 end += 4
00234 (length,) = _struct_I.unpack(str[start:end])
00235 start = end
00236 end += length
00237 if python3:
00238 self.joint_state.header.frame_id = str[start:end].decode('utf-8')
00239 else:
00240 self.joint_state.header.frame_id = str[start:end]
00241 start = end
00242 end += 4
00243 (length,) = _struct_I.unpack(str[start:end])
00244 self.joint_state.name = []
00245 for i in range(0, length):
00246 start = end
00247 end += 4
00248 (length,) = _struct_I.unpack(str[start:end])
00249 start = end
00250 end += length
00251 if python3:
00252 val1 = str[start:end].decode('utf-8')
00253 else:
00254 val1 = str[start:end]
00255 self.joint_state.name.append(val1)
00256 start = end
00257 end += 4
00258 (length,) = _struct_I.unpack(str[start:end])
00259 pattern = '<%sd'%length
00260 start = end
00261 end += struct.calcsize(pattern)
00262 self.joint_state.position = struct.unpack(pattern, str[start:end])
00263 start = end
00264 end += 4
00265 (length,) = _struct_I.unpack(str[start:end])
00266 pattern = '<%sd'%length
00267 start = end
00268 end += struct.calcsize(pattern)
00269 self.joint_state.velocity = struct.unpack(pattern, str[start:end])
00270 start = end
00271 end += 4
00272 (length,) = _struct_I.unpack(str[start:end])
00273 pattern = '<%sd'%length
00274 start = end
00275 end += struct.calcsize(pattern)
00276 self.joint_state.effort = struct.unpack(pattern, str[start:end])
00277 return self
00278 except struct.error as e:
00279 raise genpy.DeserializationError(e)
00280
00281
00282 def serialize_numpy(self, buff, numpy):
00283 """
00284 serialize message with numpy array types into buffer
00285 :param buff: buffer, ``StringIO``
00286 :param numpy: numpy python module
00287 """
00288 try:
00289 _x = self
00290 buff.write(_struct_3I.pack(_x.joint_state.header.seq, _x.joint_state.header.stamp.secs, _x.joint_state.header.stamp.nsecs))
00291 _x = self.joint_state.header.frame_id
00292 length = len(_x)
00293 if python3 or type(_x) == unicode:
00294 _x = _x.encode('utf-8')
00295 length = len(_x)
00296 buff.write(struct.pack('<I%ss'%length, length, _x))
00297 length = len(self.joint_state.name)
00298 buff.write(_struct_I.pack(length))
00299 for val1 in self.joint_state.name:
00300 length = len(val1)
00301 if python3 or type(val1) == unicode:
00302 val1 = val1.encode('utf-8')
00303 length = len(val1)
00304 buff.write(struct.pack('<I%ss'%length, length, val1))
00305 length = len(self.joint_state.position)
00306 buff.write(_struct_I.pack(length))
00307 pattern = '<%sd'%length
00308 buff.write(self.joint_state.position.tostring())
00309 length = len(self.joint_state.velocity)
00310 buff.write(_struct_I.pack(length))
00311 pattern = '<%sd'%length
00312 buff.write(self.joint_state.velocity.tostring())
00313 length = len(self.joint_state.effort)
00314 buff.write(_struct_I.pack(length))
00315 pattern = '<%sd'%length
00316 buff.write(self.joint_state.effort.tostring())
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, ``str``
00324 :param numpy: numpy python module
00325 """
00326 try:
00327 if self.joint_state is None:
00328 self.joint_state = sensor_msgs.msg.JointState()
00329 end = 0
00330 _x = self
00331 start = end
00332 end += 12
00333 (_x.joint_state.header.seq, _x.joint_state.header.stamp.secs, _x.joint_state.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00334 start = end
00335 end += 4
00336 (length,) = _struct_I.unpack(str[start:end])
00337 start = end
00338 end += length
00339 if python3:
00340 self.joint_state.header.frame_id = str[start:end].decode('utf-8')
00341 else:
00342 self.joint_state.header.frame_id = str[start:end]
00343 start = end
00344 end += 4
00345 (length,) = _struct_I.unpack(str[start:end])
00346 self.joint_state.name = []
00347 for i in range(0, length):
00348 start = end
00349 end += 4
00350 (length,) = _struct_I.unpack(str[start:end])
00351 start = end
00352 end += length
00353 if python3:
00354 val1 = str[start:end].decode('utf-8')
00355 else:
00356 val1 = str[start:end]
00357 self.joint_state.name.append(val1)
00358 start = end
00359 end += 4
00360 (length,) = _struct_I.unpack(str[start:end])
00361 pattern = '<%sd'%length
00362 start = end
00363 end += struct.calcsize(pattern)
00364 self.joint_state.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00365 start = end
00366 end += 4
00367 (length,) = _struct_I.unpack(str[start:end])
00368 pattern = '<%sd'%length
00369 start = end
00370 end += struct.calcsize(pattern)
00371 self.joint_state.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00372 start = end
00373 end += 4
00374 (length,) = _struct_I.unpack(str[start:end])
00375 pattern = '<%sd'%length
00376 start = end
00377 end += struct.calcsize(pattern)
00378 self.joint_state.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00379 return self
00380 except struct.error as e:
00381 raise genpy.DeserializationError(e)
00382
00383 _struct_I = genpy.struct_I
00384 _struct_3I = struct.Struct("<3I")
00385 class getJointState(object):
00386 _type = 'sr_utilities/getJointState'
00387 _md5sum = '9ca061465ef0ed08771ed240c43789f5'
00388 _request_class = getJointStateRequest
00389 _response_class = getJointStateResponse