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