$search
00001 """autogenerated by genmsg_py from JointImpedances.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import brics_actuator.msg 00006 import roslib.rostime 00007 00008 class JointImpedances(roslib.message.Message): 00009 _md5sum = "14fdbb76121290f17525acd99e7242c6" 00010 _type = "brics_actuator/JointImpedances" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """Poison poisonStamp 00013 JointValue[] dampings 00014 JointValue[] stiffnesses 00015 00016 ================================================================================ 00017 MSG: brics_actuator/Poison 00018 string originator # node id 00019 string description # encoding still an issue 00020 float32 qos # reliability of the channel 00021 # 0..1 where 1 means healthy 00022 00023 ================================================================================ 00024 MSG: brics_actuator/JointValue 00025 time timeStamp #time of the data 00026 string joint_uri 00027 string unit #if empy expects si units, you can use boost::unit 00028 float64 value 00029 00030 """ 00031 __slots__ = ['poisonStamp','dampings','stiffnesses'] 00032 _slot_types = ['brics_actuator/Poison','brics_actuator/JointValue[]','brics_actuator/JointValue[]'] 00033 00034 def __init__(self, *args, **kwds): 00035 """ 00036 Constructor. Any message fields that are implicitly/explicitly 00037 set to None will be assigned a default value. The recommend 00038 use is keyword arguments as this is more robust to future message 00039 changes. You cannot mix in-order arguments and keyword arguments. 00040 00041 The available fields are: 00042 poisonStamp,dampings,stiffnesses 00043 00044 @param args: complete set of field values, in .msg order 00045 @param kwds: use keyword arguments corresponding to message field names 00046 to set specific fields. 00047 """ 00048 if args or kwds: 00049 super(JointImpedances, self).__init__(*args, **kwds) 00050 #message fields cannot be None, assign default values for those that are 00051 if self.poisonStamp is None: 00052 self.poisonStamp = brics_actuator.msg.Poison() 00053 if self.dampings is None: 00054 self.dampings = [] 00055 if self.stiffnesses is None: 00056 self.stiffnesses = [] 00057 else: 00058 self.poisonStamp = brics_actuator.msg.Poison() 00059 self.dampings = [] 00060 self.stiffnesses = [] 00061 00062 def _get_types(self): 00063 """ 00064 internal API method 00065 """ 00066 return self._slot_types 00067 00068 def serialize(self, buff): 00069 """ 00070 serialize message into buffer 00071 @param buff: buffer 00072 @type buff: StringIO 00073 """ 00074 try: 00075 _x = self.poisonStamp.originator 00076 length = len(_x) 00077 buff.write(struct.pack('<I%ss'%length, length, _x)) 00078 _x = self.poisonStamp.description 00079 length = len(_x) 00080 buff.write(struct.pack('<I%ss'%length, length, _x)) 00081 buff.write(_struct_f.pack(self.poisonStamp.qos)) 00082 length = len(self.dampings) 00083 buff.write(_struct_I.pack(length)) 00084 for val1 in self.dampings: 00085 _v1 = val1.timeStamp 00086 _x = _v1 00087 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00088 _x = val1.joint_uri 00089 length = len(_x) 00090 buff.write(struct.pack('<I%ss'%length, length, _x)) 00091 _x = val1.unit 00092 length = len(_x) 00093 buff.write(struct.pack('<I%ss'%length, length, _x)) 00094 buff.write(_struct_d.pack(val1.value)) 00095 length = len(self.stiffnesses) 00096 buff.write(_struct_I.pack(length)) 00097 for val1 in self.stiffnesses: 00098 _v2 = val1.timeStamp 00099 _x = _v2 00100 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00101 _x = val1.joint_uri 00102 length = len(_x) 00103 buff.write(struct.pack('<I%ss'%length, length, _x)) 00104 _x = val1.unit 00105 length = len(_x) 00106 buff.write(struct.pack('<I%ss'%length, length, _x)) 00107 buff.write(_struct_d.pack(val1.value)) 00108 except struct.error as se: self._check_types(se) 00109 except TypeError as te: self._check_types(te) 00110 00111 def deserialize(self, str): 00112 """ 00113 unpack serialized message in str into this message instance 00114 @param str: byte array of serialized message 00115 @type str: str 00116 """ 00117 try: 00118 if self.poisonStamp is None: 00119 self.poisonStamp = brics_actuator.msg.Poison() 00120 end = 0 00121 start = end 00122 end += 4 00123 (length,) = _struct_I.unpack(str[start:end]) 00124 start = end 00125 end += length 00126 self.poisonStamp.originator = str[start:end] 00127 start = end 00128 end += 4 00129 (length,) = _struct_I.unpack(str[start:end]) 00130 start = end 00131 end += length 00132 self.poisonStamp.description = str[start:end] 00133 start = end 00134 end += 4 00135 (self.poisonStamp.qos,) = _struct_f.unpack(str[start:end]) 00136 start = end 00137 end += 4 00138 (length,) = _struct_I.unpack(str[start:end]) 00139 self.dampings = [] 00140 for i in range(0, length): 00141 val1 = brics_actuator.msg.JointValue() 00142 _v3 = val1.timeStamp 00143 _x = _v3 00144 start = end 00145 end += 8 00146 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00147 start = end 00148 end += 4 00149 (length,) = _struct_I.unpack(str[start:end]) 00150 start = end 00151 end += length 00152 val1.joint_uri = str[start:end] 00153 start = end 00154 end += 4 00155 (length,) = _struct_I.unpack(str[start:end]) 00156 start = end 00157 end += length 00158 val1.unit = str[start:end] 00159 start = end 00160 end += 8 00161 (val1.value,) = _struct_d.unpack(str[start:end]) 00162 self.dampings.append(val1) 00163 start = end 00164 end += 4 00165 (length,) = _struct_I.unpack(str[start:end]) 00166 self.stiffnesses = [] 00167 for i in range(0, length): 00168 val1 = brics_actuator.msg.JointValue() 00169 _v4 = val1.timeStamp 00170 _x = _v4 00171 start = end 00172 end += 8 00173 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00174 start = end 00175 end += 4 00176 (length,) = _struct_I.unpack(str[start:end]) 00177 start = end 00178 end += length 00179 val1.joint_uri = str[start:end] 00180 start = end 00181 end += 4 00182 (length,) = _struct_I.unpack(str[start:end]) 00183 start = end 00184 end += length 00185 val1.unit = str[start:end] 00186 start = end 00187 end += 8 00188 (val1.value,) = _struct_d.unpack(str[start:end]) 00189 self.stiffnesses.append(val1) 00190 return self 00191 except struct.error as e: 00192 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00193 00194 00195 def serialize_numpy(self, buff, numpy): 00196 """ 00197 serialize message with numpy array types into buffer 00198 @param buff: buffer 00199 @type buff: StringIO 00200 @param numpy: numpy python module 00201 @type numpy module 00202 """ 00203 try: 00204 _x = self.poisonStamp.originator 00205 length = len(_x) 00206 buff.write(struct.pack('<I%ss'%length, length, _x)) 00207 _x = self.poisonStamp.description 00208 length = len(_x) 00209 buff.write(struct.pack('<I%ss'%length, length, _x)) 00210 buff.write(_struct_f.pack(self.poisonStamp.qos)) 00211 length = len(self.dampings) 00212 buff.write(_struct_I.pack(length)) 00213 for val1 in self.dampings: 00214 _v5 = val1.timeStamp 00215 _x = _v5 00216 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00217 _x = val1.joint_uri 00218 length = len(_x) 00219 buff.write(struct.pack('<I%ss'%length, length, _x)) 00220 _x = val1.unit 00221 length = len(_x) 00222 buff.write(struct.pack('<I%ss'%length, length, _x)) 00223 buff.write(_struct_d.pack(val1.value)) 00224 length = len(self.stiffnesses) 00225 buff.write(_struct_I.pack(length)) 00226 for val1 in self.stiffnesses: 00227 _v6 = val1.timeStamp 00228 _x = _v6 00229 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00230 _x = val1.joint_uri 00231 length = len(_x) 00232 buff.write(struct.pack('<I%ss'%length, length, _x)) 00233 _x = val1.unit 00234 length = len(_x) 00235 buff.write(struct.pack('<I%ss'%length, length, _x)) 00236 buff.write(_struct_d.pack(val1.value)) 00237 except struct.error as se: self._check_types(se) 00238 except TypeError as te: self._check_types(te) 00239 00240 def deserialize_numpy(self, str, numpy): 00241 """ 00242 unpack serialized message in str into this message instance using numpy for array types 00243 @param str: byte array of serialized message 00244 @type str: str 00245 @param numpy: numpy python module 00246 @type numpy: module 00247 """ 00248 try: 00249 if self.poisonStamp is None: 00250 self.poisonStamp = brics_actuator.msg.Poison() 00251 end = 0 00252 start = end 00253 end += 4 00254 (length,) = _struct_I.unpack(str[start:end]) 00255 start = end 00256 end += length 00257 self.poisonStamp.originator = str[start:end] 00258 start = end 00259 end += 4 00260 (length,) = _struct_I.unpack(str[start:end]) 00261 start = end 00262 end += length 00263 self.poisonStamp.description = str[start:end] 00264 start = end 00265 end += 4 00266 (self.poisonStamp.qos,) = _struct_f.unpack(str[start:end]) 00267 start = end 00268 end += 4 00269 (length,) = _struct_I.unpack(str[start:end]) 00270 self.dampings = [] 00271 for i in range(0, length): 00272 val1 = brics_actuator.msg.JointValue() 00273 _v7 = val1.timeStamp 00274 _x = _v7 00275 start = end 00276 end += 8 00277 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00278 start = end 00279 end += 4 00280 (length,) = _struct_I.unpack(str[start:end]) 00281 start = end 00282 end += length 00283 val1.joint_uri = str[start:end] 00284 start = end 00285 end += 4 00286 (length,) = _struct_I.unpack(str[start:end]) 00287 start = end 00288 end += length 00289 val1.unit = str[start:end] 00290 start = end 00291 end += 8 00292 (val1.value,) = _struct_d.unpack(str[start:end]) 00293 self.dampings.append(val1) 00294 start = end 00295 end += 4 00296 (length,) = _struct_I.unpack(str[start:end]) 00297 self.stiffnesses = [] 00298 for i in range(0, length): 00299 val1 = brics_actuator.msg.JointValue() 00300 _v8 = val1.timeStamp 00301 _x = _v8 00302 start = end 00303 end += 8 00304 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00305 start = end 00306 end += 4 00307 (length,) = _struct_I.unpack(str[start:end]) 00308 start = end 00309 end += length 00310 val1.joint_uri = str[start:end] 00311 start = end 00312 end += 4 00313 (length,) = _struct_I.unpack(str[start:end]) 00314 start = end 00315 end += length 00316 val1.unit = str[start:end] 00317 start = end 00318 end += 8 00319 (val1.value,) = _struct_d.unpack(str[start:end]) 00320 self.stiffnesses.append(val1) 00321 return self 00322 except struct.error as e: 00323 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00324 00325 _struct_I = roslib.message.struct_I 00326 _struct_d = struct.Struct("<d") 00327 _struct_2I = struct.Struct("<2I") 00328 _struct_f = struct.Struct("<f")