_BaseControllerState2.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_mechanism_controllers/BaseControllerState2.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import geometry_msgs.msg
00008 
00009 class BaseControllerState2(genpy.Message):
00010   _md5sum = "d4b64baf09d8cb133f3f2bc279de1137"
00011   _type = "pr2_mechanism_controllers/BaseControllerState2"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """geometry_msgs/Twist command
00014 float64[] joint_command
00015 float64[] joint_error
00016 float64[] joint_velocity_commanded
00017 float64[] joint_velocity_measured
00018 float64[] joint_effort_measured
00019 float64[] joint_effort_commanded
00020 float64[] joint_effort_error
00021 string[] joint_names
00022 
00023 
00024 ================================================================================
00025 MSG: geometry_msgs/Twist
00026 # This expresses velocity in free space broken into its linear and angular parts.
00027 Vector3  linear
00028 Vector3  angular
00029 
00030 ================================================================================
00031 MSG: geometry_msgs/Vector3
00032 # This represents a vector in free space. 
00033 
00034 float64 x
00035 float64 y
00036 float64 z
00037 """
00038   __slots__ = ['command','joint_command','joint_error','joint_velocity_commanded','joint_velocity_measured','joint_effort_measured','joint_effort_commanded','joint_effort_error','joint_names']
00039   _slot_types = ['geometry_msgs/Twist','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','string[]']
00040 
00041   def __init__(self, *args, **kwds):
00042     """
00043     Constructor. Any message fields that are implicitly/explicitly
00044     set to None will be assigned a default value. The recommend
00045     use is keyword arguments as this is more robust to future message
00046     changes.  You cannot mix in-order arguments and keyword arguments.
00047 
00048     The available fields are:
00049        command,joint_command,joint_error,joint_velocity_commanded,joint_velocity_measured,joint_effort_measured,joint_effort_commanded,joint_effort_error,joint_names
00050 
00051     :param args: complete set of field values, in .msg order
00052     :param kwds: use keyword arguments corresponding to message field names
00053     to set specific fields.
00054     """
00055     if args or kwds:
00056       super(BaseControllerState2, self).__init__(*args, **kwds)
00057       #message fields cannot be None, assign default values for those that are
00058       if self.command is None:
00059         self.command = geometry_msgs.msg.Twist()
00060       if self.joint_command is None:
00061         self.joint_command = []
00062       if self.joint_error is None:
00063         self.joint_error = []
00064       if self.joint_velocity_commanded is None:
00065         self.joint_velocity_commanded = []
00066       if self.joint_velocity_measured is None:
00067         self.joint_velocity_measured = []
00068       if self.joint_effort_measured is None:
00069         self.joint_effort_measured = []
00070       if self.joint_effort_commanded is None:
00071         self.joint_effort_commanded = []
00072       if self.joint_effort_error is None:
00073         self.joint_effort_error = []
00074       if self.joint_names is None:
00075         self.joint_names = []
00076     else:
00077       self.command = geometry_msgs.msg.Twist()
00078       self.joint_command = []
00079       self.joint_error = []
00080       self.joint_velocity_commanded = []
00081       self.joint_velocity_measured = []
00082       self.joint_effort_measured = []
00083       self.joint_effort_commanded = []
00084       self.joint_effort_error = []
00085       self.joint_names = []
00086 
00087   def _get_types(self):
00088     """
00089     internal API method
00090     """
00091     return self._slot_types
00092 
00093   def serialize(self, buff):
00094     """
00095     serialize message into buffer
00096     :param buff: buffer, ``StringIO``
00097     """
00098     try:
00099       _x = self
00100       buff.write(_struct_6d.pack(_x.command.linear.x, _x.command.linear.y, _x.command.linear.z, _x.command.angular.x, _x.command.angular.y, _x.command.angular.z))
00101       length = len(self.joint_command)
00102       buff.write(_struct_I.pack(length))
00103       pattern = '<%sd'%length
00104       buff.write(struct.pack(pattern, *self.joint_command))
00105       length = len(self.joint_error)
00106       buff.write(_struct_I.pack(length))
00107       pattern = '<%sd'%length
00108       buff.write(struct.pack(pattern, *self.joint_error))
00109       length = len(self.joint_velocity_commanded)
00110       buff.write(_struct_I.pack(length))
00111       pattern = '<%sd'%length
00112       buff.write(struct.pack(pattern, *self.joint_velocity_commanded))
00113       length = len(self.joint_velocity_measured)
00114       buff.write(_struct_I.pack(length))
00115       pattern = '<%sd'%length
00116       buff.write(struct.pack(pattern, *self.joint_velocity_measured))
00117       length = len(self.joint_effort_measured)
00118       buff.write(_struct_I.pack(length))
00119       pattern = '<%sd'%length
00120       buff.write(struct.pack(pattern, *self.joint_effort_measured))
00121       length = len(self.joint_effort_commanded)
00122       buff.write(_struct_I.pack(length))
00123       pattern = '<%sd'%length
00124       buff.write(struct.pack(pattern, *self.joint_effort_commanded))
00125       length = len(self.joint_effort_error)
00126       buff.write(_struct_I.pack(length))
00127       pattern = '<%sd'%length
00128       buff.write(struct.pack(pattern, *self.joint_effort_error))
00129       length = len(self.joint_names)
00130       buff.write(_struct_I.pack(length))
00131       for val1 in self.joint_names:
00132         length = len(val1)
00133         if python3 or type(val1) == unicode:
00134           val1 = val1.encode('utf-8')
00135           length = len(val1)
00136         buff.write(struct.pack('<I%ss'%length, length, val1))
00137     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00138     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00139 
00140   def deserialize(self, str):
00141     """
00142     unpack serialized message in str into this message instance
00143     :param str: byte array of serialized message, ``str``
00144     """
00145     try:
00146       if self.command is None:
00147         self.command = geometry_msgs.msg.Twist()
00148       end = 0
00149       _x = self
00150       start = end
00151       end += 48
00152       (_x.command.linear.x, _x.command.linear.y, _x.command.linear.z, _x.command.angular.x, _x.command.angular.y, _x.command.angular.z,) = _struct_6d.unpack(str[start:end])
00153       start = end
00154       end += 4
00155       (length,) = _struct_I.unpack(str[start:end])
00156       pattern = '<%sd'%length
00157       start = end
00158       end += struct.calcsize(pattern)
00159       self.joint_command = struct.unpack(pattern, str[start:end])
00160       start = end
00161       end += 4
00162       (length,) = _struct_I.unpack(str[start:end])
00163       pattern = '<%sd'%length
00164       start = end
00165       end += struct.calcsize(pattern)
00166       self.joint_error = struct.unpack(pattern, str[start:end])
00167       start = end
00168       end += 4
00169       (length,) = _struct_I.unpack(str[start:end])
00170       pattern = '<%sd'%length
00171       start = end
00172       end += struct.calcsize(pattern)
00173       self.joint_velocity_commanded = struct.unpack(pattern, str[start:end])
00174       start = end
00175       end += 4
00176       (length,) = _struct_I.unpack(str[start:end])
00177       pattern = '<%sd'%length
00178       start = end
00179       end += struct.calcsize(pattern)
00180       self.joint_velocity_measured = struct.unpack(pattern, str[start:end])
00181       start = end
00182       end += 4
00183       (length,) = _struct_I.unpack(str[start:end])
00184       pattern = '<%sd'%length
00185       start = end
00186       end += struct.calcsize(pattern)
00187       self.joint_effort_measured = struct.unpack(pattern, str[start:end])
00188       start = end
00189       end += 4
00190       (length,) = _struct_I.unpack(str[start:end])
00191       pattern = '<%sd'%length
00192       start = end
00193       end += struct.calcsize(pattern)
00194       self.joint_effort_commanded = struct.unpack(pattern, str[start:end])
00195       start = end
00196       end += 4
00197       (length,) = _struct_I.unpack(str[start:end])
00198       pattern = '<%sd'%length
00199       start = end
00200       end += struct.calcsize(pattern)
00201       self.joint_effort_error = struct.unpack(pattern, str[start:end])
00202       start = end
00203       end += 4
00204       (length,) = _struct_I.unpack(str[start:end])
00205       self.joint_names = []
00206       for i in range(0, length):
00207         start = end
00208         end += 4
00209         (length,) = _struct_I.unpack(str[start:end])
00210         start = end
00211         end += length
00212         if python3:
00213           val1 = str[start:end].decode('utf-8')
00214         else:
00215           val1 = str[start:end]
00216         self.joint_names.append(val1)
00217       return self
00218     except struct.error as e:
00219       raise genpy.DeserializationError(e) #most likely buffer underfill
00220 
00221 
00222   def serialize_numpy(self, buff, numpy):
00223     """
00224     serialize message with numpy array types into buffer
00225     :param buff: buffer, ``StringIO``
00226     :param numpy: numpy python module
00227     """
00228     try:
00229       _x = self
00230       buff.write(_struct_6d.pack(_x.command.linear.x, _x.command.linear.y, _x.command.linear.z, _x.command.angular.x, _x.command.angular.y, _x.command.angular.z))
00231       length = len(self.joint_command)
00232       buff.write(_struct_I.pack(length))
00233       pattern = '<%sd'%length
00234       buff.write(self.joint_command.tostring())
00235       length = len(self.joint_error)
00236       buff.write(_struct_I.pack(length))
00237       pattern = '<%sd'%length
00238       buff.write(self.joint_error.tostring())
00239       length = len(self.joint_velocity_commanded)
00240       buff.write(_struct_I.pack(length))
00241       pattern = '<%sd'%length
00242       buff.write(self.joint_velocity_commanded.tostring())
00243       length = len(self.joint_velocity_measured)
00244       buff.write(_struct_I.pack(length))
00245       pattern = '<%sd'%length
00246       buff.write(self.joint_velocity_measured.tostring())
00247       length = len(self.joint_effort_measured)
00248       buff.write(_struct_I.pack(length))
00249       pattern = '<%sd'%length
00250       buff.write(self.joint_effort_measured.tostring())
00251       length = len(self.joint_effort_commanded)
00252       buff.write(_struct_I.pack(length))
00253       pattern = '<%sd'%length
00254       buff.write(self.joint_effort_commanded.tostring())
00255       length = len(self.joint_effort_error)
00256       buff.write(_struct_I.pack(length))
00257       pattern = '<%sd'%length
00258       buff.write(self.joint_effort_error.tostring())
00259       length = len(self.joint_names)
00260       buff.write(_struct_I.pack(length))
00261       for val1 in self.joint_names:
00262         length = len(val1)
00263         if python3 or type(val1) == unicode:
00264           val1 = val1.encode('utf-8')
00265           length = len(val1)
00266         buff.write(struct.pack('<I%ss'%length, length, val1))
00267     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00268     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00269 
00270   def deserialize_numpy(self, str, numpy):
00271     """
00272     unpack serialized message in str into this message instance using numpy for array types
00273     :param str: byte array of serialized message, ``str``
00274     :param numpy: numpy python module
00275     """
00276     try:
00277       if self.command is None:
00278         self.command = geometry_msgs.msg.Twist()
00279       end = 0
00280       _x = self
00281       start = end
00282       end += 48
00283       (_x.command.linear.x, _x.command.linear.y, _x.command.linear.z, _x.command.angular.x, _x.command.angular.y, _x.command.angular.z,) = _struct_6d.unpack(str[start:end])
00284       start = end
00285       end += 4
00286       (length,) = _struct_I.unpack(str[start:end])
00287       pattern = '<%sd'%length
00288       start = end
00289       end += struct.calcsize(pattern)
00290       self.joint_command = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00291       start = end
00292       end += 4
00293       (length,) = _struct_I.unpack(str[start:end])
00294       pattern = '<%sd'%length
00295       start = end
00296       end += struct.calcsize(pattern)
00297       self.joint_error = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00298       start = end
00299       end += 4
00300       (length,) = _struct_I.unpack(str[start:end])
00301       pattern = '<%sd'%length
00302       start = end
00303       end += struct.calcsize(pattern)
00304       self.joint_velocity_commanded = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00305       start = end
00306       end += 4
00307       (length,) = _struct_I.unpack(str[start:end])
00308       pattern = '<%sd'%length
00309       start = end
00310       end += struct.calcsize(pattern)
00311       self.joint_velocity_measured = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00312       start = end
00313       end += 4
00314       (length,) = _struct_I.unpack(str[start:end])
00315       pattern = '<%sd'%length
00316       start = end
00317       end += struct.calcsize(pattern)
00318       self.joint_effort_measured = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00319       start = end
00320       end += 4
00321       (length,) = _struct_I.unpack(str[start:end])
00322       pattern = '<%sd'%length
00323       start = end
00324       end += struct.calcsize(pattern)
00325       self.joint_effort_commanded = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00326       start = end
00327       end += 4
00328       (length,) = _struct_I.unpack(str[start:end])
00329       pattern = '<%sd'%length
00330       start = end
00331       end += struct.calcsize(pattern)
00332       self.joint_effort_error = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00333       start = end
00334       end += 4
00335       (length,) = _struct_I.unpack(str[start:end])
00336       self.joint_names = []
00337       for i in range(0, length):
00338         start = end
00339         end += 4
00340         (length,) = _struct_I.unpack(str[start:end])
00341         start = end
00342         end += length
00343         if python3:
00344           val1 = str[start:end].decode('utf-8')
00345         else:
00346           val1 = str[start:end]
00347         self.joint_names.append(val1)
00348       return self
00349     except struct.error as e:
00350       raise genpy.DeserializationError(e) #most likely buffer underfill
00351 
00352 _struct_I = genpy.struct_I
00353 _struct_6d = struct.Struct("<6d")


pr2_mechanism_controllers
Author(s): Sachin Chita, John Hsu, Melonee Wise
autogenerated on Thu Apr 24 2014 15:44:51