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