_GraspHandPostureExecutionActionGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from object_manipulation_msgs/GraspHandPostureExecutionActionGoal.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 object_manipulation_msgs.msg
00008 import actionlib_msgs.msg
00009 import manipulation_msgs.msg
00010 import geometry_msgs.msg
00011 import sensor_msgs.msg
00012 import genpy
00013 import std_msgs.msg
00014 
00015 class GraspHandPostureExecutionActionGoal(genpy.Message):
00016   _md5sum = "b713f646490f641167c09761e99f87d6"
00017   _type = "object_manipulation_msgs/GraspHandPostureExecutionActionGoal"
00018   _has_header = True #flag to mark the presence of a Header object
00019   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00020 
00021 Header header
00022 actionlib_msgs/GoalID goal_id
00023 GraspHandPostureExecutionGoal goal
00024 
00025 ================================================================================
00026 MSG: std_msgs/Header
00027 # Standard metadata for higher-level stamped data types.
00028 # This is generally used to communicate timestamped data 
00029 # in a particular coordinate frame.
00030 # 
00031 # sequence ID: consecutively increasing ID 
00032 uint32 seq
00033 #Two-integer timestamp that is expressed as:
00034 # * stamp.secs: seconds (stamp_secs) since epoch
00035 # * stamp.nsecs: nanoseconds since stamp_secs
00036 # time-handling sugar is provided by the client library
00037 time stamp
00038 #Frame this data is associated with
00039 # 0: no frame
00040 # 1: global frame
00041 string frame_id
00042 
00043 ================================================================================
00044 MSG: actionlib_msgs/GoalID
00045 # The stamp should store the time at which this goal was requested.
00046 # It is used by an action server when it tries to preempt all
00047 # goals that were requested before a certain time
00048 time stamp
00049 
00050 # The id provides a way to associate feedback and
00051 # result message with specific goal requests. The id
00052 # specified must be unique.
00053 string id
00054 
00055 
00056 ================================================================================
00057 MSG: object_manipulation_msgs/GraspHandPostureExecutionGoal
00058 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00059 # an action for requesting the finger posture part of grasp be physically carried out by a hand
00060 # the name of the arm being used is not in here, as this will be sent to a specific action server
00061 # for each arm
00062 
00063 # the grasp to be executed
00064 manipulation_msgs/Grasp grasp
00065 
00066 # the goal of this action
00067 # requests that the hand be set in the pre-grasp posture
00068 int32 PRE_GRASP=1
00069 # requests that the hand execute the actual grasp
00070 int32 GRASP=2
00071 # requests that the hand open to release the object
00072 int32 RELEASE=3
00073 int32 goal
00074 
00075 # the max contact force to use (<=0 if no desired max)
00076 float32 max_contact_force
00077 
00078 
00079 ================================================================================
00080 MSG: manipulation_msgs/Grasp
00081 # A name for this grasp
00082 string id
00083 
00084 # The internal posture of the hand for the pre-grasp
00085 # only positions are used
00086 sensor_msgs/JointState pre_grasp_posture
00087 
00088 # The internal posture of the hand for the grasp
00089 # positions and efforts are used
00090 sensor_msgs/JointState grasp_posture
00091 
00092 # The position of the end-effector for the grasp relative to a reference frame 
00093 # (that is always specified elsewhere, not in this message)
00094 geometry_msgs/PoseStamped grasp_pose
00095 
00096 # The estimated probability of success for this grasp, or some other
00097 # measure of how "good" it is.
00098 float64 grasp_quality
00099 
00100 # The approach motion
00101 GripperTranslation approach
00102 
00103 # The retreat motion
00104 GripperTranslation retreat
00105 
00106 # the maximum contact force to use while grasping (<=0 to disable)
00107 float32 max_contact_force
00108 
00109 # an optional list of obstacles that we have semantic information about
00110 # and that can be touched/pushed/moved in the course of grasping
00111 string[] allowed_touch_objects
00112 
00113 ================================================================================
00114 MSG: sensor_msgs/JointState
00115 # This is a message that holds data to describe the state of a set of torque controlled joints. 
00116 #
00117 # The state of each joint (revolute or prismatic) is defined by:
00118 #  * the position of the joint (rad or m),
00119 #  * the velocity of the joint (rad/s or m/s) and 
00120 #  * the effort that is applied in the joint (Nm or N).
00121 #
00122 # Each joint is uniquely identified by its name
00123 # The header specifies the time at which the joint states were recorded. All the joint states
00124 # in one message have to be recorded at the same time.
00125 #
00126 # This message consists of a multiple arrays, one for each part of the joint state. 
00127 # The goal is to make each of the fields optional. When e.g. your joints have no
00128 # effort associated with them, you can leave the effort array empty. 
00129 #
00130 # All arrays in this message should have the same size, or be empty.
00131 # This is the only way to uniquely associate the joint name with the correct
00132 # states.
00133 
00134 
00135 Header header
00136 
00137 string[] name
00138 float64[] position
00139 float64[] velocity
00140 float64[] effort
00141 
00142 ================================================================================
00143 MSG: geometry_msgs/PoseStamped
00144 # A Pose with reference coordinate frame and timestamp
00145 Header header
00146 Pose pose
00147 
00148 ================================================================================
00149 MSG: geometry_msgs/Pose
00150 # A representation of pose in free space, composed of postion and orientation. 
00151 Point position
00152 Quaternion orientation
00153 
00154 ================================================================================
00155 MSG: geometry_msgs/Point
00156 # This contains the position of a point in free space
00157 float64 x
00158 float64 y
00159 float64 z
00160 
00161 ================================================================================
00162 MSG: geometry_msgs/Quaternion
00163 # This represents an orientation in free space in quaternion form.
00164 
00165 float64 x
00166 float64 y
00167 float64 z
00168 float64 w
00169 
00170 ================================================================================
00171 MSG: manipulation_msgs/GripperTranslation
00172 # defines a translation for the gripper, used in pickup or place tasks
00173 # for example for lifting an object off a table or approaching the table for placing
00174 
00175 # the direction of the translation
00176 geometry_msgs/Vector3Stamped direction
00177 
00178 # the desired translation distance
00179 float32 desired_distance
00180 
00181 # the min distance that must be considered feasible before the
00182 # grasp is even attempted
00183 float32 min_distance
00184 
00185 ================================================================================
00186 MSG: geometry_msgs/Vector3Stamped
00187 # This represents a Vector3 with reference coordinate frame and timestamp
00188 Header header
00189 Vector3 vector
00190 
00191 ================================================================================
00192 MSG: geometry_msgs/Vector3
00193 # This represents a vector in free space. 
00194 
00195 float64 x
00196 float64 y
00197 float64 z
00198 """
00199   __slots__ = ['header','goal_id','goal']
00200   _slot_types = ['std_msgs/Header','actionlib_msgs/GoalID','object_manipulation_msgs/GraspHandPostureExecutionGoal']
00201 
00202   def __init__(self, *args, **kwds):
00203     """
00204     Constructor. Any message fields that are implicitly/explicitly
00205     set to None will be assigned a default value. The recommend
00206     use is keyword arguments as this is more robust to future message
00207     changes.  You cannot mix in-order arguments and keyword arguments.
00208 
00209     The available fields are:
00210        header,goal_id,goal
00211 
00212     :param args: complete set of field values, in .msg order
00213     :param kwds: use keyword arguments corresponding to message field names
00214     to set specific fields.
00215     """
00216     if args or kwds:
00217       super(GraspHandPostureExecutionActionGoal, self).__init__(*args, **kwds)
00218       #message fields cannot be None, assign default values for those that are
00219       if self.header is None:
00220         self.header = std_msgs.msg.Header()
00221       if self.goal_id is None:
00222         self.goal_id = actionlib_msgs.msg.GoalID()
00223       if self.goal is None:
00224         self.goal = object_manipulation_msgs.msg.GraspHandPostureExecutionGoal()
00225     else:
00226       self.header = std_msgs.msg.Header()
00227       self.goal_id = actionlib_msgs.msg.GoalID()
00228       self.goal = object_manipulation_msgs.msg.GraspHandPostureExecutionGoal()
00229 
00230   def _get_types(self):
00231     """
00232     internal API method
00233     """
00234     return self._slot_types
00235 
00236   def serialize(self, buff):
00237     """
00238     serialize message into buffer
00239     :param buff: buffer, ``StringIO``
00240     """
00241     try:
00242       _x = self
00243       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00244       _x = self.header.frame_id
00245       length = len(_x)
00246       if python3 or type(_x) == unicode:
00247         _x = _x.encode('utf-8')
00248         length = len(_x)
00249       buff.write(struct.pack('<I%ss'%length, length, _x))
00250       _x = self
00251       buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00252       _x = self.goal_id.id
00253       length = len(_x)
00254       if python3 or type(_x) == unicode:
00255         _x = _x.encode('utf-8')
00256         length = len(_x)
00257       buff.write(struct.pack('<I%ss'%length, length, _x))
00258       _x = self.goal.grasp.id
00259       length = len(_x)
00260       if python3 or type(_x) == unicode:
00261         _x = _x.encode('utf-8')
00262         length = len(_x)
00263       buff.write(struct.pack('<I%ss'%length, length, _x))
00264       _x = self
00265       buff.write(_struct_3I.pack(_x.goal.grasp.pre_grasp_posture.header.seq, _x.goal.grasp.pre_grasp_posture.header.stamp.secs, _x.goal.grasp.pre_grasp_posture.header.stamp.nsecs))
00266       _x = self.goal.grasp.pre_grasp_posture.header.frame_id
00267       length = len(_x)
00268       if python3 or type(_x) == unicode:
00269         _x = _x.encode('utf-8')
00270         length = len(_x)
00271       buff.write(struct.pack('<I%ss'%length, length, _x))
00272       length = len(self.goal.grasp.pre_grasp_posture.name)
00273       buff.write(_struct_I.pack(length))
00274       for val1 in self.goal.grasp.pre_grasp_posture.name:
00275         length = len(val1)
00276         if python3 or type(val1) == unicode:
00277           val1 = val1.encode('utf-8')
00278           length = len(val1)
00279         buff.write(struct.pack('<I%ss'%length, length, val1))
00280       length = len(self.goal.grasp.pre_grasp_posture.position)
00281       buff.write(_struct_I.pack(length))
00282       pattern = '<%sd'%length
00283       buff.write(struct.pack(pattern, *self.goal.grasp.pre_grasp_posture.position))
00284       length = len(self.goal.grasp.pre_grasp_posture.velocity)
00285       buff.write(_struct_I.pack(length))
00286       pattern = '<%sd'%length
00287       buff.write(struct.pack(pattern, *self.goal.grasp.pre_grasp_posture.velocity))
00288       length = len(self.goal.grasp.pre_grasp_posture.effort)
00289       buff.write(_struct_I.pack(length))
00290       pattern = '<%sd'%length
00291       buff.write(struct.pack(pattern, *self.goal.grasp.pre_grasp_posture.effort))
00292       _x = self
00293       buff.write(_struct_3I.pack(_x.goal.grasp.grasp_posture.header.seq, _x.goal.grasp.grasp_posture.header.stamp.secs, _x.goal.grasp.grasp_posture.header.stamp.nsecs))
00294       _x = self.goal.grasp.grasp_posture.header.frame_id
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       length = len(self.goal.grasp.grasp_posture.name)
00301       buff.write(_struct_I.pack(length))
00302       for val1 in self.goal.grasp.grasp_posture.name:
00303         length = len(val1)
00304         if python3 or type(val1) == unicode:
00305           val1 = val1.encode('utf-8')
00306           length = len(val1)
00307         buff.write(struct.pack('<I%ss'%length, length, val1))
00308       length = len(self.goal.grasp.grasp_posture.position)
00309       buff.write(_struct_I.pack(length))
00310       pattern = '<%sd'%length
00311       buff.write(struct.pack(pattern, *self.goal.grasp.grasp_posture.position))
00312       length = len(self.goal.grasp.grasp_posture.velocity)
00313       buff.write(_struct_I.pack(length))
00314       pattern = '<%sd'%length
00315       buff.write(struct.pack(pattern, *self.goal.grasp.grasp_posture.velocity))
00316       length = len(self.goal.grasp.grasp_posture.effort)
00317       buff.write(_struct_I.pack(length))
00318       pattern = '<%sd'%length
00319       buff.write(struct.pack(pattern, *self.goal.grasp.grasp_posture.effort))
00320       _x = self
00321       buff.write(_struct_3I.pack(_x.goal.grasp.grasp_pose.header.seq, _x.goal.grasp.grasp_pose.header.stamp.secs, _x.goal.grasp.grasp_pose.header.stamp.nsecs))
00322       _x = self.goal.grasp.grasp_pose.header.frame_id
00323       length = len(_x)
00324       if python3 or type(_x) == unicode:
00325         _x = _x.encode('utf-8')
00326         length = len(_x)
00327       buff.write(struct.pack('<I%ss'%length, length, _x))
00328       _x = self
00329       buff.write(_struct_8d3I.pack(_x.goal.grasp.grasp_pose.pose.position.x, _x.goal.grasp.grasp_pose.pose.position.y, _x.goal.grasp.grasp_pose.pose.position.z, _x.goal.grasp.grasp_pose.pose.orientation.x, _x.goal.grasp.grasp_pose.pose.orientation.y, _x.goal.grasp.grasp_pose.pose.orientation.z, _x.goal.grasp.grasp_pose.pose.orientation.w, _x.goal.grasp.grasp_quality, _x.goal.grasp.approach.direction.header.seq, _x.goal.grasp.approach.direction.header.stamp.secs, _x.goal.grasp.approach.direction.header.stamp.nsecs))
00330       _x = self.goal.grasp.approach.direction.header.frame_id
00331       length = len(_x)
00332       if python3 or type(_x) == unicode:
00333         _x = _x.encode('utf-8')
00334         length = len(_x)
00335       buff.write(struct.pack('<I%ss'%length, length, _x))
00336       _x = self
00337       buff.write(_struct_3d2f3I.pack(_x.goal.grasp.approach.direction.vector.x, _x.goal.grasp.approach.direction.vector.y, _x.goal.grasp.approach.direction.vector.z, _x.goal.grasp.approach.desired_distance, _x.goal.grasp.approach.min_distance, _x.goal.grasp.retreat.direction.header.seq, _x.goal.grasp.retreat.direction.header.stamp.secs, _x.goal.grasp.retreat.direction.header.stamp.nsecs))
00338       _x = self.goal.grasp.retreat.direction.header.frame_id
00339       length = len(_x)
00340       if python3 or type(_x) == unicode:
00341         _x = _x.encode('utf-8')
00342         length = len(_x)
00343       buff.write(struct.pack('<I%ss'%length, length, _x))
00344       _x = self
00345       buff.write(_struct_3d3f.pack(_x.goal.grasp.retreat.direction.vector.x, _x.goal.grasp.retreat.direction.vector.y, _x.goal.grasp.retreat.direction.vector.z, _x.goal.grasp.retreat.desired_distance, _x.goal.grasp.retreat.min_distance, _x.goal.grasp.max_contact_force))
00346       length = len(self.goal.grasp.allowed_touch_objects)
00347       buff.write(_struct_I.pack(length))
00348       for val1 in self.goal.grasp.allowed_touch_objects:
00349         length = len(val1)
00350         if python3 or type(val1) == unicode:
00351           val1 = val1.encode('utf-8')
00352           length = len(val1)
00353         buff.write(struct.pack('<I%ss'%length, length, val1))
00354       _x = self
00355       buff.write(_struct_if.pack(_x.goal.goal, _x.goal.max_contact_force))
00356     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00357     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00358 
00359   def deserialize(self, str):
00360     """
00361     unpack serialized message in str into this message instance
00362     :param str: byte array of serialized message, ``str``
00363     """
00364     try:
00365       if self.header is None:
00366         self.header = std_msgs.msg.Header()
00367       if self.goal_id is None:
00368         self.goal_id = actionlib_msgs.msg.GoalID()
00369       if self.goal is None:
00370         self.goal = object_manipulation_msgs.msg.GraspHandPostureExecutionGoal()
00371       end = 0
00372       _x = self
00373       start = end
00374       end += 12
00375       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00376       start = end
00377       end += 4
00378       (length,) = _struct_I.unpack(str[start:end])
00379       start = end
00380       end += length
00381       if python3:
00382         self.header.frame_id = str[start:end].decode('utf-8')
00383       else:
00384         self.header.frame_id = str[start:end]
00385       _x = self
00386       start = end
00387       end += 8
00388       (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00389       start = end
00390       end += 4
00391       (length,) = _struct_I.unpack(str[start:end])
00392       start = end
00393       end += length
00394       if python3:
00395         self.goal_id.id = str[start:end].decode('utf-8')
00396       else:
00397         self.goal_id.id = str[start:end]
00398       start = end
00399       end += 4
00400       (length,) = _struct_I.unpack(str[start:end])
00401       start = end
00402       end += length
00403       if python3:
00404         self.goal.grasp.id = str[start:end].decode('utf-8')
00405       else:
00406         self.goal.grasp.id = str[start:end]
00407       _x = self
00408       start = end
00409       end += 12
00410       (_x.goal.grasp.pre_grasp_posture.header.seq, _x.goal.grasp.pre_grasp_posture.header.stamp.secs, _x.goal.grasp.pre_grasp_posture.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00411       start = end
00412       end += 4
00413       (length,) = _struct_I.unpack(str[start:end])
00414       start = end
00415       end += length
00416       if python3:
00417         self.goal.grasp.pre_grasp_posture.header.frame_id = str[start:end].decode('utf-8')
00418       else:
00419         self.goal.grasp.pre_grasp_posture.header.frame_id = str[start:end]
00420       start = end
00421       end += 4
00422       (length,) = _struct_I.unpack(str[start:end])
00423       self.goal.grasp.pre_grasp_posture.name = []
00424       for i in range(0, length):
00425         start = end
00426         end += 4
00427         (length,) = _struct_I.unpack(str[start:end])
00428         start = end
00429         end += length
00430         if python3:
00431           val1 = str[start:end].decode('utf-8')
00432         else:
00433           val1 = str[start:end]
00434         self.goal.grasp.pre_grasp_posture.name.append(val1)
00435       start = end
00436       end += 4
00437       (length,) = _struct_I.unpack(str[start:end])
00438       pattern = '<%sd'%length
00439       start = end
00440       end += struct.calcsize(pattern)
00441       self.goal.grasp.pre_grasp_posture.position = struct.unpack(pattern, str[start:end])
00442       start = end
00443       end += 4
00444       (length,) = _struct_I.unpack(str[start:end])
00445       pattern = '<%sd'%length
00446       start = end
00447       end += struct.calcsize(pattern)
00448       self.goal.grasp.pre_grasp_posture.velocity = struct.unpack(pattern, str[start:end])
00449       start = end
00450       end += 4
00451       (length,) = _struct_I.unpack(str[start:end])
00452       pattern = '<%sd'%length
00453       start = end
00454       end += struct.calcsize(pattern)
00455       self.goal.grasp.pre_grasp_posture.effort = struct.unpack(pattern, str[start:end])
00456       _x = self
00457       start = end
00458       end += 12
00459       (_x.goal.grasp.grasp_posture.header.seq, _x.goal.grasp.grasp_posture.header.stamp.secs, _x.goal.grasp.grasp_posture.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00460       start = end
00461       end += 4
00462       (length,) = _struct_I.unpack(str[start:end])
00463       start = end
00464       end += length
00465       if python3:
00466         self.goal.grasp.grasp_posture.header.frame_id = str[start:end].decode('utf-8')
00467       else:
00468         self.goal.grasp.grasp_posture.header.frame_id = str[start:end]
00469       start = end
00470       end += 4
00471       (length,) = _struct_I.unpack(str[start:end])
00472       self.goal.grasp.grasp_posture.name = []
00473       for i in range(0, length):
00474         start = end
00475         end += 4
00476         (length,) = _struct_I.unpack(str[start:end])
00477         start = end
00478         end += length
00479         if python3:
00480           val1 = str[start:end].decode('utf-8')
00481         else:
00482           val1 = str[start:end]
00483         self.goal.grasp.grasp_posture.name.append(val1)
00484       start = end
00485       end += 4
00486       (length,) = _struct_I.unpack(str[start:end])
00487       pattern = '<%sd'%length
00488       start = end
00489       end += struct.calcsize(pattern)
00490       self.goal.grasp.grasp_posture.position = struct.unpack(pattern, str[start:end])
00491       start = end
00492       end += 4
00493       (length,) = _struct_I.unpack(str[start:end])
00494       pattern = '<%sd'%length
00495       start = end
00496       end += struct.calcsize(pattern)
00497       self.goal.grasp.grasp_posture.velocity = struct.unpack(pattern, str[start:end])
00498       start = end
00499       end += 4
00500       (length,) = _struct_I.unpack(str[start:end])
00501       pattern = '<%sd'%length
00502       start = end
00503       end += struct.calcsize(pattern)
00504       self.goal.grasp.grasp_posture.effort = struct.unpack(pattern, str[start:end])
00505       _x = self
00506       start = end
00507       end += 12
00508       (_x.goal.grasp.grasp_pose.header.seq, _x.goal.grasp.grasp_pose.header.stamp.secs, _x.goal.grasp.grasp_pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00509       start = end
00510       end += 4
00511       (length,) = _struct_I.unpack(str[start:end])
00512       start = end
00513       end += length
00514       if python3:
00515         self.goal.grasp.grasp_pose.header.frame_id = str[start:end].decode('utf-8')
00516       else:
00517         self.goal.grasp.grasp_pose.header.frame_id = str[start:end]
00518       _x = self
00519       start = end
00520       end += 76
00521       (_x.goal.grasp.grasp_pose.pose.position.x, _x.goal.grasp.grasp_pose.pose.position.y, _x.goal.grasp.grasp_pose.pose.position.z, _x.goal.grasp.grasp_pose.pose.orientation.x, _x.goal.grasp.grasp_pose.pose.orientation.y, _x.goal.grasp.grasp_pose.pose.orientation.z, _x.goal.grasp.grasp_pose.pose.orientation.w, _x.goal.grasp.grasp_quality, _x.goal.grasp.approach.direction.header.seq, _x.goal.grasp.approach.direction.header.stamp.secs, _x.goal.grasp.approach.direction.header.stamp.nsecs,) = _struct_8d3I.unpack(str[start:end])
00522       start = end
00523       end += 4
00524       (length,) = _struct_I.unpack(str[start:end])
00525       start = end
00526       end += length
00527       if python3:
00528         self.goal.grasp.approach.direction.header.frame_id = str[start:end].decode('utf-8')
00529       else:
00530         self.goal.grasp.approach.direction.header.frame_id = str[start:end]
00531       _x = self
00532       start = end
00533       end += 44
00534       (_x.goal.grasp.approach.direction.vector.x, _x.goal.grasp.approach.direction.vector.y, _x.goal.grasp.approach.direction.vector.z, _x.goal.grasp.approach.desired_distance, _x.goal.grasp.approach.min_distance, _x.goal.grasp.retreat.direction.header.seq, _x.goal.grasp.retreat.direction.header.stamp.secs, _x.goal.grasp.retreat.direction.header.stamp.nsecs,) = _struct_3d2f3I.unpack(str[start:end])
00535       start = end
00536       end += 4
00537       (length,) = _struct_I.unpack(str[start:end])
00538       start = end
00539       end += length
00540       if python3:
00541         self.goal.grasp.retreat.direction.header.frame_id = str[start:end].decode('utf-8')
00542       else:
00543         self.goal.grasp.retreat.direction.header.frame_id = str[start:end]
00544       _x = self
00545       start = end
00546       end += 36
00547       (_x.goal.grasp.retreat.direction.vector.x, _x.goal.grasp.retreat.direction.vector.y, _x.goal.grasp.retreat.direction.vector.z, _x.goal.grasp.retreat.desired_distance, _x.goal.grasp.retreat.min_distance, _x.goal.grasp.max_contact_force,) = _struct_3d3f.unpack(str[start:end])
00548       start = end
00549       end += 4
00550       (length,) = _struct_I.unpack(str[start:end])
00551       self.goal.grasp.allowed_touch_objects = []
00552       for i in range(0, length):
00553         start = end
00554         end += 4
00555         (length,) = _struct_I.unpack(str[start:end])
00556         start = end
00557         end += length
00558         if python3:
00559           val1 = str[start:end].decode('utf-8')
00560         else:
00561           val1 = str[start:end]
00562         self.goal.grasp.allowed_touch_objects.append(val1)
00563       _x = self
00564       start = end
00565       end += 8
00566       (_x.goal.goal, _x.goal.max_contact_force,) = _struct_if.unpack(str[start:end])
00567       return self
00568     except struct.error as e:
00569       raise genpy.DeserializationError(e) #most likely buffer underfill
00570 
00571 
00572   def serialize_numpy(self, buff, numpy):
00573     """
00574     serialize message with numpy array types into buffer
00575     :param buff: buffer, ``StringIO``
00576     :param numpy: numpy python module
00577     """
00578     try:
00579       _x = self
00580       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00581       _x = self.header.frame_id
00582       length = len(_x)
00583       if python3 or type(_x) == unicode:
00584         _x = _x.encode('utf-8')
00585         length = len(_x)
00586       buff.write(struct.pack('<I%ss'%length, length, _x))
00587       _x = self
00588       buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00589       _x = self.goal_id.id
00590       length = len(_x)
00591       if python3 or type(_x) == unicode:
00592         _x = _x.encode('utf-8')
00593         length = len(_x)
00594       buff.write(struct.pack('<I%ss'%length, length, _x))
00595       _x = self.goal.grasp.id
00596       length = len(_x)
00597       if python3 or type(_x) == unicode:
00598         _x = _x.encode('utf-8')
00599         length = len(_x)
00600       buff.write(struct.pack('<I%ss'%length, length, _x))
00601       _x = self
00602       buff.write(_struct_3I.pack(_x.goal.grasp.pre_grasp_posture.header.seq, _x.goal.grasp.pre_grasp_posture.header.stamp.secs, _x.goal.grasp.pre_grasp_posture.header.stamp.nsecs))
00603       _x = self.goal.grasp.pre_grasp_posture.header.frame_id
00604       length = len(_x)
00605       if python3 or type(_x) == unicode:
00606         _x = _x.encode('utf-8')
00607         length = len(_x)
00608       buff.write(struct.pack('<I%ss'%length, length, _x))
00609       length = len(self.goal.grasp.pre_grasp_posture.name)
00610       buff.write(_struct_I.pack(length))
00611       for val1 in self.goal.grasp.pre_grasp_posture.name:
00612         length = len(val1)
00613         if python3 or type(val1) == unicode:
00614           val1 = val1.encode('utf-8')
00615           length = len(val1)
00616         buff.write(struct.pack('<I%ss'%length, length, val1))
00617       length = len(self.goal.grasp.pre_grasp_posture.position)
00618       buff.write(_struct_I.pack(length))
00619       pattern = '<%sd'%length
00620       buff.write(self.goal.grasp.pre_grasp_posture.position.tostring())
00621       length = len(self.goal.grasp.pre_grasp_posture.velocity)
00622       buff.write(_struct_I.pack(length))
00623       pattern = '<%sd'%length
00624       buff.write(self.goal.grasp.pre_grasp_posture.velocity.tostring())
00625       length = len(self.goal.grasp.pre_grasp_posture.effort)
00626       buff.write(_struct_I.pack(length))
00627       pattern = '<%sd'%length
00628       buff.write(self.goal.grasp.pre_grasp_posture.effort.tostring())
00629       _x = self
00630       buff.write(_struct_3I.pack(_x.goal.grasp.grasp_posture.header.seq, _x.goal.grasp.grasp_posture.header.stamp.secs, _x.goal.grasp.grasp_posture.header.stamp.nsecs))
00631       _x = self.goal.grasp.grasp_posture.header.frame_id
00632       length = len(_x)
00633       if python3 or type(_x) == unicode:
00634         _x = _x.encode('utf-8')
00635         length = len(_x)
00636       buff.write(struct.pack('<I%ss'%length, length, _x))
00637       length = len(self.goal.grasp.grasp_posture.name)
00638       buff.write(_struct_I.pack(length))
00639       for val1 in self.goal.grasp.grasp_posture.name:
00640         length = len(val1)
00641         if python3 or type(val1) == unicode:
00642           val1 = val1.encode('utf-8')
00643           length = len(val1)
00644         buff.write(struct.pack('<I%ss'%length, length, val1))
00645       length = len(self.goal.grasp.grasp_posture.position)
00646       buff.write(_struct_I.pack(length))
00647       pattern = '<%sd'%length
00648       buff.write(self.goal.grasp.grasp_posture.position.tostring())
00649       length = len(self.goal.grasp.grasp_posture.velocity)
00650       buff.write(_struct_I.pack(length))
00651       pattern = '<%sd'%length
00652       buff.write(self.goal.grasp.grasp_posture.velocity.tostring())
00653       length = len(self.goal.grasp.grasp_posture.effort)
00654       buff.write(_struct_I.pack(length))
00655       pattern = '<%sd'%length
00656       buff.write(self.goal.grasp.grasp_posture.effort.tostring())
00657       _x = self
00658       buff.write(_struct_3I.pack(_x.goal.grasp.grasp_pose.header.seq, _x.goal.grasp.grasp_pose.header.stamp.secs, _x.goal.grasp.grasp_pose.header.stamp.nsecs))
00659       _x = self.goal.grasp.grasp_pose.header.frame_id
00660       length = len(_x)
00661       if python3 or type(_x) == unicode:
00662         _x = _x.encode('utf-8')
00663         length = len(_x)
00664       buff.write(struct.pack('<I%ss'%length, length, _x))
00665       _x = self
00666       buff.write(_struct_8d3I.pack(_x.goal.grasp.grasp_pose.pose.position.x, _x.goal.grasp.grasp_pose.pose.position.y, _x.goal.grasp.grasp_pose.pose.position.z, _x.goal.grasp.grasp_pose.pose.orientation.x, _x.goal.grasp.grasp_pose.pose.orientation.y, _x.goal.grasp.grasp_pose.pose.orientation.z, _x.goal.grasp.grasp_pose.pose.orientation.w, _x.goal.grasp.grasp_quality, _x.goal.grasp.approach.direction.header.seq, _x.goal.grasp.approach.direction.header.stamp.secs, _x.goal.grasp.approach.direction.header.stamp.nsecs))
00667       _x = self.goal.grasp.approach.direction.header.frame_id
00668       length = len(_x)
00669       if python3 or type(_x) == unicode:
00670         _x = _x.encode('utf-8')
00671         length = len(_x)
00672       buff.write(struct.pack('<I%ss'%length, length, _x))
00673       _x = self
00674       buff.write(_struct_3d2f3I.pack(_x.goal.grasp.approach.direction.vector.x, _x.goal.grasp.approach.direction.vector.y, _x.goal.grasp.approach.direction.vector.z, _x.goal.grasp.approach.desired_distance, _x.goal.grasp.approach.min_distance, _x.goal.grasp.retreat.direction.header.seq, _x.goal.grasp.retreat.direction.header.stamp.secs, _x.goal.grasp.retreat.direction.header.stamp.nsecs))
00675       _x = self.goal.grasp.retreat.direction.header.frame_id
00676       length = len(_x)
00677       if python3 or type(_x) == unicode:
00678         _x = _x.encode('utf-8')
00679         length = len(_x)
00680       buff.write(struct.pack('<I%ss'%length, length, _x))
00681       _x = self
00682       buff.write(_struct_3d3f.pack(_x.goal.grasp.retreat.direction.vector.x, _x.goal.grasp.retreat.direction.vector.y, _x.goal.grasp.retreat.direction.vector.z, _x.goal.grasp.retreat.desired_distance, _x.goal.grasp.retreat.min_distance, _x.goal.grasp.max_contact_force))
00683       length = len(self.goal.grasp.allowed_touch_objects)
00684       buff.write(_struct_I.pack(length))
00685       for val1 in self.goal.grasp.allowed_touch_objects:
00686         length = len(val1)
00687         if python3 or type(val1) == unicode:
00688           val1 = val1.encode('utf-8')
00689           length = len(val1)
00690         buff.write(struct.pack('<I%ss'%length, length, val1))
00691       _x = self
00692       buff.write(_struct_if.pack(_x.goal.goal, _x.goal.max_contact_force))
00693     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00694     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00695 
00696   def deserialize_numpy(self, str, numpy):
00697     """
00698     unpack serialized message in str into this message instance using numpy for array types
00699     :param str: byte array of serialized message, ``str``
00700     :param numpy: numpy python module
00701     """
00702     try:
00703       if self.header is None:
00704         self.header = std_msgs.msg.Header()
00705       if self.goal_id is None:
00706         self.goal_id = actionlib_msgs.msg.GoalID()
00707       if self.goal is None:
00708         self.goal = object_manipulation_msgs.msg.GraspHandPostureExecutionGoal()
00709       end = 0
00710       _x = self
00711       start = end
00712       end += 12
00713       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00714       start = end
00715       end += 4
00716       (length,) = _struct_I.unpack(str[start:end])
00717       start = end
00718       end += length
00719       if python3:
00720         self.header.frame_id = str[start:end].decode('utf-8')
00721       else:
00722         self.header.frame_id = str[start:end]
00723       _x = self
00724       start = end
00725       end += 8
00726       (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00727       start = end
00728       end += 4
00729       (length,) = _struct_I.unpack(str[start:end])
00730       start = end
00731       end += length
00732       if python3:
00733         self.goal_id.id = str[start:end].decode('utf-8')
00734       else:
00735         self.goal_id.id = str[start:end]
00736       start = end
00737       end += 4
00738       (length,) = _struct_I.unpack(str[start:end])
00739       start = end
00740       end += length
00741       if python3:
00742         self.goal.grasp.id = str[start:end].decode('utf-8')
00743       else:
00744         self.goal.grasp.id = str[start:end]
00745       _x = self
00746       start = end
00747       end += 12
00748       (_x.goal.grasp.pre_grasp_posture.header.seq, _x.goal.grasp.pre_grasp_posture.header.stamp.secs, _x.goal.grasp.pre_grasp_posture.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00749       start = end
00750       end += 4
00751       (length,) = _struct_I.unpack(str[start:end])
00752       start = end
00753       end += length
00754       if python3:
00755         self.goal.grasp.pre_grasp_posture.header.frame_id = str[start:end].decode('utf-8')
00756       else:
00757         self.goal.grasp.pre_grasp_posture.header.frame_id = str[start:end]
00758       start = end
00759       end += 4
00760       (length,) = _struct_I.unpack(str[start:end])
00761       self.goal.grasp.pre_grasp_posture.name = []
00762       for i in range(0, length):
00763         start = end
00764         end += 4
00765         (length,) = _struct_I.unpack(str[start:end])
00766         start = end
00767         end += length
00768         if python3:
00769           val1 = str[start:end].decode('utf-8')
00770         else:
00771           val1 = str[start:end]
00772         self.goal.grasp.pre_grasp_posture.name.append(val1)
00773       start = end
00774       end += 4
00775       (length,) = _struct_I.unpack(str[start:end])
00776       pattern = '<%sd'%length
00777       start = end
00778       end += struct.calcsize(pattern)
00779       self.goal.grasp.pre_grasp_posture.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00780       start = end
00781       end += 4
00782       (length,) = _struct_I.unpack(str[start:end])
00783       pattern = '<%sd'%length
00784       start = end
00785       end += struct.calcsize(pattern)
00786       self.goal.grasp.pre_grasp_posture.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00787       start = end
00788       end += 4
00789       (length,) = _struct_I.unpack(str[start:end])
00790       pattern = '<%sd'%length
00791       start = end
00792       end += struct.calcsize(pattern)
00793       self.goal.grasp.pre_grasp_posture.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00794       _x = self
00795       start = end
00796       end += 12
00797       (_x.goal.grasp.grasp_posture.header.seq, _x.goal.grasp.grasp_posture.header.stamp.secs, _x.goal.grasp.grasp_posture.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00798       start = end
00799       end += 4
00800       (length,) = _struct_I.unpack(str[start:end])
00801       start = end
00802       end += length
00803       if python3:
00804         self.goal.grasp.grasp_posture.header.frame_id = str[start:end].decode('utf-8')
00805       else:
00806         self.goal.grasp.grasp_posture.header.frame_id = str[start:end]
00807       start = end
00808       end += 4
00809       (length,) = _struct_I.unpack(str[start:end])
00810       self.goal.grasp.grasp_posture.name = []
00811       for i in range(0, length):
00812         start = end
00813         end += 4
00814         (length,) = _struct_I.unpack(str[start:end])
00815         start = end
00816         end += length
00817         if python3:
00818           val1 = str[start:end].decode('utf-8')
00819         else:
00820           val1 = str[start:end]
00821         self.goal.grasp.grasp_posture.name.append(val1)
00822       start = end
00823       end += 4
00824       (length,) = _struct_I.unpack(str[start:end])
00825       pattern = '<%sd'%length
00826       start = end
00827       end += struct.calcsize(pattern)
00828       self.goal.grasp.grasp_posture.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00829       start = end
00830       end += 4
00831       (length,) = _struct_I.unpack(str[start:end])
00832       pattern = '<%sd'%length
00833       start = end
00834       end += struct.calcsize(pattern)
00835       self.goal.grasp.grasp_posture.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00836       start = end
00837       end += 4
00838       (length,) = _struct_I.unpack(str[start:end])
00839       pattern = '<%sd'%length
00840       start = end
00841       end += struct.calcsize(pattern)
00842       self.goal.grasp.grasp_posture.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00843       _x = self
00844       start = end
00845       end += 12
00846       (_x.goal.grasp.grasp_pose.header.seq, _x.goal.grasp.grasp_pose.header.stamp.secs, _x.goal.grasp.grasp_pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00847       start = end
00848       end += 4
00849       (length,) = _struct_I.unpack(str[start:end])
00850       start = end
00851       end += length
00852       if python3:
00853         self.goal.grasp.grasp_pose.header.frame_id = str[start:end].decode('utf-8')
00854       else:
00855         self.goal.grasp.grasp_pose.header.frame_id = str[start:end]
00856       _x = self
00857       start = end
00858       end += 76
00859       (_x.goal.grasp.grasp_pose.pose.position.x, _x.goal.grasp.grasp_pose.pose.position.y, _x.goal.grasp.grasp_pose.pose.position.z, _x.goal.grasp.grasp_pose.pose.orientation.x, _x.goal.grasp.grasp_pose.pose.orientation.y, _x.goal.grasp.grasp_pose.pose.orientation.z, _x.goal.grasp.grasp_pose.pose.orientation.w, _x.goal.grasp.grasp_quality, _x.goal.grasp.approach.direction.header.seq, _x.goal.grasp.approach.direction.header.stamp.secs, _x.goal.grasp.approach.direction.header.stamp.nsecs,) = _struct_8d3I.unpack(str[start:end])
00860       start = end
00861       end += 4
00862       (length,) = _struct_I.unpack(str[start:end])
00863       start = end
00864       end += length
00865       if python3:
00866         self.goal.grasp.approach.direction.header.frame_id = str[start:end].decode('utf-8')
00867       else:
00868         self.goal.grasp.approach.direction.header.frame_id = str[start:end]
00869       _x = self
00870       start = end
00871       end += 44
00872       (_x.goal.grasp.approach.direction.vector.x, _x.goal.grasp.approach.direction.vector.y, _x.goal.grasp.approach.direction.vector.z, _x.goal.grasp.approach.desired_distance, _x.goal.grasp.approach.min_distance, _x.goal.grasp.retreat.direction.header.seq, _x.goal.grasp.retreat.direction.header.stamp.secs, _x.goal.grasp.retreat.direction.header.stamp.nsecs,) = _struct_3d2f3I.unpack(str[start:end])
00873       start = end
00874       end += 4
00875       (length,) = _struct_I.unpack(str[start:end])
00876       start = end
00877       end += length
00878       if python3:
00879         self.goal.grasp.retreat.direction.header.frame_id = str[start:end].decode('utf-8')
00880       else:
00881         self.goal.grasp.retreat.direction.header.frame_id = str[start:end]
00882       _x = self
00883       start = end
00884       end += 36
00885       (_x.goal.grasp.retreat.direction.vector.x, _x.goal.grasp.retreat.direction.vector.y, _x.goal.grasp.retreat.direction.vector.z, _x.goal.grasp.retreat.desired_distance, _x.goal.grasp.retreat.min_distance, _x.goal.grasp.max_contact_force,) = _struct_3d3f.unpack(str[start:end])
00886       start = end
00887       end += 4
00888       (length,) = _struct_I.unpack(str[start:end])
00889       self.goal.grasp.allowed_touch_objects = []
00890       for i in range(0, length):
00891         start = end
00892         end += 4
00893         (length,) = _struct_I.unpack(str[start:end])
00894         start = end
00895         end += length
00896         if python3:
00897           val1 = str[start:end].decode('utf-8')
00898         else:
00899           val1 = str[start:end]
00900         self.goal.grasp.allowed_touch_objects.append(val1)
00901       _x = self
00902       start = end
00903       end += 8
00904       (_x.goal.goal, _x.goal.max_contact_force,) = _struct_if.unpack(str[start:end])
00905       return self
00906     except struct.error as e:
00907       raise genpy.DeserializationError(e) #most likely buffer underfill
00908 
00909 _struct_I = genpy.struct_I
00910 _struct_8d3I = struct.Struct("<8d3I")
00911 _struct_3d3f = struct.Struct("<3d3f")
00912 _struct_3I = struct.Struct("<3I")
00913 _struct_3d2f3I = struct.Struct("<3d2f3I")
00914 _struct_2I = struct.Struct("<2I")
00915 _struct_if = struct.Struct("<if")


object_manipulation_msgs
Author(s): Matei Ciocarlie
autogenerated on Mon Oct 6 2014 02:58:11