$search
00001 """autogenerated by genmsg_py from cop_camera_mode.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class cop_camera_mode(roslib.message.Message): 00007 _md5sum = "238c3e19ca5f691ca2ef2dd46e1bb593" 00008 _type = "vision_msgs/cop_camera_mode" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """string VERY_DARK_ENVIRONMENT=VeryDarkEnvironment 00011 string DARK_ENVIRONMENT=DarkEnvironment 00012 string AVERAGE_ENVIRONMENT=AverageEnvironment 00013 string BRIGHT_ENVIRONMENT=BrightEnvironment 00014 00015 string mode # switches camera to different environment modes 00016 """ 00017 # Pseudo-constants 00018 VERY_DARK_ENVIRONMENT = 'VeryDarkEnvironment' 00019 DARK_ENVIRONMENT = 'DarkEnvironment' 00020 AVERAGE_ENVIRONMENT = 'AverageEnvironment' 00021 BRIGHT_ENVIRONMENT = 'BrightEnvironment' 00022 00023 __slots__ = ['mode'] 00024 _slot_types = ['string'] 00025 00026 def __init__(self, *args, **kwds): 00027 """ 00028 Constructor. Any message fields that are implicitly/explicitly 00029 set to None will be assigned a default value. The recommend 00030 use is keyword arguments as this is more robust to future message 00031 changes. You cannot mix in-order arguments and keyword arguments. 00032 00033 The available fields are: 00034 mode 00035 00036 @param args: complete set of field values, in .msg order 00037 @param kwds: use keyword arguments corresponding to message field names 00038 to set specific fields. 00039 """ 00040 if args or kwds: 00041 super(cop_camera_mode, self).__init__(*args, **kwds) 00042 #message fields cannot be None, assign default values for those that are 00043 if self.mode is None: 00044 self.mode = '' 00045 else: 00046 self.mode = '' 00047 00048 def _get_types(self): 00049 """ 00050 internal API method 00051 """ 00052 return self._slot_types 00053 00054 def serialize(self, buff): 00055 """ 00056 serialize message into buffer 00057 @param buff: buffer 00058 @type buff: StringIO 00059 """ 00060 try: 00061 _x = self.mode 00062 length = len(_x) 00063 buff.write(struct.pack('<I%ss'%length, length, _x)) 00064 except struct.error as se: self._check_types(se) 00065 except TypeError as te: self._check_types(te) 00066 00067 def deserialize(self, str): 00068 """ 00069 unpack serialized message in str into this message instance 00070 @param str: byte array of serialized message 00071 @type str: str 00072 """ 00073 try: 00074 end = 0 00075 start = end 00076 end += 4 00077 (length,) = _struct_I.unpack(str[start:end]) 00078 start = end 00079 end += length 00080 self.mode = str[start:end] 00081 return self 00082 except struct.error as e: 00083 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00084 00085 00086 def serialize_numpy(self, buff, numpy): 00087 """ 00088 serialize message with numpy array types into buffer 00089 @param buff: buffer 00090 @type buff: StringIO 00091 @param numpy: numpy python module 00092 @type numpy module 00093 """ 00094 try: 00095 _x = self.mode 00096 length = len(_x) 00097 buff.write(struct.pack('<I%ss'%length, length, _x)) 00098 except struct.error as se: self._check_types(se) 00099 except TypeError as te: self._check_types(te) 00100 00101 def deserialize_numpy(self, str, numpy): 00102 """ 00103 unpack serialized message in str into this message instance using numpy for array types 00104 @param str: byte array of serialized message 00105 @type str: str 00106 @param numpy: numpy python module 00107 @type numpy: module 00108 """ 00109 try: 00110 end = 0 00111 start = end 00112 end += 4 00113 (length,) = _struct_I.unpack(str[start:end]) 00114 start = end 00115 end += length 00116 self.mode = str[start:end] 00117 return self 00118 except struct.error as e: 00119 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00120 00121 _struct_I = roslib.message.struct_I