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