$search
00001 """autogenerated by genmsg_py from ReactiveGraspingAction.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 ReactiveGraspingAction(roslib.message.Message): 00011 _md5sum = "7af9a87a0a4a8c95766f43128d661bab" 00012 _type = "srs_assisted_grasping_msgs/ReactiveGraspingAction" 00013 _has_header = False #flag to mark the presence of a Header object 00014 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00015 00016 ReactiveGraspingActionGoal action_goal 00017 ReactiveGraspingActionResult action_result 00018 ReactiveGraspingActionFeedback action_feedback 00019 00020 ================================================================================ 00021 MSG: srs_assisted_grasping_msgs/ReactiveGraspingActionGoal 00022 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00023 00024 Header header 00025 actionlib_msgs/GoalID goal_id 00026 ReactiveGraspingGoal goal 00027 00028 ================================================================================ 00029 MSG: std_msgs/Header 00030 # Standard metadata for higher-level stamped data types. 00031 # This is generally used to communicate timestamped data 00032 # in a particular coordinate frame. 00033 # 00034 # sequence ID: consecutively increasing ID 00035 uint32 seq 00036 #Two-integer timestamp that is expressed as: 00037 # * stamp.secs: seconds (stamp_secs) since epoch 00038 # * stamp.nsecs: nanoseconds since stamp_secs 00039 # time-handling sugar is provided by the client library 00040 time stamp 00041 #Frame this data is associated with 00042 # 0: no frame 00043 # 1: global frame 00044 string frame_id 00045 00046 ================================================================================ 00047 MSG: actionlib_msgs/GoalID 00048 # The stamp should store the time at which this goal was requested. 00049 # It is used by an action server when it tries to preempt all 00050 # goals that were requested before a certain time 00051 time stamp 00052 00053 # The id provides a way to associate feedback and 00054 # result message with specific goal requests. The id 00055 # specified must be unique. 00056 string id 00057 00058 00059 ================================================================================ 00060 MSG: srs_assisted_grasping_msgs/ReactiveGraspingGoal 00061 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00062 # GOAL 00063 std_msgs/Float32MultiArray target_configuration # n joints, 7 for SDH (names should be specified in yaml file) 00064 std_msgs/Float32MultiArray max_force # m tactile pads 00065 duration time # time to reach target_configuration 00066 00067 ================================================================================ 00068 MSG: std_msgs/Float32MultiArray 00069 # Please look at the MultiArrayLayout message definition for 00070 # documentation on all multiarrays. 00071 00072 MultiArrayLayout layout # specification of data layout 00073 float32[] data # array of data 00074 00075 00076 ================================================================================ 00077 MSG: std_msgs/MultiArrayLayout 00078 # The multiarray declares a generic multi-dimensional array of a 00079 # particular data type. Dimensions are ordered from outer most 00080 # to inner most. 00081 00082 MultiArrayDimension[] dim # Array of dimension properties 00083 uint32 data_offset # padding bytes at front of data 00084 00085 # Accessors should ALWAYS be written in terms of dimension stride 00086 # and specified outer-most dimension first. 00087 # 00088 # multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k] 00089 # 00090 # A standard, 3-channel 640x480 image with interleaved color channels 00091 # would be specified as: 00092 # 00093 # dim[0].label = "height" 00094 # dim[0].size = 480 00095 # dim[0].stride = 3*640*480 = 921600 (note dim[0] stride is just size of image) 00096 # dim[1].label = "width" 00097 # dim[1].size = 640 00098 # dim[1].stride = 3*640 = 1920 00099 # dim[2].label = "channel" 00100 # dim[2].size = 3 00101 # dim[2].stride = 3 00102 # 00103 # multiarray(i,j,k) refers to the ith row, jth column, and kth channel. 00104 ================================================================================ 00105 MSG: std_msgs/MultiArrayDimension 00106 string label # label of given dimension 00107 uint32 size # size of given dimension (in type units) 00108 uint32 stride # stride of given dimension 00109 ================================================================================ 00110 MSG: srs_assisted_grasping_msgs/ReactiveGraspingActionResult 00111 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00112 00113 Header header 00114 actionlib_msgs/GoalStatus status 00115 ReactiveGraspingResult result 00116 00117 ================================================================================ 00118 MSG: actionlib_msgs/GoalStatus 00119 GoalID goal_id 00120 uint8 status 00121 uint8 PENDING = 0 # The goal has yet to be processed by the action server 00122 uint8 ACTIVE = 1 # The goal is currently being processed by the action server 00123 uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing 00124 # and has since completed its execution (Terminal State) 00125 uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State) 00126 uint8 ABORTED = 4 # The goal was aborted during execution by the action server due 00127 # to some failure (Terminal State) 00128 uint8 REJECTED = 5 # The goal was rejected by the action server without being processed, 00129 # because the goal was unattainable or invalid (Terminal State) 00130 uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing 00131 # and has not yet completed execution 00132 uint8 RECALLING = 7 # The goal received a cancel request before it started executing, 00133 # but the action server has not yet confirmed that the goal is canceled 00134 uint8 RECALLED = 8 # The goal received a cancel request before it started executing 00135 # and was successfully cancelled (Terminal State) 00136 uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be 00137 # sent over the wire by an action server 00138 00139 #Allow for the user to associate a string with GoalStatus for debugging 00140 string text 00141 00142 00143 ================================================================================ 00144 MSG: srs_assisted_grasping_msgs/ReactiveGraspingResult 00145 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00146 # RESULT 00147 std_msgs/Float32MultiArray actual_joint_values # n 00148 std_msgs/Int16MultiArray actual_forces # m 00149 std_msgs/Float32MultiArray time_to_stop # n 00150 00151 ================================================================================ 00152 MSG: std_msgs/Int16MultiArray 00153 # Please look at the MultiArrayLayout message definition for 00154 # documentation on all multiarrays. 00155 00156 MultiArrayLayout layout # specification of data layout 00157 int16[] data # array of data 00158 00159 00160 ================================================================================ 00161 MSG: srs_assisted_grasping_msgs/ReactiveGraspingActionFeedback 00162 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00163 00164 Header header 00165 actionlib_msgs/GoalStatus status 00166 ReactiveGraspingFeedback feedback 00167 00168 ================================================================================ 00169 MSG: srs_assisted_grasping_msgs/ReactiveGraspingFeedback 00170 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00171 # FEEDBACK 00172 00173 00174 """ 00175 __slots__ = ['action_goal','action_result','action_feedback'] 00176 _slot_types = ['srs_assisted_grasping_msgs/ReactiveGraspingActionGoal','srs_assisted_grasping_msgs/ReactiveGraspingActionResult','srs_assisted_grasping_msgs/ReactiveGraspingActionFeedback'] 00177 00178 def __init__(self, *args, **kwds): 00179 """ 00180 Constructor. Any message fields that are implicitly/explicitly 00181 set to None will be assigned a default value. The recommend 00182 use is keyword arguments as this is more robust to future message 00183 changes. You cannot mix in-order arguments and keyword arguments. 00184 00185 The available fields are: 00186 action_goal,action_result,action_feedback 00187 00188 @param args: complete set of field values, in .msg order 00189 @param kwds: use keyword arguments corresponding to message field names 00190 to set specific fields. 00191 """ 00192 if args or kwds: 00193 super(ReactiveGraspingAction, self).__init__(*args, **kwds) 00194 #message fields cannot be None, assign default values for those that are 00195 if self.action_goal is None: 00196 self.action_goal = srs_assisted_grasping_msgs.msg.ReactiveGraspingActionGoal() 00197 if self.action_result is None: 00198 self.action_result = srs_assisted_grasping_msgs.msg.ReactiveGraspingActionResult() 00199 if self.action_feedback is None: 00200 self.action_feedback = srs_assisted_grasping_msgs.msg.ReactiveGraspingActionFeedback() 00201 else: 00202 self.action_goal = srs_assisted_grasping_msgs.msg.ReactiveGraspingActionGoal() 00203 self.action_result = srs_assisted_grasping_msgs.msg.ReactiveGraspingActionResult() 00204 self.action_feedback = srs_assisted_grasping_msgs.msg.ReactiveGraspingActionFeedback() 00205 00206 def _get_types(self): 00207 """ 00208 internal API method 00209 """ 00210 return self._slot_types 00211 00212 def serialize(self, buff): 00213 """ 00214 serialize message into buffer 00215 @param buff: buffer 00216 @type buff: StringIO 00217 """ 00218 try: 00219 _x = self 00220 buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs)) 00221 _x = self.action_goal.header.frame_id 00222 length = len(_x) 00223 buff.write(struct.pack('<I%ss'%length, length, _x)) 00224 _x = self 00225 buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs)) 00226 _x = self.action_goal.goal_id.id 00227 length = len(_x) 00228 buff.write(struct.pack('<I%ss'%length, length, _x)) 00229 length = len(self.action_goal.goal.target_configuration.layout.dim) 00230 buff.write(_struct_I.pack(length)) 00231 for val1 in self.action_goal.goal.target_configuration.layout.dim: 00232 _x = val1.label 00233 length = len(_x) 00234 buff.write(struct.pack('<I%ss'%length, length, _x)) 00235 _x = val1 00236 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00237 buff.write(_struct_I.pack(self.action_goal.goal.target_configuration.layout.data_offset)) 00238 length = len(self.action_goal.goal.target_configuration.data) 00239 buff.write(_struct_I.pack(length)) 00240 pattern = '<%sf'%length 00241 buff.write(struct.pack(pattern, *self.action_goal.goal.target_configuration.data)) 00242 length = len(self.action_goal.goal.max_force.layout.dim) 00243 buff.write(_struct_I.pack(length)) 00244 for val1 in self.action_goal.goal.max_force.layout.dim: 00245 _x = val1.label 00246 length = len(_x) 00247 buff.write(struct.pack('<I%ss'%length, length, _x)) 00248 _x = val1 00249 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00250 buff.write(_struct_I.pack(self.action_goal.goal.max_force.layout.data_offset)) 00251 length = len(self.action_goal.goal.max_force.data) 00252 buff.write(_struct_I.pack(length)) 00253 pattern = '<%sf'%length 00254 buff.write(struct.pack(pattern, *self.action_goal.goal.max_force.data)) 00255 _x = self 00256 buff.write(_struct_2i3I.pack(_x.action_goal.goal.time.secs, _x.action_goal.goal.time.nsecs, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs)) 00257 _x = self.action_result.header.frame_id 00258 length = len(_x) 00259 buff.write(struct.pack('<I%ss'%length, length, _x)) 00260 _x = self 00261 buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs)) 00262 _x = self.action_result.status.goal_id.id 00263 length = len(_x) 00264 buff.write(struct.pack('<I%ss'%length, length, _x)) 00265 buff.write(_struct_B.pack(self.action_result.status.status)) 00266 _x = self.action_result.status.text 00267 length = len(_x) 00268 buff.write(struct.pack('<I%ss'%length, length, _x)) 00269 length = len(self.action_result.result.actual_joint_values.layout.dim) 00270 buff.write(_struct_I.pack(length)) 00271 for val1 in self.action_result.result.actual_joint_values.layout.dim: 00272 _x = val1.label 00273 length = len(_x) 00274 buff.write(struct.pack('<I%ss'%length, length, _x)) 00275 _x = val1 00276 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00277 buff.write(_struct_I.pack(self.action_result.result.actual_joint_values.layout.data_offset)) 00278 length = len(self.action_result.result.actual_joint_values.data) 00279 buff.write(_struct_I.pack(length)) 00280 pattern = '<%sf'%length 00281 buff.write(struct.pack(pattern, *self.action_result.result.actual_joint_values.data)) 00282 length = len(self.action_result.result.actual_forces.layout.dim) 00283 buff.write(_struct_I.pack(length)) 00284 for val1 in self.action_result.result.actual_forces.layout.dim: 00285 _x = val1.label 00286 length = len(_x) 00287 buff.write(struct.pack('<I%ss'%length, length, _x)) 00288 _x = val1 00289 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00290 buff.write(_struct_I.pack(self.action_result.result.actual_forces.layout.data_offset)) 00291 length = len(self.action_result.result.actual_forces.data) 00292 buff.write(_struct_I.pack(length)) 00293 pattern = '<%sh'%length 00294 buff.write(struct.pack(pattern, *self.action_result.result.actual_forces.data)) 00295 length = len(self.action_result.result.time_to_stop.layout.dim) 00296 buff.write(_struct_I.pack(length)) 00297 for val1 in self.action_result.result.time_to_stop.layout.dim: 00298 _x = val1.label 00299 length = len(_x) 00300 buff.write(struct.pack('<I%ss'%length, length, _x)) 00301 _x = val1 00302 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00303 buff.write(_struct_I.pack(self.action_result.result.time_to_stop.layout.data_offset)) 00304 length = len(self.action_result.result.time_to_stop.data) 00305 buff.write(_struct_I.pack(length)) 00306 pattern = '<%sf'%length 00307 buff.write(struct.pack(pattern, *self.action_result.result.time_to_stop.data)) 00308 _x = self 00309 buff.write(_struct_3I.pack(_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs)) 00310 _x = self.action_feedback.header.frame_id 00311 length = len(_x) 00312 buff.write(struct.pack('<I%ss'%length, length, _x)) 00313 _x = self 00314 buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs)) 00315 _x = self.action_feedback.status.goal_id.id 00316 length = len(_x) 00317 buff.write(struct.pack('<I%ss'%length, length, _x)) 00318 buff.write(_struct_B.pack(self.action_feedback.status.status)) 00319 _x = self.action_feedback.status.text 00320 length = len(_x) 00321 buff.write(struct.pack('<I%ss'%length, length, _x)) 00322 except struct.error as se: self._check_types(se) 00323 except TypeError as te: self._check_types(te) 00324 00325 def deserialize(self, str): 00326 """ 00327 unpack serialized message in str into this message instance 00328 @param str: byte array of serialized message 00329 @type str: str 00330 """ 00331 try: 00332 if self.action_goal is None: 00333 self.action_goal = srs_assisted_grasping_msgs.msg.ReactiveGraspingActionGoal() 00334 if self.action_result is None: 00335 self.action_result = srs_assisted_grasping_msgs.msg.ReactiveGraspingActionResult() 00336 if self.action_feedback is None: 00337 self.action_feedback = srs_assisted_grasping_msgs.msg.ReactiveGraspingActionFeedback() 00338 end = 0 00339 _x = self 00340 start = end 00341 end += 12 00342 (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00343 start = end 00344 end += 4 00345 (length,) = _struct_I.unpack(str[start:end]) 00346 start = end 00347 end += length 00348 self.action_goal.header.frame_id = str[start:end] 00349 _x = self 00350 start = end 00351 end += 8 00352 (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00353 start = end 00354 end += 4 00355 (length,) = _struct_I.unpack(str[start:end]) 00356 start = end 00357 end += length 00358 self.action_goal.goal_id.id = str[start:end] 00359 start = end 00360 end += 4 00361 (length,) = _struct_I.unpack(str[start:end]) 00362 self.action_goal.goal.target_configuration.layout.dim = [] 00363 for i in range(0, length): 00364 val1 = std_msgs.msg.MultiArrayDimension() 00365 start = end 00366 end += 4 00367 (length,) = _struct_I.unpack(str[start:end]) 00368 start = end 00369 end += length 00370 val1.label = str[start:end] 00371 _x = val1 00372 start = end 00373 end += 8 00374 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00375 self.action_goal.goal.target_configuration.layout.dim.append(val1) 00376 start = end 00377 end += 4 00378 (self.action_goal.goal.target_configuration.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00379 start = end 00380 end += 4 00381 (length,) = _struct_I.unpack(str[start:end]) 00382 pattern = '<%sf'%length 00383 start = end 00384 end += struct.calcsize(pattern) 00385 self.action_goal.goal.target_configuration.data = struct.unpack(pattern, str[start:end]) 00386 start = end 00387 end += 4 00388 (length,) = _struct_I.unpack(str[start:end]) 00389 self.action_goal.goal.max_force.layout.dim = [] 00390 for i in range(0, length): 00391 val1 = std_msgs.msg.MultiArrayDimension() 00392 start = end 00393 end += 4 00394 (length,) = _struct_I.unpack(str[start:end]) 00395 start = end 00396 end += length 00397 val1.label = str[start:end] 00398 _x = val1 00399 start = end 00400 end += 8 00401 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00402 self.action_goal.goal.max_force.layout.dim.append(val1) 00403 start = end 00404 end += 4 00405 (self.action_goal.goal.max_force.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00406 start = end 00407 end += 4 00408 (length,) = _struct_I.unpack(str[start:end]) 00409 pattern = '<%sf'%length 00410 start = end 00411 end += struct.calcsize(pattern) 00412 self.action_goal.goal.max_force.data = struct.unpack(pattern, str[start:end]) 00413 _x = self 00414 start = end 00415 end += 20 00416 (_x.action_goal.goal.time.secs, _x.action_goal.goal.time.nsecs, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_2i3I.unpack(str[start:end]) 00417 start = end 00418 end += 4 00419 (length,) = _struct_I.unpack(str[start:end]) 00420 start = end 00421 end += length 00422 self.action_result.header.frame_id = str[start:end] 00423 _x = self 00424 start = end 00425 end += 8 00426 (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00427 start = end 00428 end += 4 00429 (length,) = _struct_I.unpack(str[start:end]) 00430 start = end 00431 end += length 00432 self.action_result.status.goal_id.id = str[start:end] 00433 start = end 00434 end += 1 00435 (self.action_result.status.status,) = _struct_B.unpack(str[start:end]) 00436 start = end 00437 end += 4 00438 (length,) = _struct_I.unpack(str[start:end]) 00439 start = end 00440 end += length 00441 self.action_result.status.text = str[start:end] 00442 start = end 00443 end += 4 00444 (length,) = _struct_I.unpack(str[start:end]) 00445 self.action_result.result.actual_joint_values.layout.dim = [] 00446 for i in range(0, length): 00447 val1 = std_msgs.msg.MultiArrayDimension() 00448 start = end 00449 end += 4 00450 (length,) = _struct_I.unpack(str[start:end]) 00451 start = end 00452 end += length 00453 val1.label = str[start:end] 00454 _x = val1 00455 start = end 00456 end += 8 00457 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00458 self.action_result.result.actual_joint_values.layout.dim.append(val1) 00459 start = end 00460 end += 4 00461 (self.action_result.result.actual_joint_values.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00462 start = end 00463 end += 4 00464 (length,) = _struct_I.unpack(str[start:end]) 00465 pattern = '<%sf'%length 00466 start = end 00467 end += struct.calcsize(pattern) 00468 self.action_result.result.actual_joint_values.data = struct.unpack(pattern, str[start:end]) 00469 start = end 00470 end += 4 00471 (length,) = _struct_I.unpack(str[start:end]) 00472 self.action_result.result.actual_forces.layout.dim = [] 00473 for i in range(0, length): 00474 val1 = std_msgs.msg.MultiArrayDimension() 00475 start = end 00476 end += 4 00477 (length,) = _struct_I.unpack(str[start:end]) 00478 start = end 00479 end += length 00480 val1.label = str[start:end] 00481 _x = val1 00482 start = end 00483 end += 8 00484 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00485 self.action_result.result.actual_forces.layout.dim.append(val1) 00486 start = end 00487 end += 4 00488 (self.action_result.result.actual_forces.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00489 start = end 00490 end += 4 00491 (length,) = _struct_I.unpack(str[start:end]) 00492 pattern = '<%sh'%length 00493 start = end 00494 end += struct.calcsize(pattern) 00495 self.action_result.result.actual_forces.data = struct.unpack(pattern, str[start:end]) 00496 start = end 00497 end += 4 00498 (length,) = _struct_I.unpack(str[start:end]) 00499 self.action_result.result.time_to_stop.layout.dim = [] 00500 for i in range(0, length): 00501 val1 = std_msgs.msg.MultiArrayDimension() 00502 start = end 00503 end += 4 00504 (length,) = _struct_I.unpack(str[start:end]) 00505 start = end 00506 end += length 00507 val1.label = str[start:end] 00508 _x = val1 00509 start = end 00510 end += 8 00511 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00512 self.action_result.result.time_to_stop.layout.dim.append(val1) 00513 start = end 00514 end += 4 00515 (self.action_result.result.time_to_stop.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00516 start = end 00517 end += 4 00518 (length,) = _struct_I.unpack(str[start:end]) 00519 pattern = '<%sf'%length 00520 start = end 00521 end += struct.calcsize(pattern) 00522 self.action_result.result.time_to_stop.data = struct.unpack(pattern, str[start:end]) 00523 _x = self 00524 start = end 00525 end += 12 00526 (_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00527 start = end 00528 end += 4 00529 (length,) = _struct_I.unpack(str[start:end]) 00530 start = end 00531 end += length 00532 self.action_feedback.header.frame_id = str[start:end] 00533 _x = self 00534 start = end 00535 end += 8 00536 (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00537 start = end 00538 end += 4 00539 (length,) = _struct_I.unpack(str[start:end]) 00540 start = end 00541 end += length 00542 self.action_feedback.status.goal_id.id = str[start:end] 00543 start = end 00544 end += 1 00545 (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end]) 00546 start = end 00547 end += 4 00548 (length,) = _struct_I.unpack(str[start:end]) 00549 start = end 00550 end += length 00551 self.action_feedback.status.text = str[start:end] 00552 return self 00553 except struct.error as e: 00554 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00555 00556 00557 def serialize_numpy(self, buff, numpy): 00558 """ 00559 serialize message with numpy array types into buffer 00560 @param buff: buffer 00561 @type buff: StringIO 00562 @param numpy: numpy python module 00563 @type numpy module 00564 """ 00565 try: 00566 _x = self 00567 buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs)) 00568 _x = self.action_goal.header.frame_id 00569 length = len(_x) 00570 buff.write(struct.pack('<I%ss'%length, length, _x)) 00571 _x = self 00572 buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs)) 00573 _x = self.action_goal.goal_id.id 00574 length = len(_x) 00575 buff.write(struct.pack('<I%ss'%length, length, _x)) 00576 length = len(self.action_goal.goal.target_configuration.layout.dim) 00577 buff.write(_struct_I.pack(length)) 00578 for val1 in self.action_goal.goal.target_configuration.layout.dim: 00579 _x = val1.label 00580 length = len(_x) 00581 buff.write(struct.pack('<I%ss'%length, length, _x)) 00582 _x = val1 00583 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00584 buff.write(_struct_I.pack(self.action_goal.goal.target_configuration.layout.data_offset)) 00585 length = len(self.action_goal.goal.target_configuration.data) 00586 buff.write(_struct_I.pack(length)) 00587 pattern = '<%sf'%length 00588 buff.write(self.action_goal.goal.target_configuration.data.tostring()) 00589 length = len(self.action_goal.goal.max_force.layout.dim) 00590 buff.write(_struct_I.pack(length)) 00591 for val1 in self.action_goal.goal.max_force.layout.dim: 00592 _x = val1.label 00593 length = len(_x) 00594 buff.write(struct.pack('<I%ss'%length, length, _x)) 00595 _x = val1 00596 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00597 buff.write(_struct_I.pack(self.action_goal.goal.max_force.layout.data_offset)) 00598 length = len(self.action_goal.goal.max_force.data) 00599 buff.write(_struct_I.pack(length)) 00600 pattern = '<%sf'%length 00601 buff.write(self.action_goal.goal.max_force.data.tostring()) 00602 _x = self 00603 buff.write(_struct_2i3I.pack(_x.action_goal.goal.time.secs, _x.action_goal.goal.time.nsecs, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs)) 00604 _x = self.action_result.header.frame_id 00605 length = len(_x) 00606 buff.write(struct.pack('<I%ss'%length, length, _x)) 00607 _x = self 00608 buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs)) 00609 _x = self.action_result.status.goal_id.id 00610 length = len(_x) 00611 buff.write(struct.pack('<I%ss'%length, length, _x)) 00612 buff.write(_struct_B.pack(self.action_result.status.status)) 00613 _x = self.action_result.status.text 00614 length = len(_x) 00615 buff.write(struct.pack('<I%ss'%length, length, _x)) 00616 length = len(self.action_result.result.actual_joint_values.layout.dim) 00617 buff.write(_struct_I.pack(length)) 00618 for val1 in self.action_result.result.actual_joint_values.layout.dim: 00619 _x = val1.label 00620 length = len(_x) 00621 buff.write(struct.pack('<I%ss'%length, length, _x)) 00622 _x = val1 00623 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00624 buff.write(_struct_I.pack(self.action_result.result.actual_joint_values.layout.data_offset)) 00625 length = len(self.action_result.result.actual_joint_values.data) 00626 buff.write(_struct_I.pack(length)) 00627 pattern = '<%sf'%length 00628 buff.write(self.action_result.result.actual_joint_values.data.tostring()) 00629 length = len(self.action_result.result.actual_forces.layout.dim) 00630 buff.write(_struct_I.pack(length)) 00631 for val1 in self.action_result.result.actual_forces.layout.dim: 00632 _x = val1.label 00633 length = len(_x) 00634 buff.write(struct.pack('<I%ss'%length, length, _x)) 00635 _x = val1 00636 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00637 buff.write(_struct_I.pack(self.action_result.result.actual_forces.layout.data_offset)) 00638 length = len(self.action_result.result.actual_forces.data) 00639 buff.write(_struct_I.pack(length)) 00640 pattern = '<%sh'%length 00641 buff.write(self.action_result.result.actual_forces.data.tostring()) 00642 length = len(self.action_result.result.time_to_stop.layout.dim) 00643 buff.write(_struct_I.pack(length)) 00644 for val1 in self.action_result.result.time_to_stop.layout.dim: 00645 _x = val1.label 00646 length = len(_x) 00647 buff.write(struct.pack('<I%ss'%length, length, _x)) 00648 _x = val1 00649 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00650 buff.write(_struct_I.pack(self.action_result.result.time_to_stop.layout.data_offset)) 00651 length = len(self.action_result.result.time_to_stop.data) 00652 buff.write(_struct_I.pack(length)) 00653 pattern = '<%sf'%length 00654 buff.write(self.action_result.result.time_to_stop.data.tostring()) 00655 _x = self 00656 buff.write(_struct_3I.pack(_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs)) 00657 _x = self.action_feedback.header.frame_id 00658 length = len(_x) 00659 buff.write(struct.pack('<I%ss'%length, length, _x)) 00660 _x = self 00661 buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs)) 00662 _x = self.action_feedback.status.goal_id.id 00663 length = len(_x) 00664 buff.write(struct.pack('<I%ss'%length, length, _x)) 00665 buff.write(_struct_B.pack(self.action_feedback.status.status)) 00666 _x = self.action_feedback.status.text 00667 length = len(_x) 00668 buff.write(struct.pack('<I%ss'%length, length, _x)) 00669 except struct.error as se: self._check_types(se) 00670 except TypeError as te: self._check_types(te) 00671 00672 def deserialize_numpy(self, str, numpy): 00673 """ 00674 unpack serialized message in str into this message instance using numpy for array types 00675 @param str: byte array of serialized message 00676 @type str: str 00677 @param numpy: numpy python module 00678 @type numpy: module 00679 """ 00680 try: 00681 if self.action_goal is None: 00682 self.action_goal = srs_assisted_grasping_msgs.msg.ReactiveGraspingActionGoal() 00683 if self.action_result is None: 00684 self.action_result = srs_assisted_grasping_msgs.msg.ReactiveGraspingActionResult() 00685 if self.action_feedback is None: 00686 self.action_feedback = srs_assisted_grasping_msgs.msg.ReactiveGraspingActionFeedback() 00687 end = 0 00688 _x = self 00689 start = end 00690 end += 12 00691 (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00692 start = end 00693 end += 4 00694 (length,) = _struct_I.unpack(str[start:end]) 00695 start = end 00696 end += length 00697 self.action_goal.header.frame_id = str[start:end] 00698 _x = self 00699 start = end 00700 end += 8 00701 (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00702 start = end 00703 end += 4 00704 (length,) = _struct_I.unpack(str[start:end]) 00705 start = end 00706 end += length 00707 self.action_goal.goal_id.id = str[start:end] 00708 start = end 00709 end += 4 00710 (length,) = _struct_I.unpack(str[start:end]) 00711 self.action_goal.goal.target_configuration.layout.dim = [] 00712 for i in range(0, length): 00713 val1 = std_msgs.msg.MultiArrayDimension() 00714 start = end 00715 end += 4 00716 (length,) = _struct_I.unpack(str[start:end]) 00717 start = end 00718 end += length 00719 val1.label = str[start:end] 00720 _x = val1 00721 start = end 00722 end += 8 00723 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00724 self.action_goal.goal.target_configuration.layout.dim.append(val1) 00725 start = end 00726 end += 4 00727 (self.action_goal.goal.target_configuration.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00728 start = end 00729 end += 4 00730 (length,) = _struct_I.unpack(str[start:end]) 00731 pattern = '<%sf'%length 00732 start = end 00733 end += struct.calcsize(pattern) 00734 self.action_goal.goal.target_configuration.data = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00735 start = end 00736 end += 4 00737 (length,) = _struct_I.unpack(str[start:end]) 00738 self.action_goal.goal.max_force.layout.dim = [] 00739 for i in range(0, length): 00740 val1 = std_msgs.msg.MultiArrayDimension() 00741 start = end 00742 end += 4 00743 (length,) = _struct_I.unpack(str[start:end]) 00744 start = end 00745 end += length 00746 val1.label = str[start:end] 00747 _x = val1 00748 start = end 00749 end += 8 00750 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00751 self.action_goal.goal.max_force.layout.dim.append(val1) 00752 start = end 00753 end += 4 00754 (self.action_goal.goal.max_force.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00755 start = end 00756 end += 4 00757 (length,) = _struct_I.unpack(str[start:end]) 00758 pattern = '<%sf'%length 00759 start = end 00760 end += struct.calcsize(pattern) 00761 self.action_goal.goal.max_force.data = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00762 _x = self 00763 start = end 00764 end += 20 00765 (_x.action_goal.goal.time.secs, _x.action_goal.goal.time.nsecs, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_2i3I.unpack(str[start:end]) 00766 start = end 00767 end += 4 00768 (length,) = _struct_I.unpack(str[start:end]) 00769 start = end 00770 end += length 00771 self.action_result.header.frame_id = str[start:end] 00772 _x = self 00773 start = end 00774 end += 8 00775 (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00776 start = end 00777 end += 4 00778 (length,) = _struct_I.unpack(str[start:end]) 00779 start = end 00780 end += length 00781 self.action_result.status.goal_id.id = str[start:end] 00782 start = end 00783 end += 1 00784 (self.action_result.status.status,) = _struct_B.unpack(str[start:end]) 00785 start = end 00786 end += 4 00787 (length,) = _struct_I.unpack(str[start:end]) 00788 start = end 00789 end += length 00790 self.action_result.status.text = str[start:end] 00791 start = end 00792 end += 4 00793 (length,) = _struct_I.unpack(str[start:end]) 00794 self.action_result.result.actual_joint_values.layout.dim = [] 00795 for i in range(0, length): 00796 val1 = std_msgs.msg.MultiArrayDimension() 00797 start = end 00798 end += 4 00799 (length,) = _struct_I.unpack(str[start:end]) 00800 start = end 00801 end += length 00802 val1.label = str[start:end] 00803 _x = val1 00804 start = end 00805 end += 8 00806 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00807 self.action_result.result.actual_joint_values.layout.dim.append(val1) 00808 start = end 00809 end += 4 00810 (self.action_result.result.actual_joint_values.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00811 start = end 00812 end += 4 00813 (length,) = _struct_I.unpack(str[start:end]) 00814 pattern = '<%sf'%length 00815 start = end 00816 end += struct.calcsize(pattern) 00817 self.action_result.result.actual_joint_values.data = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00818 start = end 00819 end += 4 00820 (length,) = _struct_I.unpack(str[start:end]) 00821 self.action_result.result.actual_forces.layout.dim = [] 00822 for i in range(0, length): 00823 val1 = std_msgs.msg.MultiArrayDimension() 00824 start = end 00825 end += 4 00826 (length,) = _struct_I.unpack(str[start:end]) 00827 start = end 00828 end += length 00829 val1.label = str[start:end] 00830 _x = val1 00831 start = end 00832 end += 8 00833 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00834 self.action_result.result.actual_forces.layout.dim.append(val1) 00835 start = end 00836 end += 4 00837 (self.action_result.result.actual_forces.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00838 start = end 00839 end += 4 00840 (length,) = _struct_I.unpack(str[start:end]) 00841 pattern = '<%sh'%length 00842 start = end 00843 end += struct.calcsize(pattern) 00844 self.action_result.result.actual_forces.data = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=length) 00845 start = end 00846 end += 4 00847 (length,) = _struct_I.unpack(str[start:end]) 00848 self.action_result.result.time_to_stop.layout.dim = [] 00849 for i in range(0, length): 00850 val1 = std_msgs.msg.MultiArrayDimension() 00851 start = end 00852 end += 4 00853 (length,) = _struct_I.unpack(str[start:end]) 00854 start = end 00855 end += length 00856 val1.label = str[start:end] 00857 _x = val1 00858 start = end 00859 end += 8 00860 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00861 self.action_result.result.time_to_stop.layout.dim.append(val1) 00862 start = end 00863 end += 4 00864 (self.action_result.result.time_to_stop.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00865 start = end 00866 end += 4 00867 (length,) = _struct_I.unpack(str[start:end]) 00868 pattern = '<%sf'%length 00869 start = end 00870 end += struct.calcsize(pattern) 00871 self.action_result.result.time_to_stop.data = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00872 _x = self 00873 start = end 00874 end += 12 00875 (_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00876 start = end 00877 end += 4 00878 (length,) = _struct_I.unpack(str[start:end]) 00879 start = end 00880 end += length 00881 self.action_feedback.header.frame_id = str[start:end] 00882 _x = self 00883 start = end 00884 end += 8 00885 (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00886 start = end 00887 end += 4 00888 (length,) = _struct_I.unpack(str[start:end]) 00889 start = end 00890 end += length 00891 self.action_feedback.status.goal_id.id = str[start:end] 00892 start = end 00893 end += 1 00894 (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end]) 00895 start = end 00896 end += 4 00897 (length,) = _struct_I.unpack(str[start:end]) 00898 start = end 00899 end += length 00900 self.action_feedback.status.text = str[start:end] 00901 return self 00902 except struct.error as e: 00903 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00904 00905 _struct_I = roslib.message.struct_I 00906 _struct_3I = struct.Struct("<3I") 00907 _struct_B = struct.Struct("<B") 00908 _struct_2I = struct.Struct("<2I") 00909 _struct_2i3I = struct.Struct("<2i3I")