00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperGrabActionGoal.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 genpy
00008 import actionlib_msgs.msg
00009 import pr2_gripper_sensor_msgs.msg
00010 import std_msgs.msg
00011
00012 class PR2GripperGrabActionGoal(genpy.Message):
00013 _md5sum = "e540762b3e9da0e115b0380658bdbe12"
00014 _type = "pr2_gripper_sensor_msgs/PR2GripperGrabActionGoal"
00015 _has_header = True
00016 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00017
00018 Header header
00019 actionlib_msgs/GoalID goal_id
00020 PR2GripperGrabGoal goal
00021
00022 ================================================================================
00023 MSG: std_msgs/Header
00024 # Standard metadata for higher-level stamped data types.
00025 # This is generally used to communicate timestamped data
00026 # in a particular coordinate frame.
00027 #
00028 # sequence ID: consecutively increasing ID
00029 uint32 seq
00030 #Two-integer timestamp that is expressed as:
00031 # * stamp.secs: seconds (stamp_secs) since epoch
00032 # * stamp.nsecs: nanoseconds since stamp_secs
00033 # time-handling sugar is provided by the client library
00034 time stamp
00035 #Frame this data is associated with
00036 # 0: no frame
00037 # 1: global frame
00038 string frame_id
00039
00040 ================================================================================
00041 MSG: actionlib_msgs/GoalID
00042 # The stamp should store the time at which this goal was requested.
00043 # It is used by an action server when it tries to preempt all
00044 # goals that were requested before a certain time
00045 time stamp
00046
00047 # The id provides a way to associate feedback and
00048 # result message with specific goal requests. The id
00049 # specified must be unique.
00050 string id
00051
00052
00053 ================================================================================
00054 MSG: pr2_gripper_sensor_msgs/PR2GripperGrabGoal
00055 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00056 #goal
00057 PR2GripperGrabCommand command
00058
00059 ================================================================================
00060 MSG: pr2_gripper_sensor_msgs/PR2GripperGrabCommand
00061 # The gain to use to evaluate how hard an object should be
00062 # grasped after it is contacted. This is based on hardness
00063 # estimation as outlined in TRO paper (see wiki).
00064 #
00065 # Try 0.03
00066 #
00067 # Units (N/(m/s^2))
00068 float64 hardness_gain
00069
00070 """
00071 __slots__ = ['header','goal_id','goal']
00072 _slot_types = ['std_msgs/Header','actionlib_msgs/GoalID','pr2_gripper_sensor_msgs/PR2GripperGrabGoal']
00073
00074 def __init__(self, *args, **kwds):
00075 """
00076 Constructor. Any message fields that are implicitly/explicitly
00077 set to None will be assigned a default value. The recommend
00078 use is keyword arguments as this is more robust to future message
00079 changes. You cannot mix in-order arguments and keyword arguments.
00080
00081 The available fields are:
00082 header,goal_id,goal
00083
00084 :param args: complete set of field values, in .msg order
00085 :param kwds: use keyword arguments corresponding to message field names
00086 to set specific fields.
00087 """
00088 if args or kwds:
00089 super(PR2GripperGrabActionGoal, self).__init__(*args, **kwds)
00090
00091 if self.header is None:
00092 self.header = std_msgs.msg.Header()
00093 if self.goal_id is None:
00094 self.goal_id = actionlib_msgs.msg.GoalID()
00095 if self.goal is None:
00096 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperGrabGoal()
00097 else:
00098 self.header = std_msgs.msg.Header()
00099 self.goal_id = actionlib_msgs.msg.GoalID()
00100 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperGrabGoal()
00101
00102 def _get_types(self):
00103 """
00104 internal API method
00105 """
00106 return self._slot_types
00107
00108 def serialize(self, buff):
00109 """
00110 serialize message into buffer
00111 :param buff: buffer, ``StringIO``
00112 """
00113 try:
00114 _x = self
00115 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00116 _x = self.header.frame_id
00117 length = len(_x)
00118 if python3 or type(_x) == unicode:
00119 _x = _x.encode('utf-8')
00120 length = len(_x)
00121 buff.write(struct.pack('<I%ss'%length, length, _x))
00122 _x = self
00123 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00124 _x = self.goal_id.id
00125 length = len(_x)
00126 if python3 or type(_x) == unicode:
00127 _x = _x.encode('utf-8')
00128 length = len(_x)
00129 buff.write(struct.pack('<I%ss'%length, length, _x))
00130 buff.write(_struct_d.pack(self.goal.command.hardness_gain))
00131 except struct.error as se: self._check_types(se)
00132 except TypeError as te: self._check_types(te)
00133
00134 def deserialize(self, str):
00135 """
00136 unpack serialized message in str into this message instance
00137 :param str: byte array of serialized message, ``str``
00138 """
00139 try:
00140 if self.header is None:
00141 self.header = std_msgs.msg.Header()
00142 if self.goal_id is None:
00143 self.goal_id = actionlib_msgs.msg.GoalID()
00144 if self.goal is None:
00145 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperGrabGoal()
00146 end = 0
00147 _x = self
00148 start = end
00149 end += 12
00150 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00151 start = end
00152 end += 4
00153 (length,) = _struct_I.unpack(str[start:end])
00154 start = end
00155 end += length
00156 if python3:
00157 self.header.frame_id = str[start:end].decode('utf-8')
00158 else:
00159 self.header.frame_id = str[start:end]
00160 _x = self
00161 start = end
00162 end += 8
00163 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00164 start = end
00165 end += 4
00166 (length,) = _struct_I.unpack(str[start:end])
00167 start = end
00168 end += length
00169 if python3:
00170 self.goal_id.id = str[start:end].decode('utf-8')
00171 else:
00172 self.goal_id.id = str[start:end]
00173 start = end
00174 end += 8
00175 (self.goal.command.hardness_gain,) = _struct_d.unpack(str[start:end])
00176 return self
00177 except struct.error as e:
00178 raise genpy.DeserializationError(e)
00179
00180
00181 def serialize_numpy(self, buff, numpy):
00182 """
00183 serialize message with numpy array types into buffer
00184 :param buff: buffer, ``StringIO``
00185 :param numpy: numpy python module
00186 """
00187 try:
00188 _x = self
00189 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00190 _x = self.header.frame_id
00191 length = len(_x)
00192 if python3 or type(_x) == unicode:
00193 _x = _x.encode('utf-8')
00194 length = len(_x)
00195 buff.write(struct.pack('<I%ss'%length, length, _x))
00196 _x = self
00197 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00198 _x = self.goal_id.id
00199 length = len(_x)
00200 if python3 or type(_x) == unicode:
00201 _x = _x.encode('utf-8')
00202 length = len(_x)
00203 buff.write(struct.pack('<I%ss'%length, length, _x))
00204 buff.write(_struct_d.pack(self.goal.command.hardness_gain))
00205 except struct.error as se: self._check_types(se)
00206 except TypeError as te: self._check_types(te)
00207
00208 def deserialize_numpy(self, str, numpy):
00209 """
00210 unpack serialized message in str into this message instance using numpy for array types
00211 :param str: byte array of serialized message, ``str``
00212 :param numpy: numpy python module
00213 """
00214 try:
00215 if self.header is None:
00216 self.header = std_msgs.msg.Header()
00217 if self.goal_id is None:
00218 self.goal_id = actionlib_msgs.msg.GoalID()
00219 if self.goal is None:
00220 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperGrabGoal()
00221 end = 0
00222 _x = self
00223 start = end
00224 end += 12
00225 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00226 start = end
00227 end += 4
00228 (length,) = _struct_I.unpack(str[start:end])
00229 start = end
00230 end += length
00231 if python3:
00232 self.header.frame_id = str[start:end].decode('utf-8')
00233 else:
00234 self.header.frame_id = str[start:end]
00235 _x = self
00236 start = end
00237 end += 8
00238 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00239 start = end
00240 end += 4
00241 (length,) = _struct_I.unpack(str[start:end])
00242 start = end
00243 end += length
00244 if python3:
00245 self.goal_id.id = str[start:end].decode('utf-8')
00246 else:
00247 self.goal_id.id = str[start:end]
00248 start = end
00249 end += 8
00250 (self.goal.command.hardness_gain,) = _struct_d.unpack(str[start:end])
00251 return self
00252 except struct.error as e:
00253 raise genpy.DeserializationError(e)
00254
00255 _struct_I = genpy.struct_I
00256 _struct_3I = struct.Struct("<3I")
00257 _struct_2I = struct.Struct("<2I")
00258 _struct_d = struct.Struct("<d")