_PR2GripperGrabGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperGrabGoal.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 PR2GripperGrabGoal(genpy.Message):
00010   _md5sum = "4dec90ce1cb7519ca39577ac65441112"
00011   _type = "pr2_gripper_sensor_msgs/PR2GripperGrabGoal"
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 #goal
00015 PR2GripperGrabCommand command
00016 
00017 ================================================================================
00018 MSG: pr2_gripper_sensor_msgs/PR2GripperGrabCommand
00019 # The gain to use to evaluate how hard an object should be
00020 # grasped after it is contacted. This is based on hardness
00021 # estimation as outlined in TRO paper (see wiki).
00022 # 
00023 # Try 0.03
00024 #
00025 # Units (N/(m/s^2))
00026 float64 hardness_gain
00027 
00028 """
00029   __slots__ = ['command']
00030   _slot_types = ['pr2_gripper_sensor_msgs/PR2GripperGrabCommand']
00031 
00032   def __init__(self, *args, **kwds):
00033     """
00034     Constructor. Any message fields that are implicitly/explicitly
00035     set to None will be assigned a default value. The recommend
00036     use is keyword arguments as this is more robust to future message
00037     changes.  You cannot mix in-order arguments and keyword arguments.
00038 
00039     The available fields are:
00040        command
00041 
00042     :param args: complete set of field values, in .msg order
00043     :param kwds: use keyword arguments corresponding to message field names
00044     to set specific fields.
00045     """
00046     if args or kwds:
00047       super(PR2GripperGrabGoal, self).__init__(*args, **kwds)
00048       #message fields cannot be None, assign default values for those that are
00049       if self.command is None:
00050         self.command = pr2_gripper_sensor_msgs.msg.PR2GripperGrabCommand()
00051     else:
00052       self.command = pr2_gripper_sensor_msgs.msg.PR2GripperGrabCommand()
00053 
00054   def _get_types(self):
00055     """
00056     internal API method
00057     """
00058     return self._slot_types
00059 
00060   def serialize(self, buff):
00061     """
00062     serialize message into buffer
00063     :param buff: buffer, ``StringIO``
00064     """
00065     try:
00066       buff.write(_struct_d.pack(self.command.hardness_gain))
00067     except struct.error as se: self._check_types(se)
00068     except TypeError as te: self._check_types(te)
00069 
00070   def deserialize(self, str):
00071     """
00072     unpack serialized message in str into this message instance
00073     :param str: byte array of serialized message, ``str``
00074     """
00075     try:
00076       if self.command is None:
00077         self.command = pr2_gripper_sensor_msgs.msg.PR2GripperGrabCommand()
00078       end = 0
00079       start = end
00080       end += 8
00081       (self.command.hardness_gain,) = _struct_d.unpack(str[start:end])
00082       return self
00083     except struct.error as e:
00084       raise genpy.DeserializationError(e) #most likely buffer underfill
00085 
00086 
00087   def serialize_numpy(self, buff, numpy):
00088     """
00089     serialize message with numpy array types into buffer
00090     :param buff: buffer, ``StringIO``
00091     :param numpy: numpy python module
00092     """
00093     try:
00094       buff.write(_struct_d.pack(self.command.hardness_gain))
00095     except struct.error as se: self._check_types(se)
00096     except TypeError as te: self._check_types(te)
00097 
00098   def deserialize_numpy(self, str, numpy):
00099     """
00100     unpack serialized message in str into this message instance using numpy for array types
00101     :param str: byte array of serialized message, ``str``
00102     :param numpy: numpy python module
00103     """
00104     try:
00105       if self.command is None:
00106         self.command = pr2_gripper_sensor_msgs.msg.PR2GripperGrabCommand()
00107       end = 0
00108       start = end
00109       end += 8
00110       (self.command.hardness_gain,) = _struct_d.unpack(str[start:end])
00111       return self
00112     except struct.error as e:
00113       raise genpy.DeserializationError(e) #most likely buffer underfill
00114 
00115 _struct_I = genpy.struct_I
00116 _struct_d = struct.Struct("<d")


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