1 """autogenerated by genpy from network_monitor_udp/LinktestAction.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 actionlib_msgs.msg
8 import genpy
9 import network_monitor_udp.msg
10 import std_msgs.msg
11
13 _md5sum = "87d4de3ce9cd4ec54de5ab95fc70d3ac"
14 _type = "network_monitor_udp/LinktestAction"
15 _has_header = False
16 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
17
18 LinktestActionGoal action_goal
19 LinktestActionResult action_result
20 LinktestActionFeedback action_feedback
21
22 ================================================================================
23 MSG: network_monitor_udp/LinktestActionGoal
24 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
25
26 Header header
27 actionlib_msgs/GoalID goal_id
28 LinktestGoal goal
29
30 ================================================================================
31 MSG: std_msgs/Header
32 # Standard metadata for higher-level stamped data types.
33 # This is generally used to communicate timestamped data
34 # in a particular coordinate frame.
35 #
36 # sequence ID: consecutively increasing ID
37 uint32 seq
38 #Two-integer timestamp that is expressed as:
39 # * stamp.secs: seconds (stamp_secs) since epoch
40 # * stamp.nsecs: nanoseconds since stamp_secs
41 # time-handling sugar is provided by the client library
42 time stamp
43 #Frame this data is associated with
44 # 0: no frame
45 # 1: global frame
46 string frame_id
47
48 ================================================================================
49 MSG: actionlib_msgs/GoalID
50 # The stamp should store the time at which this goal was requested.
51 # It is used by an action server when it tries to preempt all
52 # goals that were requested before a certain time
53 time stamp
54
55 # The id provides a way to associate feedback and
56 # result message with specific goal requests. The id
57 # specified must be unique.
58 string id
59
60
61 ================================================================================
62 MSG: network_monitor_udp/LinktestGoal
63 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
64 # Goal definition
65 float32 DEFAULT_UPDATE_INTERVAL=0.15 # sec
66 float32 DEFAULT_BW=5000000.0 # bps
67 char DEFAULT_BWTYPE=99 # default bw type: constant
68 char BW_CONSTANT=99 # 'c'
69 char BW_ADAPTIVE=97 # 'a'
70 float32 LIM1=-0.3 # adaptive alg constants
71 float32 LIM2=0.3
72 float32 C1=-0.05
73 float32 C2=0.2
74 float32 DEFAULT_LATENCY_THRESHOLD=0.01 # sec
75 float32 DEFAULT_PKTLOSS_THRESHOLD=0.5 # %
76 int32 DEFAULT_PKTSIZE=1500 # bytes
77
78 float32 duration # sec
79 float32 update_interval # sec
80 float32 bw # bps
81 char bw_type # BW_CONSTANT | BW_ADAPTIVE
82 float32 latency_threshold # sec
83 float32 pktloss_threshold # %
84 uint8 tos
85 int32 pktsize # bytes
86 bool ros_returnpath # default: false == UDP
87 bool roundtrip # default: false == oneway
88 float32 max_return_time # sec
89 string rostopic_prefix
90 string sink_ip
91 int32 sink_port
92 float32[] latencybins
93
94 ================================================================================
95 MSG: network_monitor_udp/LinktestActionResult
96 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
97
98 Header header
99 actionlib_msgs/GoalStatus status
100 LinktestResult result
101
102 ================================================================================
103 MSG: actionlib_msgs/GoalStatus
104 GoalID goal_id
105 uint8 status
106 uint8 PENDING = 0 # The goal has yet to be processed by the action server
107 uint8 ACTIVE = 1 # The goal is currently being processed by the action server
108 uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing
109 # and has since completed its execution (Terminal State)
110 uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State)
111 uint8 ABORTED = 4 # The goal was aborted during execution by the action server due
112 # to some failure (Terminal State)
113 uint8 REJECTED = 5 # The goal was rejected by the action server without being processed,
114 # because the goal was unattainable or invalid (Terminal State)
115 uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing
116 # and has not yet completed execution
117 uint8 RECALLING = 7 # The goal received a cancel request before it started executing,
118 # but the action server has not yet confirmed that the goal is canceled
119 uint8 RECALLED = 8 # The goal received a cancel request before it started executing
120 # and was successfully cancelled (Terminal State)
121 uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be
122 # sent over the wire by an action server
123
124 #Allow for the user to associate a string with GoalStatus for debugging
125 string text
126
127
128 ================================================================================
129 MSG: network_monitor_udp/LinktestResult
130 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
131 # Result definition
132 float32 latency
133 float32 loss
134 float32 bandwidth
135 float32[] latency_histogram
136
137 ================================================================================
138 MSG: network_monitor_udp/LinktestActionFeedback
139 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
140
141 Header header
142 actionlib_msgs/GoalStatus status
143 LinktestFeedback feedback
144
145 ================================================================================
146 MSG: network_monitor_udp/LinktestFeedback
147 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
148 # Feedback definition
149 float32 latency
150 float32 loss
151 float32 bandwidth
152 float32[] latency_histogram
153 time stamp
154
155
156 """
157 __slots__ = ['action_goal','action_result','action_feedback']
158 _slot_types = ['network_monitor_udp/LinktestActionGoal','network_monitor_udp/LinktestActionResult','network_monitor_udp/LinktestActionFeedback']
159
187
189 """
190 internal API method
191 """
192 return self._slot_types
193
195 """
196 serialize message into buffer
197 :param buff: buffer, ``StringIO``
198 """
199 try:
200 _x = self
201 buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs))
202 _x = self.action_goal.header.frame_id
203 length = len(_x)
204 if python3 or type(_x) == unicode:
205 _x = _x.encode('utf-8')
206 length = len(_x)
207 buff.write(struct.pack('<I%ss'%length, length, _x))
208 _x = self
209 buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs))
210 _x = self.action_goal.goal_id.id
211 length = len(_x)
212 if python3 or type(_x) == unicode:
213 _x = _x.encode('utf-8')
214 length = len(_x)
215 buff.write(struct.pack('<I%ss'%length, length, _x))
216 _x = self
217 buff.write(_struct_3fB2fBi2Bf.pack(_x.action_goal.goal.duration, _x.action_goal.goal.update_interval, _x.action_goal.goal.bw, _x.action_goal.goal.bw_type, _x.action_goal.goal.latency_threshold, _x.action_goal.goal.pktloss_threshold, _x.action_goal.goal.tos, _x.action_goal.goal.pktsize, _x.action_goal.goal.ros_returnpath, _x.action_goal.goal.roundtrip, _x.action_goal.goal.max_return_time))
218 _x = self.action_goal.goal.rostopic_prefix
219 length = len(_x)
220 if python3 or type(_x) == unicode:
221 _x = _x.encode('utf-8')
222 length = len(_x)
223 buff.write(struct.pack('<I%ss'%length, length, _x))
224 _x = self.action_goal.goal.sink_ip
225 length = len(_x)
226 if python3 or type(_x) == unicode:
227 _x = _x.encode('utf-8')
228 length = len(_x)
229 buff.write(struct.pack('<I%ss'%length, length, _x))
230 buff.write(_struct_i.pack(self.action_goal.goal.sink_port))
231 length = len(self.action_goal.goal.latencybins)
232 buff.write(_struct_I.pack(length))
233 pattern = '<%sf'%length
234 buff.write(struct.pack(pattern, *self.action_goal.goal.latencybins))
235 _x = self
236 buff.write(_struct_3I.pack(_x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs))
237 _x = self.action_result.header.frame_id
238 length = len(_x)
239 if python3 or type(_x) == unicode:
240 _x = _x.encode('utf-8')
241 length = len(_x)
242 buff.write(struct.pack('<I%ss'%length, length, _x))
243 _x = self
244 buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs))
245 _x = self.action_result.status.goal_id.id
246 length = len(_x)
247 if python3 or type(_x) == unicode:
248 _x = _x.encode('utf-8')
249 length = len(_x)
250 buff.write(struct.pack('<I%ss'%length, length, _x))
251 buff.write(_struct_B.pack(self.action_result.status.status))
252 _x = self.action_result.status.text
253 length = len(_x)
254 if python3 or type(_x) == unicode:
255 _x = _x.encode('utf-8')
256 length = len(_x)
257 buff.write(struct.pack('<I%ss'%length, length, _x))
258 _x = self
259 buff.write(_struct_3f.pack(_x.action_result.result.latency, _x.action_result.result.loss, _x.action_result.result.bandwidth))
260 length = len(self.action_result.result.latency_histogram)
261 buff.write(_struct_I.pack(length))
262 pattern = '<%sf'%length
263 buff.write(struct.pack(pattern, *self.action_result.result.latency_histogram))
264 _x = self
265 buff.write(_struct_3I.pack(_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs))
266 _x = self.action_feedback.header.frame_id
267 length = len(_x)
268 if python3 or type(_x) == unicode:
269 _x = _x.encode('utf-8')
270 length = len(_x)
271 buff.write(struct.pack('<I%ss'%length, length, _x))
272 _x = self
273 buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs))
274 _x = self.action_feedback.status.goal_id.id
275 length = len(_x)
276 if python3 or type(_x) == unicode:
277 _x = _x.encode('utf-8')
278 length = len(_x)
279 buff.write(struct.pack('<I%ss'%length, length, _x))
280 buff.write(_struct_B.pack(self.action_feedback.status.status))
281 _x = self.action_feedback.status.text
282 length = len(_x)
283 if python3 or type(_x) == unicode:
284 _x = _x.encode('utf-8')
285 length = len(_x)
286 buff.write(struct.pack('<I%ss'%length, length, _x))
287 _x = self
288 buff.write(_struct_3f.pack(_x.action_feedback.feedback.latency, _x.action_feedback.feedback.loss, _x.action_feedback.feedback.bandwidth))
289 length = len(self.action_feedback.feedback.latency_histogram)
290 buff.write(_struct_I.pack(length))
291 pattern = '<%sf'%length
292 buff.write(struct.pack(pattern, *self.action_feedback.feedback.latency_histogram))
293 _x = self
294 buff.write(_struct_2I.pack(_x.action_feedback.feedback.stamp.secs, _x.action_feedback.feedback.stamp.nsecs))
295 except struct.error as se: self._check_types(se)
296 except TypeError as te: self._check_types(te)
297
299 """
300 unpack serialized message in str into this message instance
301 :param str: byte array of serialized message, ``str``
302 """
303 try:
304 if self.action_goal is None:
305 self.action_goal = network_monitor_udp.msg.LinktestActionGoal()
306 if self.action_result is None:
307 self.action_result = network_monitor_udp.msg.LinktestActionResult()
308 if self.action_feedback is None:
309 self.action_feedback = network_monitor_udp.msg.LinktestActionFeedback()
310 end = 0
311 _x = self
312 start = end
313 end += 12
314 (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
315 start = end
316 end += 4
317 (length,) = _struct_I.unpack(str[start:end])
318 start = end
319 end += length
320 if python3:
321 self.action_goal.header.frame_id = str[start:end].decode('utf-8')
322 else:
323 self.action_goal.header.frame_id = str[start:end]
324 _x = self
325 start = end
326 end += 8
327 (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
328 start = end
329 end += 4
330 (length,) = _struct_I.unpack(str[start:end])
331 start = end
332 end += length
333 if python3:
334 self.action_goal.goal_id.id = str[start:end].decode('utf-8')
335 else:
336 self.action_goal.goal_id.id = str[start:end]
337 _x = self
338 start = end
339 end += 32
340 (_x.action_goal.goal.duration, _x.action_goal.goal.update_interval, _x.action_goal.goal.bw, _x.action_goal.goal.bw_type, _x.action_goal.goal.latency_threshold, _x.action_goal.goal.pktloss_threshold, _x.action_goal.goal.tos, _x.action_goal.goal.pktsize, _x.action_goal.goal.ros_returnpath, _x.action_goal.goal.roundtrip, _x.action_goal.goal.max_return_time,) = _struct_3fB2fBi2Bf.unpack(str[start:end])
341 self.action_goal.goal.ros_returnpath = bool(self.action_goal.goal.ros_returnpath)
342 self.action_goal.goal.roundtrip = bool(self.action_goal.goal.roundtrip)
343 start = end
344 end += 4
345 (length,) = _struct_I.unpack(str[start:end])
346 start = end
347 end += length
348 if python3:
349 self.action_goal.goal.rostopic_prefix = str[start:end].decode('utf-8')
350 else:
351 self.action_goal.goal.rostopic_prefix = str[start:end]
352 start = end
353 end += 4
354 (length,) = _struct_I.unpack(str[start:end])
355 start = end
356 end += length
357 if python3:
358 self.action_goal.goal.sink_ip = str[start:end].decode('utf-8')
359 else:
360 self.action_goal.goal.sink_ip = str[start:end]
361 start = end
362 end += 4
363 (self.action_goal.goal.sink_port,) = _struct_i.unpack(str[start:end])
364 start = end
365 end += 4
366 (length,) = _struct_I.unpack(str[start:end])
367 pattern = '<%sf'%length
368 start = end
369 end += struct.calcsize(pattern)
370 self.action_goal.goal.latencybins = struct.unpack(pattern, str[start:end])
371 _x = self
372 start = end
373 end += 12
374 (_x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
375 start = end
376 end += 4
377 (length,) = _struct_I.unpack(str[start:end])
378 start = end
379 end += length
380 if python3:
381 self.action_result.header.frame_id = str[start:end].decode('utf-8')
382 else:
383 self.action_result.header.frame_id = str[start:end]
384 _x = self
385 start = end
386 end += 8
387 (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
388 start = end
389 end += 4
390 (length,) = _struct_I.unpack(str[start:end])
391 start = end
392 end += length
393 if python3:
394 self.action_result.status.goal_id.id = str[start:end].decode('utf-8')
395 else:
396 self.action_result.status.goal_id.id = str[start:end]
397 start = end
398 end += 1
399 (self.action_result.status.status,) = _struct_B.unpack(str[start:end])
400 start = end
401 end += 4
402 (length,) = _struct_I.unpack(str[start:end])
403 start = end
404 end += length
405 if python3:
406 self.action_result.status.text = str[start:end].decode('utf-8')
407 else:
408 self.action_result.status.text = str[start:end]
409 _x = self
410 start = end
411 end += 12
412 (_x.action_result.result.latency, _x.action_result.result.loss, _x.action_result.result.bandwidth,) = _struct_3f.unpack(str[start:end])
413 start = end
414 end += 4
415 (length,) = _struct_I.unpack(str[start:end])
416 pattern = '<%sf'%length
417 start = end
418 end += struct.calcsize(pattern)
419 self.action_result.result.latency_histogram = struct.unpack(pattern, str[start:end])
420 _x = self
421 start = end
422 end += 12
423 (_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
424 start = end
425 end += 4
426 (length,) = _struct_I.unpack(str[start:end])
427 start = end
428 end += length
429 if python3:
430 self.action_feedback.header.frame_id = str[start:end].decode('utf-8')
431 else:
432 self.action_feedback.header.frame_id = str[start:end]
433 _x = self
434 start = end
435 end += 8
436 (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
437 start = end
438 end += 4
439 (length,) = _struct_I.unpack(str[start:end])
440 start = end
441 end += length
442 if python3:
443 self.action_feedback.status.goal_id.id = str[start:end].decode('utf-8')
444 else:
445 self.action_feedback.status.goal_id.id = str[start:end]
446 start = end
447 end += 1
448 (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end])
449 start = end
450 end += 4
451 (length,) = _struct_I.unpack(str[start:end])
452 start = end
453 end += length
454 if python3:
455 self.action_feedback.status.text = str[start:end].decode('utf-8')
456 else:
457 self.action_feedback.status.text = str[start:end]
458 _x = self
459 start = end
460 end += 12
461 (_x.action_feedback.feedback.latency, _x.action_feedback.feedback.loss, _x.action_feedback.feedback.bandwidth,) = _struct_3f.unpack(str[start:end])
462 start = end
463 end += 4
464 (length,) = _struct_I.unpack(str[start:end])
465 pattern = '<%sf'%length
466 start = end
467 end += struct.calcsize(pattern)
468 self.action_feedback.feedback.latency_histogram = struct.unpack(pattern, str[start:end])
469 _x = self
470 start = end
471 end += 8
472 (_x.action_feedback.feedback.stamp.secs, _x.action_feedback.feedback.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
473 return self
474 except struct.error as e:
475 raise genpy.DeserializationError(e)
476
477
479 """
480 serialize message with numpy array types into buffer
481 :param buff: buffer, ``StringIO``
482 :param numpy: numpy python module
483 """
484 try:
485 _x = self
486 buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs))
487 _x = self.action_goal.header.frame_id
488 length = len(_x)
489 if python3 or type(_x) == unicode:
490 _x = _x.encode('utf-8')
491 length = len(_x)
492 buff.write(struct.pack('<I%ss'%length, length, _x))
493 _x = self
494 buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs))
495 _x = self.action_goal.goal_id.id
496 length = len(_x)
497 if python3 or type(_x) == unicode:
498 _x = _x.encode('utf-8')
499 length = len(_x)
500 buff.write(struct.pack('<I%ss'%length, length, _x))
501 _x = self
502 buff.write(_struct_3fB2fBi2Bf.pack(_x.action_goal.goal.duration, _x.action_goal.goal.update_interval, _x.action_goal.goal.bw, _x.action_goal.goal.bw_type, _x.action_goal.goal.latency_threshold, _x.action_goal.goal.pktloss_threshold, _x.action_goal.goal.tos, _x.action_goal.goal.pktsize, _x.action_goal.goal.ros_returnpath, _x.action_goal.goal.roundtrip, _x.action_goal.goal.max_return_time))
503 _x = self.action_goal.goal.rostopic_prefix
504 length = len(_x)
505 if python3 or type(_x) == unicode:
506 _x = _x.encode('utf-8')
507 length = len(_x)
508 buff.write(struct.pack('<I%ss'%length, length, _x))
509 _x = self.action_goal.goal.sink_ip
510 length = len(_x)
511 if python3 or type(_x) == unicode:
512 _x = _x.encode('utf-8')
513 length = len(_x)
514 buff.write(struct.pack('<I%ss'%length, length, _x))
515 buff.write(_struct_i.pack(self.action_goal.goal.sink_port))
516 length = len(self.action_goal.goal.latencybins)
517 buff.write(_struct_I.pack(length))
518 pattern = '<%sf'%length
519 buff.write(self.action_goal.goal.latencybins.tostring())
520 _x = self
521 buff.write(_struct_3I.pack(_x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs))
522 _x = self.action_result.header.frame_id
523 length = len(_x)
524 if python3 or type(_x) == unicode:
525 _x = _x.encode('utf-8')
526 length = len(_x)
527 buff.write(struct.pack('<I%ss'%length, length, _x))
528 _x = self
529 buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs))
530 _x = self.action_result.status.goal_id.id
531 length = len(_x)
532 if python3 or type(_x) == unicode:
533 _x = _x.encode('utf-8')
534 length = len(_x)
535 buff.write(struct.pack('<I%ss'%length, length, _x))
536 buff.write(_struct_B.pack(self.action_result.status.status))
537 _x = self.action_result.status.text
538 length = len(_x)
539 if python3 or type(_x) == unicode:
540 _x = _x.encode('utf-8')
541 length = len(_x)
542 buff.write(struct.pack('<I%ss'%length, length, _x))
543 _x = self
544 buff.write(_struct_3f.pack(_x.action_result.result.latency, _x.action_result.result.loss, _x.action_result.result.bandwidth))
545 length = len(self.action_result.result.latency_histogram)
546 buff.write(_struct_I.pack(length))
547 pattern = '<%sf'%length
548 buff.write(self.action_result.result.latency_histogram.tostring())
549 _x = self
550 buff.write(_struct_3I.pack(_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs))
551 _x = self.action_feedback.header.frame_id
552 length = len(_x)
553 if python3 or type(_x) == unicode:
554 _x = _x.encode('utf-8')
555 length = len(_x)
556 buff.write(struct.pack('<I%ss'%length, length, _x))
557 _x = self
558 buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs))
559 _x = self.action_feedback.status.goal_id.id
560 length = len(_x)
561 if python3 or type(_x) == unicode:
562 _x = _x.encode('utf-8')
563 length = len(_x)
564 buff.write(struct.pack('<I%ss'%length, length, _x))
565 buff.write(_struct_B.pack(self.action_feedback.status.status))
566 _x = self.action_feedback.status.text
567 length = len(_x)
568 if python3 or type(_x) == unicode:
569 _x = _x.encode('utf-8')
570 length = len(_x)
571 buff.write(struct.pack('<I%ss'%length, length, _x))
572 _x = self
573 buff.write(_struct_3f.pack(_x.action_feedback.feedback.latency, _x.action_feedback.feedback.loss, _x.action_feedback.feedback.bandwidth))
574 length = len(self.action_feedback.feedback.latency_histogram)
575 buff.write(_struct_I.pack(length))
576 pattern = '<%sf'%length
577 buff.write(self.action_feedback.feedback.latency_histogram.tostring())
578 _x = self
579 buff.write(_struct_2I.pack(_x.action_feedback.feedback.stamp.secs, _x.action_feedback.feedback.stamp.nsecs))
580 except struct.error as se: self._check_types(se)
581 except TypeError as te: self._check_types(te)
582
584 """
585 unpack serialized message in str into this message instance using numpy for array types
586 :param str: byte array of serialized message, ``str``
587 :param numpy: numpy python module
588 """
589 try:
590 if self.action_goal is None:
591 self.action_goal = network_monitor_udp.msg.LinktestActionGoal()
592 if self.action_result is None:
593 self.action_result = network_monitor_udp.msg.LinktestActionResult()
594 if self.action_feedback is None:
595 self.action_feedback = network_monitor_udp.msg.LinktestActionFeedback()
596 end = 0
597 _x = self
598 start = end
599 end += 12
600 (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
601 start = end
602 end += 4
603 (length,) = _struct_I.unpack(str[start:end])
604 start = end
605 end += length
606 if python3:
607 self.action_goal.header.frame_id = str[start:end].decode('utf-8')
608 else:
609 self.action_goal.header.frame_id = str[start:end]
610 _x = self
611 start = end
612 end += 8
613 (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
614 start = end
615 end += 4
616 (length,) = _struct_I.unpack(str[start:end])
617 start = end
618 end += length
619 if python3:
620 self.action_goal.goal_id.id = str[start:end].decode('utf-8')
621 else:
622 self.action_goal.goal_id.id = str[start:end]
623 _x = self
624 start = end
625 end += 32
626 (_x.action_goal.goal.duration, _x.action_goal.goal.update_interval, _x.action_goal.goal.bw, _x.action_goal.goal.bw_type, _x.action_goal.goal.latency_threshold, _x.action_goal.goal.pktloss_threshold, _x.action_goal.goal.tos, _x.action_goal.goal.pktsize, _x.action_goal.goal.ros_returnpath, _x.action_goal.goal.roundtrip, _x.action_goal.goal.max_return_time,) = _struct_3fB2fBi2Bf.unpack(str[start:end])
627 self.action_goal.goal.ros_returnpath = bool(self.action_goal.goal.ros_returnpath)
628 self.action_goal.goal.roundtrip = bool(self.action_goal.goal.roundtrip)
629 start = end
630 end += 4
631 (length,) = _struct_I.unpack(str[start:end])
632 start = end
633 end += length
634 if python3:
635 self.action_goal.goal.rostopic_prefix = str[start:end].decode('utf-8')
636 else:
637 self.action_goal.goal.rostopic_prefix = str[start:end]
638 start = end
639 end += 4
640 (length,) = _struct_I.unpack(str[start:end])
641 start = end
642 end += length
643 if python3:
644 self.action_goal.goal.sink_ip = str[start:end].decode('utf-8')
645 else:
646 self.action_goal.goal.sink_ip = str[start:end]
647 start = end
648 end += 4
649 (self.action_goal.goal.sink_port,) = _struct_i.unpack(str[start:end])
650 start = end
651 end += 4
652 (length,) = _struct_I.unpack(str[start:end])
653 pattern = '<%sf'%length
654 start = end
655 end += struct.calcsize(pattern)
656 self.action_goal.goal.latencybins = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
657 _x = self
658 start = end
659 end += 12
660 (_x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
661 start = end
662 end += 4
663 (length,) = _struct_I.unpack(str[start:end])
664 start = end
665 end += length
666 if python3:
667 self.action_result.header.frame_id = str[start:end].decode('utf-8')
668 else:
669 self.action_result.header.frame_id = str[start:end]
670 _x = self
671 start = end
672 end += 8
673 (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
674 start = end
675 end += 4
676 (length,) = _struct_I.unpack(str[start:end])
677 start = end
678 end += length
679 if python3:
680 self.action_result.status.goal_id.id = str[start:end].decode('utf-8')
681 else:
682 self.action_result.status.goal_id.id = str[start:end]
683 start = end
684 end += 1
685 (self.action_result.status.status,) = _struct_B.unpack(str[start:end])
686 start = end
687 end += 4
688 (length,) = _struct_I.unpack(str[start:end])
689 start = end
690 end += length
691 if python3:
692 self.action_result.status.text = str[start:end].decode('utf-8')
693 else:
694 self.action_result.status.text = str[start:end]
695 _x = self
696 start = end
697 end += 12
698 (_x.action_result.result.latency, _x.action_result.result.loss, _x.action_result.result.bandwidth,) = _struct_3f.unpack(str[start:end])
699 start = end
700 end += 4
701 (length,) = _struct_I.unpack(str[start:end])
702 pattern = '<%sf'%length
703 start = end
704 end += struct.calcsize(pattern)
705 self.action_result.result.latency_histogram = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
706 _x = self
707 start = end
708 end += 12
709 (_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
710 start = end
711 end += 4
712 (length,) = _struct_I.unpack(str[start:end])
713 start = end
714 end += length
715 if python3:
716 self.action_feedback.header.frame_id = str[start:end].decode('utf-8')
717 else:
718 self.action_feedback.header.frame_id = str[start:end]
719 _x = self
720 start = end
721 end += 8
722 (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
723 start = end
724 end += 4
725 (length,) = _struct_I.unpack(str[start:end])
726 start = end
727 end += length
728 if python3:
729 self.action_feedback.status.goal_id.id = str[start:end].decode('utf-8')
730 else:
731 self.action_feedback.status.goal_id.id = str[start:end]
732 start = end
733 end += 1
734 (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end])
735 start = end
736 end += 4
737 (length,) = _struct_I.unpack(str[start:end])
738 start = end
739 end += length
740 if python3:
741 self.action_feedback.status.text = str[start:end].decode('utf-8')
742 else:
743 self.action_feedback.status.text = str[start:end]
744 _x = self
745 start = end
746 end += 12
747 (_x.action_feedback.feedback.latency, _x.action_feedback.feedback.loss, _x.action_feedback.feedback.bandwidth,) = _struct_3f.unpack(str[start:end])
748 start = end
749 end += 4
750 (length,) = _struct_I.unpack(str[start:end])
751 pattern = '<%sf'%length
752 start = end
753 end += struct.calcsize(pattern)
754 self.action_feedback.feedback.latency_histogram = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
755 _x = self
756 start = end
757 end += 8
758 (_x.action_feedback.feedback.stamp.secs, _x.action_feedback.feedback.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
759 return self
760 except struct.error as e:
761 raise genpy.DeserializationError(e)
762
763 _struct_I = genpy.struct_I
764 _struct_B = struct.Struct("<B")
765 _struct_i = struct.Struct("<i")
766 _struct_3f = struct.Struct("<3f")
767 _struct_3fB2fBi2Bf = struct.Struct("<3fB2fBi2Bf")
768 _struct_3I = struct.Struct("<3I")
769 _struct_2I = struct.Struct("<2I")
770