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