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


pr2_gripper_sensor_msgs
Author(s): Joe Romano
autogenerated on Fri Jan 3 2014 11:52:58