00001 """autogenerated by genmsg_py from CloudSettings.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class CloudSettings(roslib.message.Message):
00007 _md5sum = "b6d0a1851b3076beb1a3c9670f479de9"
00008 _type = "collision_environment_msgs/CloudSettings"
00009 _has_header = False
00010 _full_text = """string cloud_name
00011 int32 static_publish
00012 int32 dynamic_publish
00013 int32 INCLUDE = 1
00014 int32 EXCLUDE = 2
00015
00016 """
00017
00018 INCLUDE = 1
00019 EXCLUDE = 2
00020
00021 __slots__ = ['cloud_name','static_publish','dynamic_publish']
00022 _slot_types = ['string','int32','int32']
00023
00024 def __init__(self, *args, **kwds):
00025 """
00026 Constructor. Any message fields that are implicitly/explicitly
00027 set to None will be assigned a default value. The recommend
00028 use is keyword arguments as this is more robust to future message
00029 changes. You cannot mix in-order arguments and keyword arguments.
00030
00031 The available fields are:
00032 cloud_name,static_publish,dynamic_publish
00033
00034 @param args: complete set of field values, in .msg order
00035 @param kwds: use keyword arguments corresponding to message field names
00036 to set specific fields.
00037 """
00038 if args or kwds:
00039 super(CloudSettings, self).__init__(*args, **kwds)
00040
00041 if self.cloud_name is None:
00042 self.cloud_name = ''
00043 if self.static_publish is None:
00044 self.static_publish = 0
00045 if self.dynamic_publish is None:
00046 self.dynamic_publish = 0
00047 else:
00048 self.cloud_name = ''
00049 self.static_publish = 0
00050 self.dynamic_publish = 0
00051
00052 def _get_types(self):
00053 """
00054 internal API method
00055 """
00056 return self._slot_types
00057
00058 def serialize(self, buff):
00059 """
00060 serialize message into buffer
00061 @param buff: buffer
00062 @type buff: StringIO
00063 """
00064 try:
00065 _x = self.cloud_name
00066 length = len(_x)
00067 buff.write(struct.pack('<I%ss'%length, length, _x))
00068 _x = self
00069 buff.write(_struct_2i.pack(_x.static_publish, _x.dynamic_publish))
00070 except struct.error, se: self._check_types(se)
00071 except TypeError, te: self._check_types(te)
00072
00073 def deserialize(self, str):
00074 """
00075 unpack serialized message in str into this message instance
00076 @param str: byte array of serialized message
00077 @type str: str
00078 """
00079 try:
00080 end = 0
00081 start = end
00082 end += 4
00083 (length,) = _struct_I.unpack(str[start:end])
00084 start = end
00085 end += length
00086 self.cloud_name = str[start:end]
00087 _x = self
00088 start = end
00089 end += 8
00090 (_x.static_publish, _x.dynamic_publish,) = _struct_2i.unpack(str[start:end])
00091 return self
00092 except struct.error, e:
00093 raise roslib.message.DeserializationError(e)
00094
00095
00096 def serialize_numpy(self, buff, numpy):
00097 """
00098 serialize message with numpy array types into buffer
00099 @param buff: buffer
00100 @type buff: StringIO
00101 @param numpy: numpy python module
00102 @type numpy module
00103 """
00104 try:
00105 _x = self.cloud_name
00106 length = len(_x)
00107 buff.write(struct.pack('<I%ss'%length, length, _x))
00108 _x = self
00109 buff.write(_struct_2i.pack(_x.static_publish, _x.dynamic_publish))
00110 except struct.error, se: self._check_types(se)
00111 except TypeError, te: self._check_types(te)
00112
00113 def deserialize_numpy(self, str, numpy):
00114 """
00115 unpack serialized message in str into this message instance using numpy for array types
00116 @param str: byte array of serialized message
00117 @type str: str
00118 @param numpy: numpy python module
00119 @type numpy: module
00120 """
00121 try:
00122 end = 0
00123 start = end
00124 end += 4
00125 (length,) = _struct_I.unpack(str[start:end])
00126 start = end
00127 end += length
00128 self.cloud_name = str[start:end]
00129 _x = self
00130 start = end
00131 end += 8
00132 (_x.static_publish, _x.dynamic_publish,) = _struct_2i.unpack(str[start:end])
00133 return self
00134 except struct.error, e:
00135 raise roslib.message.DeserializationError(e)
00136
00137 _struct_I = roslib.message.struct_I
00138 _struct_2i = struct.Struct("<2i")