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


pr2_gripper_sensor_msgs
Author(s): Joe Romano
autogenerated on Mon Oct 6 2014 12:17:32