00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperReleaseActionGoal.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 PR2GripperReleaseActionGoal(genpy.Message):
00013 _md5sum = "e5f06f3717f8990527330a2e0eaa0c81"
00014 _type = "pr2_gripper_sensor_msgs/PR2GripperReleaseActionGoal"
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 PR2GripperReleaseGoal 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/PR2GripperReleaseGoal
00055 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00056 #goal
00057 PR2GripperReleaseCommand command
00058
00059 ================================================================================
00060 MSG: pr2_gripper_sensor_msgs/PR2GripperReleaseCommand
00061 # the event conditions we would like to trigger the robot to release on
00062 PR2GripperEventDetectorCommand event
00063 ================================================================================
00064 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorCommand
00065 # state variable that defines what events we would like to trigger on
00066 # Leaving this field blank will result in the robot triggering when
00067 # anything touches the sides of the finger or an impact is detected
00068 # with the hand/arm.
00069 int8 trigger_conditions
00070 # definitions for our various trigger_conditions values
00071 # trigger on either acceleration contact or finger sensor side impact
00072 int8 FINGER_SIDE_IMPACT_OR_ACC = 0
00073 # tigger once both slip and acceleration signals occur
00074 int8 SLIP_AND_ACC = 1
00075 # trigger on either slip, acceleration, or finger sensor side impact
00076 int8 FINGER_SIDE_IMPACT_OR_SLIP_OR_ACC = 2
00077 # trigger only on slip information
00078 int8 SLIP = 3
00079 # trigger only on acceleration contact information
00080 int8 ACC = 4
00081
00082
00083 # the amount of acceleration to trigger on (acceleration vector magnitude)
00084 # Units = m/s^2
00085 # The user needs to be concerned here about not setting the trigger too
00086 # low so that is set off by the robot's own motions.
00087 #
00088 # For large rapid motions, say by a motion planner, 5 m/s^2 is a good level
00089 # For small delicate controlled motions this can be set MUCH lower (try 2.0)
00090 #
00091 # NOTE: When moving the gripper joint (opening/closing the grippr)
00092 # the high gearing of the PR2 gripper causes large acceleration vibrations
00093 # which will cause triggering to occur. This is a known drawback of the PR2.
00094 #
00095 # NOTE: Leaving this value blank will result in a 0 m/s^2 trigger. If you
00096 # are using a trigger_conditions value that returns on acceleration contact
00097 # events then it will immediately exceed your trigger and return
00098 float64 acceleration_trigger_magnitude
00099
00100
00101 # the slip detector gain to trigger on (either finger) : try 0.01
00102 # higher values decrease slip sensitivty (to a point)
00103 # lower values increase sensitivity (to a point)
00104 #
00105 # NOTE: Leaving this value blank will result in the most sensitive slip level.
00106 float64 slip_trigger_magnitude
00107 """
00108 __slots__ = ['header','goal_id','goal']
00109 _slot_types = ['std_msgs/Header','actionlib_msgs/GoalID','pr2_gripper_sensor_msgs/PR2GripperReleaseGoal']
00110
00111 def __init__(self, *args, **kwds):
00112 """
00113 Constructor. Any message fields that are implicitly/explicitly
00114 set to None will be assigned a default value. The recommend
00115 use is keyword arguments as this is more robust to future message
00116 changes. You cannot mix in-order arguments and keyword arguments.
00117
00118 The available fields are:
00119 header,goal_id,goal
00120
00121 :param args: complete set of field values, in .msg order
00122 :param kwds: use keyword arguments corresponding to message field names
00123 to set specific fields.
00124 """
00125 if args or kwds:
00126 super(PR2GripperReleaseActionGoal, self).__init__(*args, **kwds)
00127
00128 if self.header is None:
00129 self.header = std_msgs.msg.Header()
00130 if self.goal_id is None:
00131 self.goal_id = actionlib_msgs.msg.GoalID()
00132 if self.goal is None:
00133 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperReleaseGoal()
00134 else:
00135 self.header = std_msgs.msg.Header()
00136 self.goal_id = actionlib_msgs.msg.GoalID()
00137 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperReleaseGoal()
00138
00139 def _get_types(self):
00140 """
00141 internal API method
00142 """
00143 return self._slot_types
00144
00145 def serialize(self, buff):
00146 """
00147 serialize message into buffer
00148 :param buff: buffer, ``StringIO``
00149 """
00150 try:
00151 _x = self
00152 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00153 _x = self.header.frame_id
00154 length = len(_x)
00155 if python3 or type(_x) == unicode:
00156 _x = _x.encode('utf-8')
00157 length = len(_x)
00158 buff.write(struct.pack('<I%ss'%length, length, _x))
00159 _x = self
00160 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00161 _x = self.goal_id.id
00162 length = len(_x)
00163 if python3 or type(_x) == unicode:
00164 _x = _x.encode('utf-8')
00165 length = len(_x)
00166 buff.write(struct.pack('<I%ss'%length, length, _x))
00167 _x = self
00168 buff.write(_struct_b2d.pack(_x.goal.command.event.trigger_conditions, _x.goal.command.event.acceleration_trigger_magnitude, _x.goal.command.event.slip_trigger_magnitude))
00169 except struct.error as se: self._check_types(se)
00170 except TypeError as te: self._check_types(te)
00171
00172 def deserialize(self, str):
00173 """
00174 unpack serialized message in str into this message instance
00175 :param str: byte array of serialized message, ``str``
00176 """
00177 try:
00178 if self.header is None:
00179 self.header = std_msgs.msg.Header()
00180 if self.goal_id is None:
00181 self.goal_id = actionlib_msgs.msg.GoalID()
00182 if self.goal is None:
00183 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperReleaseGoal()
00184 end = 0
00185 _x = self
00186 start = end
00187 end += 12
00188 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00189 start = end
00190 end += 4
00191 (length,) = _struct_I.unpack(str[start:end])
00192 start = end
00193 end += length
00194 if python3:
00195 self.header.frame_id = str[start:end].decode('utf-8')
00196 else:
00197 self.header.frame_id = str[start:end]
00198 _x = self
00199 start = end
00200 end += 8
00201 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00202 start = end
00203 end += 4
00204 (length,) = _struct_I.unpack(str[start:end])
00205 start = end
00206 end += length
00207 if python3:
00208 self.goal_id.id = str[start:end].decode('utf-8')
00209 else:
00210 self.goal_id.id = str[start:end]
00211 _x = self
00212 start = end
00213 end += 17
00214 (_x.goal.command.event.trigger_conditions, _x.goal.command.event.acceleration_trigger_magnitude, _x.goal.command.event.slip_trigger_magnitude,) = _struct_b2d.unpack(str[start:end])
00215 return self
00216 except struct.error as e:
00217 raise genpy.DeserializationError(e)
00218
00219
00220 def serialize_numpy(self, buff, numpy):
00221 """
00222 serialize message with numpy array types into buffer
00223 :param buff: buffer, ``StringIO``
00224 :param numpy: numpy python module
00225 """
00226 try:
00227 _x = self
00228 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00229 _x = self.header.frame_id
00230 length = len(_x)
00231 if python3 or type(_x) == unicode:
00232 _x = _x.encode('utf-8')
00233 length = len(_x)
00234 buff.write(struct.pack('<I%ss'%length, length, _x))
00235 _x = self
00236 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00237 _x = self.goal_id.id
00238 length = len(_x)
00239 if python3 or type(_x) == unicode:
00240 _x = _x.encode('utf-8')
00241 length = len(_x)
00242 buff.write(struct.pack('<I%ss'%length, length, _x))
00243 _x = self
00244 buff.write(_struct_b2d.pack(_x.goal.command.event.trigger_conditions, _x.goal.command.event.acceleration_trigger_magnitude, _x.goal.command.event.slip_trigger_magnitude))
00245 except struct.error as se: self._check_types(se)
00246 except TypeError as te: self._check_types(te)
00247
00248 def deserialize_numpy(self, str, numpy):
00249 """
00250 unpack serialized message in str into this message instance using numpy for array types
00251 :param str: byte array of serialized message, ``str``
00252 :param numpy: numpy python module
00253 """
00254 try:
00255 if self.header is None:
00256 self.header = std_msgs.msg.Header()
00257 if self.goal_id is None:
00258 self.goal_id = actionlib_msgs.msg.GoalID()
00259 if self.goal is None:
00260 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperReleaseGoal()
00261 end = 0
00262 _x = self
00263 start = end
00264 end += 12
00265 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00266 start = end
00267 end += 4
00268 (length,) = _struct_I.unpack(str[start:end])
00269 start = end
00270 end += length
00271 if python3:
00272 self.header.frame_id = str[start:end].decode('utf-8')
00273 else:
00274 self.header.frame_id = str[start:end]
00275 _x = self
00276 start = end
00277 end += 8
00278 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00279 start = end
00280 end += 4
00281 (length,) = _struct_I.unpack(str[start:end])
00282 start = end
00283 end += length
00284 if python3:
00285 self.goal_id.id = str[start:end].decode('utf-8')
00286 else:
00287 self.goal_id.id = str[start:end]
00288 _x = self
00289 start = end
00290 end += 17
00291 (_x.goal.command.event.trigger_conditions, _x.goal.command.event.acceleration_trigger_magnitude, _x.goal.command.event.slip_trigger_magnitude,) = _struct_b2d.unpack(str[start:end])
00292 return self
00293 except struct.error as e:
00294 raise genpy.DeserializationError(e)
00295
00296 _struct_I = genpy.struct_I
00297 _struct_3I = struct.Struct("<3I")
00298 _struct_b2d = struct.Struct("<b2d")
00299 _struct_2I = struct.Struct("<2I")