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