_PR2GripperSensorRTState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperSensorRTState.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class PR2GripperSensorRTState(genpy.Message):
00009   _md5sum = "8109436c1f7237c52c00d885ed5755d7"
00010   _type = "pr2_gripper_sensor_msgs/PR2GripperSensorRTState"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# the control state of our realtime controller
00013 int8 realtime_controller_state
00014 
00015 # predefined values to indicate our realtime_controller_state
00016 int8 DISABLED = 0
00017 int8 POSITION_SERVO = 3
00018 int8 FORCE_SERVO = 4
00019 int8 FIND_CONTACT = 5
00020 int8 SLIP_SERVO = 6
00021 """
00022   # Pseudo-constants
00023   DISABLED = 0
00024   POSITION_SERVO = 3
00025   FORCE_SERVO = 4
00026   FIND_CONTACT = 5
00027   SLIP_SERVO = 6
00028 
00029   __slots__ = ['realtime_controller_state']
00030   _slot_types = ['int8']
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        realtime_controller_state
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(PR2GripperSensorRTState, self).__init__(*args, **kwds)
00048       #message fields cannot be None, assign default values for those that are
00049       if self.realtime_controller_state is None:
00050         self.realtime_controller_state = 0
00051     else:
00052       self.realtime_controller_state = 0
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_b.pack(self.realtime_controller_state))
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       end = 0
00077       start = end
00078       end += 1
00079       (self.realtime_controller_state,) = _struct_b.unpack(str[start:end])
00080       return self
00081     except struct.error as e:
00082       raise genpy.DeserializationError(e) #most likely buffer underfill
00083 
00084 
00085   def serialize_numpy(self, buff, numpy):
00086     """
00087     serialize message with numpy array types into buffer
00088     :param buff: buffer, ``StringIO``
00089     :param numpy: numpy python module
00090     """
00091     try:
00092       buff.write(_struct_b.pack(self.realtime_controller_state))
00093     except struct.error as se: self._check_types(se)
00094     except TypeError as te: self._check_types(te)
00095 
00096   def deserialize_numpy(self, str, numpy):
00097     """
00098     unpack serialized message in str into this message instance using numpy for array types
00099     :param str: byte array of serialized message, ``str``
00100     :param numpy: numpy python module
00101     """
00102     try:
00103       end = 0
00104       start = end
00105       end += 1
00106       (self.realtime_controller_state,) = _struct_b.unpack(str[start:end])
00107       return self
00108     except struct.error as e:
00109       raise genpy.DeserializationError(e) #most likely buffer underfill
00110 
00111 _struct_I = genpy.struct_I
00112 _struct_b = struct.Struct("<b")


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