_TrackLinkCmd.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_mechanism_controllers/TrackLinkCmd.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 TrackLinkCmd(genpy.Message):
00010   _md5sum = "08ccfe603e4e21c792896712c3b72de2"
00011   _type = "pr2_mechanism_controllers/TrackLinkCmd"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """int8 enable
00014 string link_name
00015 geometry_msgs/Point point
00016 
00017 ================================================================================
00018 MSG: geometry_msgs/Point
00019 # This contains the position of a point in free space
00020 float64 x
00021 float64 y
00022 float64 z
00023 
00024 """
00025   __slots__ = ['enable','link_name','point']
00026   _slot_types = ['int8','string','geometry_msgs/Point']
00027 
00028   def __init__(self, *args, **kwds):
00029     """
00030     Constructor. Any message fields that are implicitly/explicitly
00031     set to None will be assigned a default value. The recommend
00032     use is keyword arguments as this is more robust to future message
00033     changes.  You cannot mix in-order arguments and keyword arguments.
00034 
00035     The available fields are:
00036        enable,link_name,point
00037 
00038     :param args: complete set of field values, in .msg order
00039     :param kwds: use keyword arguments corresponding to message field names
00040     to set specific fields.
00041     """
00042     if args or kwds:
00043       super(TrackLinkCmd, self).__init__(*args, **kwds)
00044       #message fields cannot be None, assign default values for those that are
00045       if self.enable is None:
00046         self.enable = 0
00047       if self.link_name is None:
00048         self.link_name = ''
00049       if self.point is None:
00050         self.point = geometry_msgs.msg.Point()
00051     else:
00052       self.enable = 0
00053       self.link_name = ''
00054       self.point = geometry_msgs.msg.Point()
00055 
00056   def _get_types(self):
00057     """
00058     internal API method
00059     """
00060     return self._slot_types
00061 
00062   def serialize(self, buff):
00063     """
00064     serialize message into buffer
00065     :param buff: buffer, ``StringIO``
00066     """
00067     try:
00068       buff.write(_struct_b.pack(self.enable))
00069       _x = self.link_name
00070       length = len(_x)
00071       if python3 or type(_x) == unicode:
00072         _x = _x.encode('utf-8')
00073         length = len(_x)
00074       buff.write(struct.pack('<I%ss'%length, length, _x))
00075       _x = self
00076       buff.write(_struct_3d.pack(_x.point.x, _x.point.y, _x.point.z))
00077     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00078     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00079 
00080   def deserialize(self, str):
00081     """
00082     unpack serialized message in str into this message instance
00083     :param str: byte array of serialized message, ``str``
00084     """
00085     try:
00086       if self.point is None:
00087         self.point = geometry_msgs.msg.Point()
00088       end = 0
00089       start = end
00090       end += 1
00091       (self.enable,) = _struct_b.unpack(str[start:end])
00092       start = end
00093       end += 4
00094       (length,) = _struct_I.unpack(str[start:end])
00095       start = end
00096       end += length
00097       if python3:
00098         self.link_name = str[start:end].decode('utf-8')
00099       else:
00100         self.link_name = str[start:end]
00101       _x = self
00102       start = end
00103       end += 24
00104       (_x.point.x, _x.point.y, _x.point.z,) = _struct_3d.unpack(str[start:end])
00105       return self
00106     except struct.error as e:
00107       raise genpy.DeserializationError(e) #most likely buffer underfill
00108 
00109 
00110   def serialize_numpy(self, buff, numpy):
00111     """
00112     serialize message with numpy array types into buffer
00113     :param buff: buffer, ``StringIO``
00114     :param numpy: numpy python module
00115     """
00116     try:
00117       buff.write(_struct_b.pack(self.enable))
00118       _x = self.link_name
00119       length = len(_x)
00120       if python3 or type(_x) == unicode:
00121         _x = _x.encode('utf-8')
00122         length = len(_x)
00123       buff.write(struct.pack('<I%ss'%length, length, _x))
00124       _x = self
00125       buff.write(_struct_3d.pack(_x.point.x, _x.point.y, _x.point.z))
00126     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00127     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00128 
00129   def deserialize_numpy(self, str, numpy):
00130     """
00131     unpack serialized message in str into this message instance using numpy for array types
00132     :param str: byte array of serialized message, ``str``
00133     :param numpy: numpy python module
00134     """
00135     try:
00136       if self.point is None:
00137         self.point = geometry_msgs.msg.Point()
00138       end = 0
00139       start = end
00140       end += 1
00141       (self.enable,) = _struct_b.unpack(str[start:end])
00142       start = end
00143       end += 4
00144       (length,) = _struct_I.unpack(str[start:end])
00145       start = end
00146       end += length
00147       if python3:
00148         self.link_name = str[start:end].decode('utf-8')
00149       else:
00150         self.link_name = str[start:end]
00151       _x = self
00152       start = end
00153       end += 24
00154       (_x.point.x, _x.point.y, _x.point.z,) = _struct_3d.unpack(str[start:end])
00155       return self
00156     except struct.error as e:
00157       raise genpy.DeserializationError(e) #most likely buffer underfill
00158 
00159 _struct_I = genpy.struct_I
00160 _struct_b = struct.Struct("<b")
00161 _struct_3d = struct.Struct("<3d")


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