$search
00001 """autogenerated by genmsg_py from ReactiveGraspingActionResult.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import srs_assisted_grasping_msgs.msg 00006 import roslib.rostime 00007 import actionlib_msgs.msg 00008 import std_msgs.msg 00009 00010 class ReactiveGraspingActionResult(roslib.message.Message): 00011 _md5sum = "904345a1eac041c82dedd76b996213ed" 00012 _type = "srs_assisted_grasping_msgs/ReactiveGraspingActionResult" 00013 _has_header = True #flag to mark the presence of a Header object 00014 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00015 00016 Header header 00017 actionlib_msgs/GoalStatus status 00018 ReactiveGraspingResult result 00019 00020 ================================================================================ 00021 MSG: std_msgs/Header 00022 # Standard metadata for higher-level stamped data types. 00023 # This is generally used to communicate timestamped data 00024 # in a particular coordinate frame. 00025 # 00026 # sequence ID: consecutively increasing ID 00027 uint32 seq 00028 #Two-integer timestamp that is expressed as: 00029 # * stamp.secs: seconds (stamp_secs) since epoch 00030 # * stamp.nsecs: nanoseconds since stamp_secs 00031 # time-handling sugar is provided by the client library 00032 time stamp 00033 #Frame this data is associated with 00034 # 0: no frame 00035 # 1: global frame 00036 string frame_id 00037 00038 ================================================================================ 00039 MSG: actionlib_msgs/GoalStatus 00040 GoalID goal_id 00041 uint8 status 00042 uint8 PENDING = 0 # The goal has yet to be processed by the action server 00043 uint8 ACTIVE = 1 # The goal is currently being processed by the action server 00044 uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing 00045 # and has since completed its execution (Terminal State) 00046 uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State) 00047 uint8 ABORTED = 4 # The goal was aborted during execution by the action server due 00048 # to some failure (Terminal State) 00049 uint8 REJECTED = 5 # The goal was rejected by the action server without being processed, 00050 # because the goal was unattainable or invalid (Terminal State) 00051 uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing 00052 # and has not yet completed execution 00053 uint8 RECALLING = 7 # The goal received a cancel request before it started executing, 00054 # but the action server has not yet confirmed that the goal is canceled 00055 uint8 RECALLED = 8 # The goal received a cancel request before it started executing 00056 # and was successfully cancelled (Terminal State) 00057 uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be 00058 # sent over the wire by an action server 00059 00060 #Allow for the user to associate a string with GoalStatus for debugging 00061 string text 00062 00063 00064 ================================================================================ 00065 MSG: actionlib_msgs/GoalID 00066 # The stamp should store the time at which this goal was requested. 00067 # It is used by an action server when it tries to preempt all 00068 # goals that were requested before a certain time 00069 time stamp 00070 00071 # The id provides a way to associate feedback and 00072 # result message with specific goal requests. The id 00073 # specified must be unique. 00074 string id 00075 00076 00077 ================================================================================ 00078 MSG: srs_assisted_grasping_msgs/ReactiveGraspingResult 00079 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00080 # RESULT 00081 std_msgs/Float32MultiArray actual_joint_values # n 00082 std_msgs/Int16MultiArray actual_forces # m 00083 std_msgs/Float32MultiArray time_to_stop # n 00084 00085 ================================================================================ 00086 MSG: std_msgs/Float32MultiArray 00087 # Please look at the MultiArrayLayout message definition for 00088 # documentation on all multiarrays. 00089 00090 MultiArrayLayout layout # specification of data layout 00091 float32[] data # array of data 00092 00093 00094 ================================================================================ 00095 MSG: std_msgs/MultiArrayLayout 00096 # The multiarray declares a generic multi-dimensional array of a 00097 # particular data type. Dimensions are ordered from outer most 00098 # to inner most. 00099 00100 MultiArrayDimension[] dim # Array of dimension properties 00101 uint32 data_offset # padding bytes at front of data 00102 00103 # Accessors should ALWAYS be written in terms of dimension stride 00104 # and specified outer-most dimension first. 00105 # 00106 # multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k] 00107 # 00108 # A standard, 3-channel 640x480 image with interleaved color channels 00109 # would be specified as: 00110 # 00111 # dim[0].label = "height" 00112 # dim[0].size = 480 00113 # dim[0].stride = 3*640*480 = 921600 (note dim[0] stride is just size of image) 00114 # dim[1].label = "width" 00115 # dim[1].size = 640 00116 # dim[1].stride = 3*640 = 1920 00117 # dim[2].label = "channel" 00118 # dim[2].size = 3 00119 # dim[2].stride = 3 00120 # 00121 # multiarray(i,j,k) refers to the ith row, jth column, and kth channel. 00122 ================================================================================ 00123 MSG: std_msgs/MultiArrayDimension 00124 string label # label of given dimension 00125 uint32 size # size of given dimension (in type units) 00126 uint32 stride # stride of given dimension 00127 ================================================================================ 00128 MSG: std_msgs/Int16MultiArray 00129 # Please look at the MultiArrayLayout message definition for 00130 # documentation on all multiarrays. 00131 00132 MultiArrayLayout layout # specification of data layout 00133 int16[] data # array of data 00134 00135 00136 """ 00137 __slots__ = ['header','status','result'] 00138 _slot_types = ['Header','actionlib_msgs/GoalStatus','srs_assisted_grasping_msgs/ReactiveGraspingResult'] 00139 00140 def __init__(self, *args, **kwds): 00141 """ 00142 Constructor. Any message fields that are implicitly/explicitly 00143 set to None will be assigned a default value. The recommend 00144 use is keyword arguments as this is more robust to future message 00145 changes. You cannot mix in-order arguments and keyword arguments. 00146 00147 The available fields are: 00148 header,status,result 00149 00150 @param args: complete set of field values, in .msg order 00151 @param kwds: use keyword arguments corresponding to message field names 00152 to set specific fields. 00153 """ 00154 if args or kwds: 00155 super(ReactiveGraspingActionResult, self).__init__(*args, **kwds) 00156 #message fields cannot be None, assign default values for those that are 00157 if self.header is None: 00158 self.header = std_msgs.msg._Header.Header() 00159 if self.status is None: 00160 self.status = actionlib_msgs.msg.GoalStatus() 00161 if self.result is None: 00162 self.result = srs_assisted_grasping_msgs.msg.ReactiveGraspingResult() 00163 else: 00164 self.header = std_msgs.msg._Header.Header() 00165 self.status = actionlib_msgs.msg.GoalStatus() 00166 self.result = srs_assisted_grasping_msgs.msg.ReactiveGraspingResult() 00167 00168 def _get_types(self): 00169 """ 00170 internal API method 00171 """ 00172 return self._slot_types 00173 00174 def serialize(self, buff): 00175 """ 00176 serialize message into buffer 00177 @param buff: buffer 00178 @type buff: StringIO 00179 """ 00180 try: 00181 _x = self 00182 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00183 _x = self.header.frame_id 00184 length = len(_x) 00185 buff.write(struct.pack('<I%ss'%length, length, _x)) 00186 _x = self 00187 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs)) 00188 _x = self.status.goal_id.id 00189 length = len(_x) 00190 buff.write(struct.pack('<I%ss'%length, length, _x)) 00191 buff.write(_struct_B.pack(self.status.status)) 00192 _x = self.status.text 00193 length = len(_x) 00194 buff.write(struct.pack('<I%ss'%length, length, _x)) 00195 length = len(self.result.actual_joint_values.layout.dim) 00196 buff.write(_struct_I.pack(length)) 00197 for val1 in self.result.actual_joint_values.layout.dim: 00198 _x = val1.label 00199 length = len(_x) 00200 buff.write(struct.pack('<I%ss'%length, length, _x)) 00201 _x = val1 00202 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00203 buff.write(_struct_I.pack(self.result.actual_joint_values.layout.data_offset)) 00204 length = len(self.result.actual_joint_values.data) 00205 buff.write(_struct_I.pack(length)) 00206 pattern = '<%sf'%length 00207 buff.write(struct.pack(pattern, *self.result.actual_joint_values.data)) 00208 length = len(self.result.actual_forces.layout.dim) 00209 buff.write(_struct_I.pack(length)) 00210 for val1 in self.result.actual_forces.layout.dim: 00211 _x = val1.label 00212 length = len(_x) 00213 buff.write(struct.pack('<I%ss'%length, length, _x)) 00214 _x = val1 00215 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00216 buff.write(_struct_I.pack(self.result.actual_forces.layout.data_offset)) 00217 length = len(self.result.actual_forces.data) 00218 buff.write(_struct_I.pack(length)) 00219 pattern = '<%sh'%length 00220 buff.write(struct.pack(pattern, *self.result.actual_forces.data)) 00221 length = len(self.result.time_to_stop.layout.dim) 00222 buff.write(_struct_I.pack(length)) 00223 for val1 in self.result.time_to_stop.layout.dim: 00224 _x = val1.label 00225 length = len(_x) 00226 buff.write(struct.pack('<I%ss'%length, length, _x)) 00227 _x = val1 00228 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00229 buff.write(_struct_I.pack(self.result.time_to_stop.layout.data_offset)) 00230 length = len(self.result.time_to_stop.data) 00231 buff.write(_struct_I.pack(length)) 00232 pattern = '<%sf'%length 00233 buff.write(struct.pack(pattern, *self.result.time_to_stop.data)) 00234 except struct.error as se: self._check_types(se) 00235 except TypeError as te: self._check_types(te) 00236 00237 def deserialize(self, str): 00238 """ 00239 unpack serialized message in str into this message instance 00240 @param str: byte array of serialized message 00241 @type str: str 00242 """ 00243 try: 00244 if self.header is None: 00245 self.header = std_msgs.msg._Header.Header() 00246 if self.status is None: 00247 self.status = actionlib_msgs.msg.GoalStatus() 00248 if self.result is None: 00249 self.result = srs_assisted_grasping_msgs.msg.ReactiveGraspingResult() 00250 end = 0 00251 _x = self 00252 start = end 00253 end += 12 00254 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00255 start = end 00256 end += 4 00257 (length,) = _struct_I.unpack(str[start:end]) 00258 start = end 00259 end += length 00260 self.header.frame_id = str[start:end] 00261 _x = self 00262 start = end 00263 end += 8 00264 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00265 start = end 00266 end += 4 00267 (length,) = _struct_I.unpack(str[start:end]) 00268 start = end 00269 end += length 00270 self.status.goal_id.id = str[start:end] 00271 start = end 00272 end += 1 00273 (self.status.status,) = _struct_B.unpack(str[start:end]) 00274 start = end 00275 end += 4 00276 (length,) = _struct_I.unpack(str[start:end]) 00277 start = end 00278 end += length 00279 self.status.text = str[start:end] 00280 start = end 00281 end += 4 00282 (length,) = _struct_I.unpack(str[start:end]) 00283 self.result.actual_joint_values.layout.dim = [] 00284 for i in range(0, length): 00285 val1 = std_msgs.msg.MultiArrayDimension() 00286 start = end 00287 end += 4 00288 (length,) = _struct_I.unpack(str[start:end]) 00289 start = end 00290 end += length 00291 val1.label = str[start:end] 00292 _x = val1 00293 start = end 00294 end += 8 00295 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00296 self.result.actual_joint_values.layout.dim.append(val1) 00297 start = end 00298 end += 4 00299 (self.result.actual_joint_values.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00300 start = end 00301 end += 4 00302 (length,) = _struct_I.unpack(str[start:end]) 00303 pattern = '<%sf'%length 00304 start = end 00305 end += struct.calcsize(pattern) 00306 self.result.actual_joint_values.data = struct.unpack(pattern, str[start:end]) 00307 start = end 00308 end += 4 00309 (length,) = _struct_I.unpack(str[start:end]) 00310 self.result.actual_forces.layout.dim = [] 00311 for i in range(0, length): 00312 val1 = std_msgs.msg.MultiArrayDimension() 00313 start = end 00314 end += 4 00315 (length,) = _struct_I.unpack(str[start:end]) 00316 start = end 00317 end += length 00318 val1.label = str[start:end] 00319 _x = val1 00320 start = end 00321 end += 8 00322 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00323 self.result.actual_forces.layout.dim.append(val1) 00324 start = end 00325 end += 4 00326 (self.result.actual_forces.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00327 start = end 00328 end += 4 00329 (length,) = _struct_I.unpack(str[start:end]) 00330 pattern = '<%sh'%length 00331 start = end 00332 end += struct.calcsize(pattern) 00333 self.result.actual_forces.data = struct.unpack(pattern, str[start:end]) 00334 start = end 00335 end += 4 00336 (length,) = _struct_I.unpack(str[start:end]) 00337 self.result.time_to_stop.layout.dim = [] 00338 for i in range(0, length): 00339 val1 = std_msgs.msg.MultiArrayDimension() 00340 start = end 00341 end += 4 00342 (length,) = _struct_I.unpack(str[start:end]) 00343 start = end 00344 end += length 00345 val1.label = str[start:end] 00346 _x = val1 00347 start = end 00348 end += 8 00349 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00350 self.result.time_to_stop.layout.dim.append(val1) 00351 start = end 00352 end += 4 00353 (self.result.time_to_stop.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00354 start = end 00355 end += 4 00356 (length,) = _struct_I.unpack(str[start:end]) 00357 pattern = '<%sf'%length 00358 start = end 00359 end += struct.calcsize(pattern) 00360 self.result.time_to_stop.data = struct.unpack(pattern, str[start:end]) 00361 return self 00362 except struct.error as e: 00363 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00364 00365 00366 def serialize_numpy(self, buff, numpy): 00367 """ 00368 serialize message with numpy array types into buffer 00369 @param buff: buffer 00370 @type buff: StringIO 00371 @param numpy: numpy python module 00372 @type numpy module 00373 """ 00374 try: 00375 _x = self 00376 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00377 _x = self.header.frame_id 00378 length = len(_x) 00379 buff.write(struct.pack('<I%ss'%length, length, _x)) 00380 _x = self 00381 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs)) 00382 _x = self.status.goal_id.id 00383 length = len(_x) 00384 buff.write(struct.pack('<I%ss'%length, length, _x)) 00385 buff.write(_struct_B.pack(self.status.status)) 00386 _x = self.status.text 00387 length = len(_x) 00388 buff.write(struct.pack('<I%ss'%length, length, _x)) 00389 length = len(self.result.actual_joint_values.layout.dim) 00390 buff.write(_struct_I.pack(length)) 00391 for val1 in self.result.actual_joint_values.layout.dim: 00392 _x = val1.label 00393 length = len(_x) 00394 buff.write(struct.pack('<I%ss'%length, length, _x)) 00395 _x = val1 00396 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00397 buff.write(_struct_I.pack(self.result.actual_joint_values.layout.data_offset)) 00398 length = len(self.result.actual_joint_values.data) 00399 buff.write(_struct_I.pack(length)) 00400 pattern = '<%sf'%length 00401 buff.write(self.result.actual_joint_values.data.tostring()) 00402 length = len(self.result.actual_forces.layout.dim) 00403 buff.write(_struct_I.pack(length)) 00404 for val1 in self.result.actual_forces.layout.dim: 00405 _x = val1.label 00406 length = len(_x) 00407 buff.write(struct.pack('<I%ss'%length, length, _x)) 00408 _x = val1 00409 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00410 buff.write(_struct_I.pack(self.result.actual_forces.layout.data_offset)) 00411 length = len(self.result.actual_forces.data) 00412 buff.write(_struct_I.pack(length)) 00413 pattern = '<%sh'%length 00414 buff.write(self.result.actual_forces.data.tostring()) 00415 length = len(self.result.time_to_stop.layout.dim) 00416 buff.write(_struct_I.pack(length)) 00417 for val1 in self.result.time_to_stop.layout.dim: 00418 _x = val1.label 00419 length = len(_x) 00420 buff.write(struct.pack('<I%ss'%length, length, _x)) 00421 _x = val1 00422 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00423 buff.write(_struct_I.pack(self.result.time_to_stop.layout.data_offset)) 00424 length = len(self.result.time_to_stop.data) 00425 buff.write(_struct_I.pack(length)) 00426 pattern = '<%sf'%length 00427 buff.write(self.result.time_to_stop.data.tostring()) 00428 except struct.error as se: self._check_types(se) 00429 except TypeError as te: self._check_types(te) 00430 00431 def deserialize_numpy(self, str, numpy): 00432 """ 00433 unpack serialized message in str into this message instance using numpy for array types 00434 @param str: byte array of serialized message 00435 @type str: str 00436 @param numpy: numpy python module 00437 @type numpy: module 00438 """ 00439 try: 00440 if self.header is None: 00441 self.header = std_msgs.msg._Header.Header() 00442 if self.status is None: 00443 self.status = actionlib_msgs.msg.GoalStatus() 00444 if self.result is None: 00445 self.result = srs_assisted_grasping_msgs.msg.ReactiveGraspingResult() 00446 end = 0 00447 _x = self 00448 start = end 00449 end += 12 00450 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00451 start = end 00452 end += 4 00453 (length,) = _struct_I.unpack(str[start:end]) 00454 start = end 00455 end += length 00456 self.header.frame_id = str[start:end] 00457 _x = self 00458 start = end 00459 end += 8 00460 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00461 start = end 00462 end += 4 00463 (length,) = _struct_I.unpack(str[start:end]) 00464 start = end 00465 end += length 00466 self.status.goal_id.id = str[start:end] 00467 start = end 00468 end += 1 00469 (self.status.status,) = _struct_B.unpack(str[start:end]) 00470 start = end 00471 end += 4 00472 (length,) = _struct_I.unpack(str[start:end]) 00473 start = end 00474 end += length 00475 self.status.text = str[start:end] 00476 start = end 00477 end += 4 00478 (length,) = _struct_I.unpack(str[start:end]) 00479 self.result.actual_joint_values.layout.dim = [] 00480 for i in range(0, length): 00481 val1 = std_msgs.msg.MultiArrayDimension() 00482 start = end 00483 end += 4 00484 (length,) = _struct_I.unpack(str[start:end]) 00485 start = end 00486 end += length 00487 val1.label = str[start:end] 00488 _x = val1 00489 start = end 00490 end += 8 00491 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00492 self.result.actual_joint_values.layout.dim.append(val1) 00493 start = end 00494 end += 4 00495 (self.result.actual_joint_values.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00496 start = end 00497 end += 4 00498 (length,) = _struct_I.unpack(str[start:end]) 00499 pattern = '<%sf'%length 00500 start = end 00501 end += struct.calcsize(pattern) 00502 self.result.actual_joint_values.data = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00503 start = end 00504 end += 4 00505 (length,) = _struct_I.unpack(str[start:end]) 00506 self.result.actual_forces.layout.dim = [] 00507 for i in range(0, length): 00508 val1 = std_msgs.msg.MultiArrayDimension() 00509 start = end 00510 end += 4 00511 (length,) = _struct_I.unpack(str[start:end]) 00512 start = end 00513 end += length 00514 val1.label = str[start:end] 00515 _x = val1 00516 start = end 00517 end += 8 00518 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00519 self.result.actual_forces.layout.dim.append(val1) 00520 start = end 00521 end += 4 00522 (self.result.actual_forces.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00523 start = end 00524 end += 4 00525 (length,) = _struct_I.unpack(str[start:end]) 00526 pattern = '<%sh'%length 00527 start = end 00528 end += struct.calcsize(pattern) 00529 self.result.actual_forces.data = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=length) 00530 start = end 00531 end += 4 00532 (length,) = _struct_I.unpack(str[start:end]) 00533 self.result.time_to_stop.layout.dim = [] 00534 for i in range(0, length): 00535 val1 = std_msgs.msg.MultiArrayDimension() 00536 start = end 00537 end += 4 00538 (length,) = _struct_I.unpack(str[start:end]) 00539 start = end 00540 end += length 00541 val1.label = str[start:end] 00542 _x = val1 00543 start = end 00544 end += 8 00545 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00546 self.result.time_to_stop.layout.dim.append(val1) 00547 start = end 00548 end += 4 00549 (self.result.time_to_stop.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00550 start = end 00551 end += 4 00552 (length,) = _struct_I.unpack(str[start:end]) 00553 pattern = '<%sf'%length 00554 start = end 00555 end += struct.calcsize(pattern) 00556 self.result.time_to_stop.data = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00557 return self 00558 except struct.error as e: 00559 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00560 00561 _struct_I = roslib.message.struct_I 00562 _struct_3I = struct.Struct("<3I") 00563 _struct_B = struct.Struct("<B") 00564 _struct_2I = struct.Struct("<2I")