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


srs_assisted_grasping_msgs
Author(s): Zdenek Materna
autogenerated on Mon Oct 6 2014 07:57:12