$search
00001 """autogenerated by genmsg_py from ReactiveGraspingGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 import std_msgs.msg 00007 00008 class ReactiveGraspingGoal(roslib.message.Message): 00009 _md5sum = "1419d135c9200a39cd135cf13dad5784" 00010 _type = "srs_assisted_grasping_msgs/ReactiveGraspingGoal" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00013 # GOAL 00014 std_msgs/Float32MultiArray target_configuration # n joints, 7 for SDH (names should be specified in yaml file) 00015 std_msgs/Float32MultiArray max_force # m tactile pads 00016 duration time # time to reach target_configuration 00017 00018 ================================================================================ 00019 MSG: std_msgs/Float32MultiArray 00020 # Please look at the MultiArrayLayout message definition for 00021 # documentation on all multiarrays. 00022 00023 MultiArrayLayout layout # specification of data layout 00024 float32[] data # array of data 00025 00026 00027 ================================================================================ 00028 MSG: std_msgs/MultiArrayLayout 00029 # The multiarray declares a generic multi-dimensional array of a 00030 # particular data type. Dimensions are ordered from outer most 00031 # to inner most. 00032 00033 MultiArrayDimension[] dim # Array of dimension properties 00034 uint32 data_offset # padding bytes at front of data 00035 00036 # Accessors should ALWAYS be written in terms of dimension stride 00037 # and specified outer-most dimension first. 00038 # 00039 # multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k] 00040 # 00041 # A standard, 3-channel 640x480 image with interleaved color channels 00042 # would be specified as: 00043 # 00044 # dim[0].label = "height" 00045 # dim[0].size = 480 00046 # dim[0].stride = 3*640*480 = 921600 (note dim[0] stride is just size of image) 00047 # dim[1].label = "width" 00048 # dim[1].size = 640 00049 # dim[1].stride = 3*640 = 1920 00050 # dim[2].label = "channel" 00051 # dim[2].size = 3 00052 # dim[2].stride = 3 00053 # 00054 # multiarray(i,j,k) refers to the ith row, jth column, and kth channel. 00055 ================================================================================ 00056 MSG: std_msgs/MultiArrayDimension 00057 string label # label of given dimension 00058 uint32 size # size of given dimension (in type units) 00059 uint32 stride # stride of given dimension 00060 """ 00061 __slots__ = ['target_configuration','max_force','time'] 00062 _slot_types = ['std_msgs/Float32MultiArray','std_msgs/Float32MultiArray','duration'] 00063 00064 def __init__(self, *args, **kwds): 00065 """ 00066 Constructor. Any message fields that are implicitly/explicitly 00067 set to None will be assigned a default value. The recommend 00068 use is keyword arguments as this is more robust to future message 00069 changes. You cannot mix in-order arguments and keyword arguments. 00070 00071 The available fields are: 00072 target_configuration,max_force,time 00073 00074 @param args: complete set of field values, in .msg order 00075 @param kwds: use keyword arguments corresponding to message field names 00076 to set specific fields. 00077 """ 00078 if args or kwds: 00079 super(ReactiveGraspingGoal, self).__init__(*args, **kwds) 00080 #message fields cannot be None, assign default values for those that are 00081 if self.target_configuration is None: 00082 self.target_configuration = std_msgs.msg.Float32MultiArray() 00083 if self.max_force is None: 00084 self.max_force = std_msgs.msg.Float32MultiArray() 00085 if self.time is None: 00086 self.time = roslib.rostime.Duration() 00087 else: 00088 self.target_configuration = std_msgs.msg.Float32MultiArray() 00089 self.max_force = std_msgs.msg.Float32MultiArray() 00090 self.time = roslib.rostime.Duration() 00091 00092 def _get_types(self): 00093 """ 00094 internal API method 00095 """ 00096 return self._slot_types 00097 00098 def serialize(self, buff): 00099 """ 00100 serialize message into buffer 00101 @param buff: buffer 00102 @type buff: StringIO 00103 """ 00104 try: 00105 length = len(self.target_configuration.layout.dim) 00106 buff.write(_struct_I.pack(length)) 00107 for val1 in self.target_configuration.layout.dim: 00108 _x = val1.label 00109 length = len(_x) 00110 buff.write(struct.pack('<I%ss'%length, length, _x)) 00111 _x = val1 00112 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00113 buff.write(_struct_I.pack(self.target_configuration.layout.data_offset)) 00114 length = len(self.target_configuration.data) 00115 buff.write(_struct_I.pack(length)) 00116 pattern = '<%sf'%length 00117 buff.write(struct.pack(pattern, *self.target_configuration.data)) 00118 length = len(self.max_force.layout.dim) 00119 buff.write(_struct_I.pack(length)) 00120 for val1 in self.max_force.layout.dim: 00121 _x = val1.label 00122 length = len(_x) 00123 buff.write(struct.pack('<I%ss'%length, length, _x)) 00124 _x = val1 00125 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00126 buff.write(_struct_I.pack(self.max_force.layout.data_offset)) 00127 length = len(self.max_force.data) 00128 buff.write(_struct_I.pack(length)) 00129 pattern = '<%sf'%length 00130 buff.write(struct.pack(pattern, *self.max_force.data)) 00131 _x = self 00132 buff.write(_struct_2i.pack(_x.time.secs, _x.time.nsecs)) 00133 except struct.error as se: self._check_types(se) 00134 except TypeError as te: self._check_types(te) 00135 00136 def deserialize(self, str): 00137 """ 00138 unpack serialized message in str into this message instance 00139 @param str: byte array of serialized message 00140 @type str: str 00141 """ 00142 try: 00143 if self.target_configuration is None: 00144 self.target_configuration = std_msgs.msg.Float32MultiArray() 00145 if self.max_force is None: 00146 self.max_force = std_msgs.msg.Float32MultiArray() 00147 if self.time is None: 00148 self.time = roslib.rostime.Duration() 00149 end = 0 00150 start = end 00151 end += 4 00152 (length,) = _struct_I.unpack(str[start:end]) 00153 self.target_configuration.layout.dim = [] 00154 for i in range(0, length): 00155 val1 = std_msgs.msg.MultiArrayDimension() 00156 start = end 00157 end += 4 00158 (length,) = _struct_I.unpack(str[start:end]) 00159 start = end 00160 end += length 00161 val1.label = str[start:end] 00162 _x = val1 00163 start = end 00164 end += 8 00165 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00166 self.target_configuration.layout.dim.append(val1) 00167 start = end 00168 end += 4 00169 (self.target_configuration.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00170 start = end 00171 end += 4 00172 (length,) = _struct_I.unpack(str[start:end]) 00173 pattern = '<%sf'%length 00174 start = end 00175 end += struct.calcsize(pattern) 00176 self.target_configuration.data = struct.unpack(pattern, str[start:end]) 00177 start = end 00178 end += 4 00179 (length,) = _struct_I.unpack(str[start:end]) 00180 self.max_force.layout.dim = [] 00181 for i in range(0, length): 00182 val1 = std_msgs.msg.MultiArrayDimension() 00183 start = end 00184 end += 4 00185 (length,) = _struct_I.unpack(str[start:end]) 00186 start = end 00187 end += length 00188 val1.label = str[start:end] 00189 _x = val1 00190 start = end 00191 end += 8 00192 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00193 self.max_force.layout.dim.append(val1) 00194 start = end 00195 end += 4 00196 (self.max_force.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00197 start = end 00198 end += 4 00199 (length,) = _struct_I.unpack(str[start:end]) 00200 pattern = '<%sf'%length 00201 start = end 00202 end += struct.calcsize(pattern) 00203 self.max_force.data = struct.unpack(pattern, str[start:end]) 00204 _x = self 00205 start = end 00206 end += 8 00207 (_x.time.secs, _x.time.nsecs,) = _struct_2i.unpack(str[start:end]) 00208 self.time.canon() 00209 return self 00210 except struct.error as e: 00211 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00212 00213 00214 def serialize_numpy(self, buff, numpy): 00215 """ 00216 serialize message with numpy array types into buffer 00217 @param buff: buffer 00218 @type buff: StringIO 00219 @param numpy: numpy python module 00220 @type numpy module 00221 """ 00222 try: 00223 length = len(self.target_configuration.layout.dim) 00224 buff.write(_struct_I.pack(length)) 00225 for val1 in self.target_configuration.layout.dim: 00226 _x = val1.label 00227 length = len(_x) 00228 buff.write(struct.pack('<I%ss'%length, length, _x)) 00229 _x = val1 00230 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00231 buff.write(_struct_I.pack(self.target_configuration.layout.data_offset)) 00232 length = len(self.target_configuration.data) 00233 buff.write(_struct_I.pack(length)) 00234 pattern = '<%sf'%length 00235 buff.write(self.target_configuration.data.tostring()) 00236 length = len(self.max_force.layout.dim) 00237 buff.write(_struct_I.pack(length)) 00238 for val1 in self.max_force.layout.dim: 00239 _x = val1.label 00240 length = len(_x) 00241 buff.write(struct.pack('<I%ss'%length, length, _x)) 00242 _x = val1 00243 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00244 buff.write(_struct_I.pack(self.max_force.layout.data_offset)) 00245 length = len(self.max_force.data) 00246 buff.write(_struct_I.pack(length)) 00247 pattern = '<%sf'%length 00248 buff.write(self.max_force.data.tostring()) 00249 _x = self 00250 buff.write(_struct_2i.pack(_x.time.secs, _x.time.nsecs)) 00251 except struct.error as se: self._check_types(se) 00252 except TypeError as te: self._check_types(te) 00253 00254 def deserialize_numpy(self, str, numpy): 00255 """ 00256 unpack serialized message in str into this message instance using numpy for array types 00257 @param str: byte array of serialized message 00258 @type str: str 00259 @param numpy: numpy python module 00260 @type numpy: module 00261 """ 00262 try: 00263 if self.target_configuration is None: 00264 self.target_configuration = std_msgs.msg.Float32MultiArray() 00265 if self.max_force is None: 00266 self.max_force = std_msgs.msg.Float32MultiArray() 00267 if self.time is None: 00268 self.time = roslib.rostime.Duration() 00269 end = 0 00270 start = end 00271 end += 4 00272 (length,) = _struct_I.unpack(str[start:end]) 00273 self.target_configuration.layout.dim = [] 00274 for i in range(0, length): 00275 val1 = std_msgs.msg.MultiArrayDimension() 00276 start = end 00277 end += 4 00278 (length,) = _struct_I.unpack(str[start:end]) 00279 start = end 00280 end += length 00281 val1.label = str[start:end] 00282 _x = val1 00283 start = end 00284 end += 8 00285 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00286 self.target_configuration.layout.dim.append(val1) 00287 start = end 00288 end += 4 00289 (self.target_configuration.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00290 start = end 00291 end += 4 00292 (length,) = _struct_I.unpack(str[start:end]) 00293 pattern = '<%sf'%length 00294 start = end 00295 end += struct.calcsize(pattern) 00296 self.target_configuration.data = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00297 start = end 00298 end += 4 00299 (length,) = _struct_I.unpack(str[start:end]) 00300 self.max_force.layout.dim = [] 00301 for i in range(0, length): 00302 val1 = std_msgs.msg.MultiArrayDimension() 00303 start = end 00304 end += 4 00305 (length,) = _struct_I.unpack(str[start:end]) 00306 start = end 00307 end += length 00308 val1.label = str[start:end] 00309 _x = val1 00310 start = end 00311 end += 8 00312 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00313 self.max_force.layout.dim.append(val1) 00314 start = end 00315 end += 4 00316 (self.max_force.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00317 start = end 00318 end += 4 00319 (length,) = _struct_I.unpack(str[start:end]) 00320 pattern = '<%sf'%length 00321 start = end 00322 end += struct.calcsize(pattern) 00323 self.max_force.data = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00324 _x = self 00325 start = end 00326 end += 8 00327 (_x.time.secs, _x.time.nsecs,) = _struct_2i.unpack(str[start:end]) 00328 self.time.canon() 00329 return self 00330 except struct.error as e: 00331 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00332 00333 _struct_I = roslib.message.struct_I 00334 _struct_2I = struct.Struct("<2I") 00335 _struct_2i = struct.Struct("<2i")