_PR2GripperReleaseCommand.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperReleaseCommand.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 pr2_gripper_sensor_msgs.msg
00008 
00009 class PR2GripperReleaseCommand(genpy.Message):
00010   _md5sum = "e62b08129864bf301ed0a1335e6158dc"
00011   _type = "pr2_gripper_sensor_msgs/PR2GripperReleaseCommand"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# the event conditions we would like to trigger the robot to release on
00014 PR2GripperEventDetectorCommand event
00015 ================================================================================
00016 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorCommand
00017 # state variable that defines what events we would like to trigger on
00018 # Leaving this field blank will result in the robot triggering when 
00019 # anything touches the sides of the finger or an impact is detected
00020 # with the hand/arm.
00021 int8 trigger_conditions
00022 # definitions for our various trigger_conditions values
00023 # trigger on either acceleration contact or finger sensor side impact
00024 int8 FINGER_SIDE_IMPACT_OR_ACC = 0
00025 # tigger once  both slip and acceleration signals occur
00026 int8 SLIP_AND_ACC = 1 
00027 #  trigger on either slip, acceleration, or finger sensor side impact
00028 int8 FINGER_SIDE_IMPACT_OR_SLIP_OR_ACC = 2
00029 # trigger only on slip information
00030 int8 SLIP = 3
00031 # trigger only on acceleration contact information
00032 int8 ACC = 4 
00033 
00034 
00035 # the amount of acceleration to trigger on (acceleration vector magnitude)
00036 # Units = m/s^2
00037 # The user needs to be concerned here about not setting the trigger too
00038 # low so that is set off by the robot's own motions.
00039 #
00040 # For large rapid motions, say by a motion planner, 5 m/s^2 is a good level
00041 # For small delicate controlled motions this can be set MUCH lower (try 2.0)
00042 #
00043 # NOTE: When moving the gripper joint (opening/closing the grippr)
00044 # the high gearing of the PR2 gripper causes large acceleration vibrations
00045 # which will cause triggering to occur. This is a known drawback of the PR2.
00046 #
00047 # NOTE: Leaving this value blank will result in a 0 m/s^2 trigger. If you
00048 # are using a trigger_conditions value that returns on acceleration contact
00049 # events then it will immediately exceed your trigger and return
00050 float64 acceleration_trigger_magnitude
00051 
00052 
00053 # the slip detector gain to trigger on (either finger) : try 0.01
00054 # higher values decrease slip sensitivty (to a point)
00055 # lower values increase sensitivity (to a point)
00056 #
00057 # NOTE: Leaving this value blank will result in the most sensitive slip level.
00058 float64 slip_trigger_magnitude
00059 """
00060   __slots__ = ['event']
00061   _slot_types = ['pr2_gripper_sensor_msgs/PR2GripperEventDetectorCommand']
00062 
00063   def __init__(self, *args, **kwds):
00064     """
00065     Constructor. Any message fields that are implicitly/explicitly
00066     set to None will be assigned a default value. The recommend
00067     use is keyword arguments as this is more robust to future message
00068     changes.  You cannot mix in-order arguments and keyword arguments.
00069 
00070     The available fields are:
00071        event
00072 
00073     :param args: complete set of field values, in .msg order
00074     :param kwds: use keyword arguments corresponding to message field names
00075     to set specific fields.
00076     """
00077     if args or kwds:
00078       super(PR2GripperReleaseCommand, self).__init__(*args, **kwds)
00079       #message fields cannot be None, assign default values for those that are
00080       if self.event is None:
00081         self.event = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorCommand()
00082     else:
00083       self.event = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorCommand()
00084 
00085   def _get_types(self):
00086     """
00087     internal API method
00088     """
00089     return self._slot_types
00090 
00091   def serialize(self, buff):
00092     """
00093     serialize message into buffer
00094     :param buff: buffer, ``StringIO``
00095     """
00096     try:
00097       _x = self
00098       buff.write(_struct_b2d.pack(_x.event.trigger_conditions, _x.event.acceleration_trigger_magnitude, _x.event.slip_trigger_magnitude))
00099     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00100     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00101 
00102   def deserialize(self, str):
00103     """
00104     unpack serialized message in str into this message instance
00105     :param str: byte array of serialized message, ``str``
00106     """
00107     try:
00108       if self.event is None:
00109         self.event = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorCommand()
00110       end = 0
00111       _x = self
00112       start = end
00113       end += 17
00114       (_x.event.trigger_conditions, _x.event.acceleration_trigger_magnitude, _x.event.slip_trigger_magnitude,) = _struct_b2d.unpack(str[start:end])
00115       return self
00116     except struct.error as e:
00117       raise genpy.DeserializationError(e) #most likely buffer underfill
00118 
00119 
00120   def serialize_numpy(self, buff, numpy):
00121     """
00122     serialize message with numpy array types into buffer
00123     :param buff: buffer, ``StringIO``
00124     :param numpy: numpy python module
00125     """
00126     try:
00127       _x = self
00128       buff.write(_struct_b2d.pack(_x.event.trigger_conditions, _x.event.acceleration_trigger_magnitude, _x.event.slip_trigger_magnitude))
00129     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00130     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00131 
00132   def deserialize_numpy(self, str, numpy):
00133     """
00134     unpack serialized message in str into this message instance using numpy for array types
00135     :param str: byte array of serialized message, ``str``
00136     :param numpy: numpy python module
00137     """
00138     try:
00139       if self.event is None:
00140         self.event = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorCommand()
00141       end = 0
00142       _x = self
00143       start = end
00144       end += 17
00145       (_x.event.trigger_conditions, _x.event.acceleration_trigger_magnitude, _x.event.slip_trigger_magnitude,) = _struct_b2d.unpack(str[start:end])
00146       return self
00147     except struct.error as e:
00148       raise genpy.DeserializationError(e) #most likely buffer underfill
00149 
00150 _struct_I = genpy.struct_I
00151 _struct_b2d = struct.Struct("<b2d")


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