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