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