$search
00001 """autogenerated by genmsg_py from Graph.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 00007 class Graph(roslib.message.Message): 00008 _md5sum = "743f1a12ac34ba3b239c8646ca763b86" 00009 _type = "skiller/Graph" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """byte GRAPH_DIR_LEFT_RIGHT = 1 00012 byte GRAPH_DIR_RIGHT_LEFT = 2 00013 byte GRAPH_DIR_TOP_BOTTOM = 3 00014 byte GRAPH_DIR_BOTTOM_TOP = 4 00015 time stamp 00016 string name 00017 string dotgraph 00018 byte direction 00019 bool colored 00020 00021 """ 00022 # Pseudo-constants 00023 GRAPH_DIR_LEFT_RIGHT = 1 00024 GRAPH_DIR_RIGHT_LEFT = 2 00025 GRAPH_DIR_TOP_BOTTOM = 3 00026 GRAPH_DIR_BOTTOM_TOP = 4 00027 00028 __slots__ = ['stamp','name','dotgraph','direction','colored'] 00029 _slot_types = ['time','string','string','byte','bool'] 00030 00031 def __init__(self, *args, **kwds): 00032 """ 00033 Constructor. Any message fields that are implicitly/explicitly 00034 set to None will be assigned a default value. The recommend 00035 use is keyword arguments as this is more robust to future message 00036 changes. You cannot mix in-order arguments and keyword arguments. 00037 00038 The available fields are: 00039 stamp,name,dotgraph,direction,colored 00040 00041 @param args: complete set of field values, in .msg order 00042 @param kwds: use keyword arguments corresponding to message field names 00043 to set specific fields. 00044 """ 00045 if args or kwds: 00046 super(Graph, self).__init__(*args, **kwds) 00047 #message fields cannot be None, assign default values for those that are 00048 if self.stamp is None: 00049 self.stamp = roslib.rostime.Time() 00050 if self.name is None: 00051 self.name = '' 00052 if self.dotgraph is None: 00053 self.dotgraph = '' 00054 if self.direction is None: 00055 self.direction = 0 00056 if self.colored is None: 00057 self.colored = False 00058 else: 00059 self.stamp = roslib.rostime.Time() 00060 self.name = '' 00061 self.dotgraph = '' 00062 self.direction = 0 00063 self.colored = False 00064 00065 def _get_types(self): 00066 """ 00067 internal API method 00068 """ 00069 return self._slot_types 00070 00071 def serialize(self, buff): 00072 """ 00073 serialize message into buffer 00074 @param buff: buffer 00075 @type buff: StringIO 00076 """ 00077 try: 00078 _x = self 00079 buff.write(_struct_2I.pack(_x.stamp.secs, _x.stamp.nsecs)) 00080 _x = self.name 00081 length = len(_x) 00082 buff.write(struct.pack('<I%ss'%length, length, _x)) 00083 _x = self.dotgraph 00084 length = len(_x) 00085 buff.write(struct.pack('<I%ss'%length, length, _x)) 00086 _x = self 00087 buff.write(_struct_bB.pack(_x.direction, _x.colored)) 00088 except struct.error as se: self._check_types(se) 00089 except TypeError as te: self._check_types(te) 00090 00091 def deserialize(self, str): 00092 """ 00093 unpack serialized message in str into this message instance 00094 @param str: byte array of serialized message 00095 @type str: str 00096 """ 00097 try: 00098 if self.stamp is None: 00099 self.stamp = roslib.rostime.Time() 00100 end = 0 00101 _x = self 00102 start = end 00103 end += 8 00104 (_x.stamp.secs, _x.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00105 start = end 00106 end += 4 00107 (length,) = _struct_I.unpack(str[start:end]) 00108 start = end 00109 end += length 00110 self.name = str[start:end] 00111 start = end 00112 end += 4 00113 (length,) = _struct_I.unpack(str[start:end]) 00114 start = end 00115 end += length 00116 self.dotgraph = str[start:end] 00117 _x = self 00118 start = end 00119 end += 2 00120 (_x.direction, _x.colored,) = _struct_bB.unpack(str[start:end]) 00121 self.colored = bool(self.colored) 00122 self.stamp.canon() 00123 return self 00124 except struct.error as e: 00125 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00126 00127 00128 def serialize_numpy(self, buff, numpy): 00129 """ 00130 serialize message with numpy array types into buffer 00131 @param buff: buffer 00132 @type buff: StringIO 00133 @param numpy: numpy python module 00134 @type numpy module 00135 """ 00136 try: 00137 _x = self 00138 buff.write(_struct_2I.pack(_x.stamp.secs, _x.stamp.nsecs)) 00139 _x = self.name 00140 length = len(_x) 00141 buff.write(struct.pack('<I%ss'%length, length, _x)) 00142 _x = self.dotgraph 00143 length = len(_x) 00144 buff.write(struct.pack('<I%ss'%length, length, _x)) 00145 _x = self 00146 buff.write(_struct_bB.pack(_x.direction, _x.colored)) 00147 except struct.error as se: self._check_types(se) 00148 except TypeError as te: self._check_types(te) 00149 00150 def deserialize_numpy(self, str, numpy): 00151 """ 00152 unpack serialized message in str into this message instance using numpy for array types 00153 @param str: byte array of serialized message 00154 @type str: str 00155 @param numpy: numpy python module 00156 @type numpy: module 00157 """ 00158 try: 00159 if self.stamp is None: 00160 self.stamp = roslib.rostime.Time() 00161 end = 0 00162 _x = self 00163 start = end 00164 end += 8 00165 (_x.stamp.secs, _x.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00166 start = end 00167 end += 4 00168 (length,) = _struct_I.unpack(str[start:end]) 00169 start = end 00170 end += length 00171 self.name = str[start:end] 00172 start = end 00173 end += 4 00174 (length,) = _struct_I.unpack(str[start:end]) 00175 start = end 00176 end += length 00177 self.dotgraph = str[start:end] 00178 _x = self 00179 start = end 00180 end += 2 00181 (_x.direction, _x.colored,) = _struct_bB.unpack(str[start:end]) 00182 self.colored = bool(self.colored) 00183 self.stamp.canon() 00184 return self 00185 except struct.error as e: 00186 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00187 00188 _struct_I = roslib.message.struct_I 00189 _struct_2I = struct.Struct("<2I") 00190 _struct_bB = struct.Struct("<bB")