$search
00001 """autogenerated by genmsg_py from ConfigGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 00007 class ConfigGoal(roslib.message.Message): 00008 _md5sum = "863b25359077f9aa231257b3d1612b63" 00009 _type = "joint_states_settler/ConfigGoal" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """string[] joint_names # Names of the joints we're waiting to settle 00012 float64[] tolerances # Tolerance on each of the specified joints 00013 duration max_step # The maximum timestep between two elements in an interval 00014 uint32 cache_size # The size of our cache when searching for an interval 00015 00016 """ 00017 __slots__ = ['joint_names','tolerances','max_step','cache_size'] 00018 _slot_types = ['string[]','float64[]','duration','uint32'] 00019 00020 def __init__(self, *args, **kwds): 00021 """ 00022 Constructor. Any message fields that are implicitly/explicitly 00023 set to None will be assigned a default value. The recommend 00024 use is keyword arguments as this is more robust to future message 00025 changes. You cannot mix in-order arguments and keyword arguments. 00026 00027 The available fields are: 00028 joint_names,tolerances,max_step,cache_size 00029 00030 @param args: complete set of field values, in .msg order 00031 @param kwds: use keyword arguments corresponding to message field names 00032 to set specific fields. 00033 """ 00034 if args or kwds: 00035 super(ConfigGoal, self).__init__(*args, **kwds) 00036 #message fields cannot be None, assign default values for those that are 00037 if self.joint_names is None: 00038 self.joint_names = [] 00039 if self.tolerances is None: 00040 self.tolerances = [] 00041 if self.max_step is None: 00042 self.max_step = roslib.rostime.Duration() 00043 if self.cache_size is None: 00044 self.cache_size = 0 00045 else: 00046 self.joint_names = [] 00047 self.tolerances = [] 00048 self.max_step = roslib.rostime.Duration() 00049 self.cache_size = 0 00050 00051 def _get_types(self): 00052 """ 00053 internal API method 00054 """ 00055 return self._slot_types 00056 00057 def serialize(self, buff): 00058 """ 00059 serialize message into buffer 00060 @param buff: buffer 00061 @type buff: StringIO 00062 """ 00063 try: 00064 length = len(self.joint_names) 00065 buff.write(_struct_I.pack(length)) 00066 for val1 in self.joint_names: 00067 length = len(val1) 00068 buff.write(struct.pack('<I%ss'%length, length, val1)) 00069 length = len(self.tolerances) 00070 buff.write(_struct_I.pack(length)) 00071 pattern = '<%sd'%length 00072 buff.write(struct.pack(pattern, *self.tolerances)) 00073 _x = self 00074 buff.write(_struct_2iI.pack(_x.max_step.secs, _x.max_step.nsecs, _x.cache_size)) 00075 except struct.error as se: self._check_types(se) 00076 except TypeError as te: self._check_types(te) 00077 00078 def deserialize(self, str): 00079 """ 00080 unpack serialized message in str into this message instance 00081 @param str: byte array of serialized message 00082 @type str: str 00083 """ 00084 try: 00085 if self.max_step is None: 00086 self.max_step = roslib.rostime.Duration() 00087 end = 0 00088 start = end 00089 end += 4 00090 (length,) = _struct_I.unpack(str[start:end]) 00091 self.joint_names = [] 00092 for i in range(0, length): 00093 start = end 00094 end += 4 00095 (length,) = _struct_I.unpack(str[start:end]) 00096 start = end 00097 end += length 00098 val1 = str[start:end] 00099 self.joint_names.append(val1) 00100 start = end 00101 end += 4 00102 (length,) = _struct_I.unpack(str[start:end]) 00103 pattern = '<%sd'%length 00104 start = end 00105 end += struct.calcsize(pattern) 00106 self.tolerances = struct.unpack(pattern, str[start:end]) 00107 _x = self 00108 start = end 00109 end += 12 00110 (_x.max_step.secs, _x.max_step.nsecs, _x.cache_size,) = _struct_2iI.unpack(str[start:end]) 00111 self.max_step.canon() 00112 return self 00113 except struct.error as e: 00114 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00115 00116 00117 def serialize_numpy(self, buff, numpy): 00118 """ 00119 serialize message with numpy array types into buffer 00120 @param buff: buffer 00121 @type buff: StringIO 00122 @param numpy: numpy python module 00123 @type numpy module 00124 """ 00125 try: 00126 length = len(self.joint_names) 00127 buff.write(_struct_I.pack(length)) 00128 for val1 in self.joint_names: 00129 length = len(val1) 00130 buff.write(struct.pack('<I%ss'%length, length, val1)) 00131 length = len(self.tolerances) 00132 buff.write(_struct_I.pack(length)) 00133 pattern = '<%sd'%length 00134 buff.write(self.tolerances.tostring()) 00135 _x = self 00136 buff.write(_struct_2iI.pack(_x.max_step.secs, _x.max_step.nsecs, _x.cache_size)) 00137 except struct.error as se: self._check_types(se) 00138 except TypeError as te: self._check_types(te) 00139 00140 def deserialize_numpy(self, str, numpy): 00141 """ 00142 unpack serialized message in str into this message instance using numpy for array types 00143 @param str: byte array of serialized message 00144 @type str: str 00145 @param numpy: numpy python module 00146 @type numpy: module 00147 """ 00148 try: 00149 if self.max_step is None: 00150 self.max_step = roslib.rostime.Duration() 00151 end = 0 00152 start = end 00153 end += 4 00154 (length,) = _struct_I.unpack(str[start:end]) 00155 self.joint_names = [] 00156 for i in range(0, length): 00157 start = end 00158 end += 4 00159 (length,) = _struct_I.unpack(str[start:end]) 00160 start = end 00161 end += length 00162 val1 = str[start:end] 00163 self.joint_names.append(val1) 00164 start = end 00165 end += 4 00166 (length,) = _struct_I.unpack(str[start:end]) 00167 pattern = '<%sd'%length 00168 start = end 00169 end += struct.calcsize(pattern) 00170 self.tolerances = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00171 _x = self 00172 start = end 00173 end += 12 00174 (_x.max_step.secs, _x.max_step.nsecs, _x.cache_size,) = _struct_2iI.unpack(str[start:end]) 00175 self.max_step.canon() 00176 return self 00177 except struct.error as e: 00178 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00179 00180 _struct_I = roslib.message.struct_I 00181 _struct_2iI = struct.Struct("<2iI")