Package network_monitor_udp :: Package msg :: Module _LinktestActionResult
[frames] | no frames]

Source Code for Module network_monitor_udp.msg._LinktestActionResult

  1  """autogenerated by genpy from network_monitor_udp/LinktestActionResult.msg. Do not edit.""" 
  2  import sys 
  3  python3 = True if sys.hexversion > 0x03000000 else False 
  4  import genpy 
  5  import struct 
  6   
  7  import network_monitor_udp.msg 
  8  import genpy 
  9  import actionlib_msgs.msg 
 10  import std_msgs.msg 
 11   
12 -class LinktestActionResult(genpy.Message):
13 _md5sum = "68fbd44062fcb0a381155a2ce859c30f" 14 _type = "network_monitor_udp/LinktestActionResult" 15 _has_header = True #flag to mark the presence of a Header object 16 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 17 18 Header header 19 actionlib_msgs/GoalStatus status 20 LinktestResult result 21 22 ================================================================================ 23 MSG: std_msgs/Header 24 # Standard metadata for higher-level stamped data types. 25 # This is generally used to communicate timestamped data 26 # in a particular coordinate frame. 27 # 28 # sequence ID: consecutively increasing ID 29 uint32 seq 30 #Two-integer timestamp that is expressed as: 31 # * stamp.secs: seconds (stamp_secs) since epoch 32 # * stamp.nsecs: nanoseconds since stamp_secs 33 # time-handling sugar is provided by the client library 34 time stamp 35 #Frame this data is associated with 36 # 0: no frame 37 # 1: global frame 38 string frame_id 39 40 ================================================================================ 41 MSG: actionlib_msgs/GoalStatus 42 GoalID goal_id 43 uint8 status 44 uint8 PENDING = 0 # The goal has yet to be processed by the action server 45 uint8 ACTIVE = 1 # The goal is currently being processed by the action server 46 uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing 47 # and has since completed its execution (Terminal State) 48 uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State) 49 uint8 ABORTED = 4 # The goal was aborted during execution by the action server due 50 # to some failure (Terminal State) 51 uint8 REJECTED = 5 # The goal was rejected by the action server without being processed, 52 # because the goal was unattainable or invalid (Terminal State) 53 uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing 54 # and has not yet completed execution 55 uint8 RECALLING = 7 # The goal received a cancel request before it started executing, 56 # but the action server has not yet confirmed that the goal is canceled 57 uint8 RECALLED = 8 # The goal received a cancel request before it started executing 58 # and was successfully cancelled (Terminal State) 59 uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be 60 # sent over the wire by an action server 61 62 #Allow for the user to associate a string with GoalStatus for debugging 63 string text 64 65 66 ================================================================================ 67 MSG: actionlib_msgs/GoalID 68 # The stamp should store the time at which this goal was requested. 69 # It is used by an action server when it tries to preempt all 70 # goals that were requested before a certain time 71 time stamp 72 73 # The id provides a way to associate feedback and 74 # result message with specific goal requests. The id 75 # specified must be unique. 76 string id 77 78 79 ================================================================================ 80 MSG: network_monitor_udp/LinktestResult 81 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 82 # Result definition 83 float32 latency 84 float32 loss 85 float32 bandwidth 86 float32[] latency_histogram 87 88 """ 89 __slots__ = ['header','status','result'] 90 _slot_types = ['std_msgs/Header','actionlib_msgs/GoalStatus','network_monitor_udp/LinktestResult'] 91
92 - def __init__(self, *args, **kwds):
93 """ 94 Constructor. Any message fields that are implicitly/explicitly 95 set to None will be assigned a default value. The recommend 96 use is keyword arguments as this is more robust to future message 97 changes. You cannot mix in-order arguments and keyword arguments. 98 99 The available fields are: 100 header,status,result 101 102 :param args: complete set of field values, in .msg order 103 :param kwds: use keyword arguments corresponding to message field names 104 to set specific fields. 105 """ 106 if args or kwds: 107 super(LinktestActionResult, self).__init__(*args, **kwds) 108 #message fields cannot be None, assign default values for those that are 109 if self.header is None: 110 self.header = std_msgs.msg.Header() 111 if self.status is None: 112 self.status = actionlib_msgs.msg.GoalStatus() 113 if self.result is None: 114 self.result = network_monitor_udp.msg.LinktestResult() 115 else: 116 self.header = std_msgs.msg.Header() 117 self.status = actionlib_msgs.msg.GoalStatus() 118 self.result = network_monitor_udp.msg.LinktestResult()
119
120 - def _get_types(self):
121 """ 122 internal API method 123 """ 124 return self._slot_types
125
126 - def serialize(self, buff):
127 """ 128 serialize message into buffer 129 :param buff: buffer, ``StringIO`` 130 """ 131 try: 132 _x = self 133 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 134 _x = self.header.frame_id 135 length = len(_x) 136 if python3 or type(_x) == unicode: 137 _x = _x.encode('utf-8') 138 length = len(_x) 139 buff.write(struct.pack('<I%ss'%length, length, _x)) 140 _x = self 141 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs)) 142 _x = self.status.goal_id.id 143 length = len(_x) 144 if python3 or type(_x) == unicode: 145 _x = _x.encode('utf-8') 146 length = len(_x) 147 buff.write(struct.pack('<I%ss'%length, length, _x)) 148 buff.write(_struct_B.pack(self.status.status)) 149 _x = self.status.text 150 length = len(_x) 151 if python3 or type(_x) == unicode: 152 _x = _x.encode('utf-8') 153 length = len(_x) 154 buff.write(struct.pack('<I%ss'%length, length, _x)) 155 _x = self 156 buff.write(_struct_3f.pack(_x.result.latency, _x.result.loss, _x.result.bandwidth)) 157 length = len(self.result.latency_histogram) 158 buff.write(_struct_I.pack(length)) 159 pattern = '<%sf'%length 160 buff.write(struct.pack(pattern, *self.result.latency_histogram)) 161 except struct.error as se: self._check_types(se) 162 except TypeError as te: self._check_types(te)
163
164 - def deserialize(self, str):
165 """ 166 unpack serialized message in str into this message instance 167 :param str: byte array of serialized message, ``str`` 168 """ 169 try: 170 if self.header is None: 171 self.header = std_msgs.msg.Header() 172 if self.status is None: 173 self.status = actionlib_msgs.msg.GoalStatus() 174 if self.result is None: 175 self.result = network_monitor_udp.msg.LinktestResult() 176 end = 0 177 _x = self 178 start = end 179 end += 12 180 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 181 start = end 182 end += 4 183 (length,) = _struct_I.unpack(str[start:end]) 184 start = end 185 end += length 186 if python3: 187 self.header.frame_id = str[start:end].decode('utf-8') 188 else: 189 self.header.frame_id = str[start:end] 190 _x = self 191 start = end 192 end += 8 193 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 194 start = end 195 end += 4 196 (length,) = _struct_I.unpack(str[start:end]) 197 start = end 198 end += length 199 if python3: 200 self.status.goal_id.id = str[start:end].decode('utf-8') 201 else: 202 self.status.goal_id.id = str[start:end] 203 start = end 204 end += 1 205 (self.status.status,) = _struct_B.unpack(str[start:end]) 206 start = end 207 end += 4 208 (length,) = _struct_I.unpack(str[start:end]) 209 start = end 210 end += length 211 if python3: 212 self.status.text = str[start:end].decode('utf-8') 213 else: 214 self.status.text = str[start:end] 215 _x = self 216 start = end 217 end += 12 218 (_x.result.latency, _x.result.loss, _x.result.bandwidth,) = _struct_3f.unpack(str[start:end]) 219 start = end 220 end += 4 221 (length,) = _struct_I.unpack(str[start:end]) 222 pattern = '<%sf'%length 223 start = end 224 end += struct.calcsize(pattern) 225 self.result.latency_histogram = struct.unpack(pattern, str[start:end]) 226 return self 227 except struct.error as e: 228 raise genpy.DeserializationError(e) #most likely buffer underfill
229 230
231 - def serialize_numpy(self, buff, numpy):
232 """ 233 serialize message with numpy array types into buffer 234 :param buff: buffer, ``StringIO`` 235 :param numpy: numpy python module 236 """ 237 try: 238 _x = self 239 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 240 _x = self.header.frame_id 241 length = len(_x) 242 if python3 or type(_x) == unicode: 243 _x = _x.encode('utf-8') 244 length = len(_x) 245 buff.write(struct.pack('<I%ss'%length, length, _x)) 246 _x = self 247 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs)) 248 _x = self.status.goal_id.id 249 length = len(_x) 250 if python3 or type(_x) == unicode: 251 _x = _x.encode('utf-8') 252 length = len(_x) 253 buff.write(struct.pack('<I%ss'%length, length, _x)) 254 buff.write(_struct_B.pack(self.status.status)) 255 _x = self.status.text 256 length = len(_x) 257 if python3 or type(_x) == unicode: 258 _x = _x.encode('utf-8') 259 length = len(_x) 260 buff.write(struct.pack('<I%ss'%length, length, _x)) 261 _x = self 262 buff.write(_struct_3f.pack(_x.result.latency, _x.result.loss, _x.result.bandwidth)) 263 length = len(self.result.latency_histogram) 264 buff.write(_struct_I.pack(length)) 265 pattern = '<%sf'%length 266 buff.write(self.result.latency_histogram.tostring()) 267 except struct.error as se: self._check_types(se) 268 except TypeError as te: self._check_types(te)
269
270 - def deserialize_numpy(self, str, numpy):
271 """ 272 unpack serialized message in str into this message instance using numpy for array types 273 :param str: byte array of serialized message, ``str`` 274 :param numpy: numpy python module 275 """ 276 try: 277 if self.header is None: 278 self.header = std_msgs.msg.Header() 279 if self.status is None: 280 self.status = actionlib_msgs.msg.GoalStatus() 281 if self.result is None: 282 self.result = network_monitor_udp.msg.LinktestResult() 283 end = 0 284 _x = self 285 start = end 286 end += 12 287 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 288 start = end 289 end += 4 290 (length,) = _struct_I.unpack(str[start:end]) 291 start = end 292 end += length 293 if python3: 294 self.header.frame_id = str[start:end].decode('utf-8') 295 else: 296 self.header.frame_id = str[start:end] 297 _x = self 298 start = end 299 end += 8 300 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 301 start = end 302 end += 4 303 (length,) = _struct_I.unpack(str[start:end]) 304 start = end 305 end += length 306 if python3: 307 self.status.goal_id.id = str[start:end].decode('utf-8') 308 else: 309 self.status.goal_id.id = str[start:end] 310 start = end 311 end += 1 312 (self.status.status,) = _struct_B.unpack(str[start:end]) 313 start = end 314 end += 4 315 (length,) = _struct_I.unpack(str[start:end]) 316 start = end 317 end += length 318 if python3: 319 self.status.text = str[start:end].decode('utf-8') 320 else: 321 self.status.text = str[start:end] 322 _x = self 323 start = end 324 end += 12 325 (_x.result.latency, _x.result.loss, _x.result.bandwidth,) = _struct_3f.unpack(str[start:end]) 326 start = end 327 end += 4 328 (length,) = _struct_I.unpack(str[start:end]) 329 pattern = '<%sf'%length 330 start = end 331 end += struct.calcsize(pattern) 332 self.result.latency_histogram = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 333 return self 334 except struct.error as e: 335 raise genpy.DeserializationError(e) #most likely buffer underfill
336 337 _struct_I = genpy.struct_I 338 _struct_3I = struct.Struct("<3I") 339 _struct_B = struct.Struct("<B") 340 _struct_2I = struct.Struct("<2I") 341 _struct_3f = struct.Struct("<3f") 342