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