1 """autogenerated by genpy from network_monitor_udp/LinktestActionGoal.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
13 _md5sum = "63df721c3245a9bd7725838e690d5f4a"
14 _type = "network_monitor_udp/LinktestActionGoal"
15 _has_header = True
16 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
17
18 Header header
19 actionlib_msgs/GoalID goal_id
20 LinktestGoal goal
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/GoalID
42 # The stamp should store the time at which this goal was requested.
43 # It is used by an action server when it tries to preempt all
44 # goals that were requested before a certain time
45 time stamp
46
47 # The id provides a way to associate feedback and
48 # result message with specific goal requests. The id
49 # specified must be unique.
50 string id
51
52
53 ================================================================================
54 MSG: network_monitor_udp/LinktestGoal
55 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
56 # Goal definition
57 float32 DEFAULT_UPDATE_INTERVAL=0.15 # sec
58 float32 DEFAULT_BW=5000000.0 # bps
59 char DEFAULT_BWTYPE=99 # default bw type: constant
60 char BW_CONSTANT=99 # 'c'
61 char BW_ADAPTIVE=97 # 'a'
62 float32 LIM1=-0.3 # adaptive alg constants
63 float32 LIM2=0.3
64 float32 C1=-0.05
65 float32 C2=0.2
66 float32 DEFAULT_LATENCY_THRESHOLD=0.01 # sec
67 float32 DEFAULT_PKTLOSS_THRESHOLD=0.5 # %
68 int32 DEFAULT_PKTSIZE=1500 # bytes
69
70 float32 duration # sec
71 float32 update_interval # sec
72 float32 bw # bps
73 char bw_type # BW_CONSTANT | BW_ADAPTIVE
74 float32 latency_threshold # sec
75 float32 pktloss_threshold # %
76 uint8 tos
77 int32 pktsize # bytes
78 bool ros_returnpath # default: false == UDP
79 bool roundtrip # default: false == oneway
80 float32 max_return_time # sec
81 string rostopic_prefix
82 string sink_ip
83 int32 sink_port
84 float32[] latencybins
85
86 """
87 __slots__ = ['header','goal_id','goal']
88 _slot_types = ['std_msgs/Header','actionlib_msgs/GoalID','network_monitor_udp/LinktestGoal']
89
91 """
92 Constructor. Any message fields that are implicitly/explicitly
93 set to None will be assigned a default value. The recommend
94 use is keyword arguments as this is more robust to future message
95 changes. You cannot mix in-order arguments and keyword arguments.
96
97 The available fields are:
98 header,goal_id,goal
99
100 :param args: complete set of field values, in .msg order
101 :param kwds: use keyword arguments corresponding to message field names
102 to set specific fields.
103 """
104 if args or kwds:
105 super(LinktestActionGoal, self).__init__(*args, **kwds)
106
107 if self.header is None:
108 self.header = std_msgs.msg.Header()
109 if self.goal_id is None:
110 self.goal_id = actionlib_msgs.msg.GoalID()
111 if self.goal is None:
112 self.goal = network_monitor_udp.msg.LinktestGoal()
113 else:
114 self.header = std_msgs.msg.Header()
115 self.goal_id = actionlib_msgs.msg.GoalID()
116 self.goal = network_monitor_udp.msg.LinktestGoal()
117
119 """
120 internal API method
121 """
122 return self._slot_types
123
125 """
126 serialize message into buffer
127 :param buff: buffer, ``StringIO``
128 """
129 try:
130 _x = self
131 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
132 _x = self.header.frame_id
133 length = len(_x)
134 if python3 or type(_x) == unicode:
135 _x = _x.encode('utf-8')
136 length = len(_x)
137 buff.write(struct.pack('<I%ss'%length, length, _x))
138 _x = self
139 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
140 _x = self.goal_id.id
141 length = len(_x)
142 if python3 or type(_x) == unicode:
143 _x = _x.encode('utf-8')
144 length = len(_x)
145 buff.write(struct.pack('<I%ss'%length, length, _x))
146 _x = self
147 buff.write(_struct_3fB2fBi2Bf.pack(_x.goal.duration, _x.goal.update_interval, _x.goal.bw, _x.goal.bw_type, _x.goal.latency_threshold, _x.goal.pktloss_threshold, _x.goal.tos, _x.goal.pktsize, _x.goal.ros_returnpath, _x.goal.roundtrip, _x.goal.max_return_time))
148 _x = self.goal.rostopic_prefix
149 length = len(_x)
150 if python3 or type(_x) == unicode:
151 _x = _x.encode('utf-8')
152 length = len(_x)
153 buff.write(struct.pack('<I%ss'%length, length, _x))
154 _x = self.goal.sink_ip
155 length = len(_x)
156 if python3 or type(_x) == unicode:
157 _x = _x.encode('utf-8')
158 length = len(_x)
159 buff.write(struct.pack('<I%ss'%length, length, _x))
160 buff.write(_struct_i.pack(self.goal.sink_port))
161 length = len(self.goal.latencybins)
162 buff.write(_struct_I.pack(length))
163 pattern = '<%sf'%length
164 buff.write(struct.pack(pattern, *self.goal.latencybins))
165 except struct.error as se: self._check_types(se)
166 except TypeError as te: self._check_types(te)
167
169 """
170 unpack serialized message in str into this message instance
171 :param str: byte array of serialized message, ``str``
172 """
173 try:
174 if self.header is None:
175 self.header = std_msgs.msg.Header()
176 if self.goal_id is None:
177 self.goal_id = actionlib_msgs.msg.GoalID()
178 if self.goal is None:
179 self.goal = network_monitor_udp.msg.LinktestGoal()
180 end = 0
181 _x = self
182 start = end
183 end += 12
184 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
185 start = end
186 end += 4
187 (length,) = _struct_I.unpack(str[start:end])
188 start = end
189 end += length
190 if python3:
191 self.header.frame_id = str[start:end].decode('utf-8')
192 else:
193 self.header.frame_id = str[start:end]
194 _x = self
195 start = end
196 end += 8
197 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
198 start = end
199 end += 4
200 (length,) = _struct_I.unpack(str[start:end])
201 start = end
202 end += length
203 if python3:
204 self.goal_id.id = str[start:end].decode('utf-8')
205 else:
206 self.goal_id.id = str[start:end]
207 _x = self
208 start = end
209 end += 32
210 (_x.goal.duration, _x.goal.update_interval, _x.goal.bw, _x.goal.bw_type, _x.goal.latency_threshold, _x.goal.pktloss_threshold, _x.goal.tos, _x.goal.pktsize, _x.goal.ros_returnpath, _x.goal.roundtrip, _x.goal.max_return_time,) = _struct_3fB2fBi2Bf.unpack(str[start:end])
211 self.goal.ros_returnpath = bool(self.goal.ros_returnpath)
212 self.goal.roundtrip = bool(self.goal.roundtrip)
213 start = end
214 end += 4
215 (length,) = _struct_I.unpack(str[start:end])
216 start = end
217 end += length
218 if python3:
219 self.goal.rostopic_prefix = str[start:end].decode('utf-8')
220 else:
221 self.goal.rostopic_prefix = str[start:end]
222 start = end
223 end += 4
224 (length,) = _struct_I.unpack(str[start:end])
225 start = end
226 end += length
227 if python3:
228 self.goal.sink_ip = str[start:end].decode('utf-8')
229 else:
230 self.goal.sink_ip = str[start:end]
231 start = end
232 end += 4
233 (self.goal.sink_port,) = _struct_i.unpack(str[start:end])
234 start = end
235 end += 4
236 (length,) = _struct_I.unpack(str[start:end])
237 pattern = '<%sf'%length
238 start = end
239 end += struct.calcsize(pattern)
240 self.goal.latencybins = struct.unpack(pattern, str[start:end])
241 return self
242 except struct.error as e:
243 raise genpy.DeserializationError(e)
244
245
247 """
248 serialize message with numpy array types into buffer
249 :param buff: buffer, ``StringIO``
250 :param numpy: numpy python module
251 """
252 try:
253 _x = self
254 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
255 _x = self.header.frame_id
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_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
263 _x = self.goal_id.id
264 length = len(_x)
265 if python3 or type(_x) == unicode:
266 _x = _x.encode('utf-8')
267 length = len(_x)
268 buff.write(struct.pack('<I%ss'%length, length, _x))
269 _x = self
270 buff.write(_struct_3fB2fBi2Bf.pack(_x.goal.duration, _x.goal.update_interval, _x.goal.bw, _x.goal.bw_type, _x.goal.latency_threshold, _x.goal.pktloss_threshold, _x.goal.tos, _x.goal.pktsize, _x.goal.ros_returnpath, _x.goal.roundtrip, _x.goal.max_return_time))
271 _x = self.goal.rostopic_prefix
272 length = len(_x)
273 if python3 or type(_x) == unicode:
274 _x = _x.encode('utf-8')
275 length = len(_x)
276 buff.write(struct.pack('<I%ss'%length, length, _x))
277 _x = self.goal.sink_ip
278 length = len(_x)
279 if python3 or type(_x) == unicode:
280 _x = _x.encode('utf-8')
281 length = len(_x)
282 buff.write(struct.pack('<I%ss'%length, length, _x))
283 buff.write(_struct_i.pack(self.goal.sink_port))
284 length = len(self.goal.latencybins)
285 buff.write(_struct_I.pack(length))
286 pattern = '<%sf'%length
287 buff.write(self.goal.latencybins.tostring())
288 except struct.error as se: self._check_types(se)
289 except TypeError as te: self._check_types(te)
290
292 """
293 unpack serialized message in str into this message instance using numpy for array types
294 :param str: byte array of serialized message, ``str``
295 :param numpy: numpy python module
296 """
297 try:
298 if self.header is None:
299 self.header = std_msgs.msg.Header()
300 if self.goal_id is None:
301 self.goal_id = actionlib_msgs.msg.GoalID()
302 if self.goal is None:
303 self.goal = network_monitor_udp.msg.LinktestGoal()
304 end = 0
305 _x = self
306 start = end
307 end += 12
308 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
309 start = end
310 end += 4
311 (length,) = _struct_I.unpack(str[start:end])
312 start = end
313 end += length
314 if python3:
315 self.header.frame_id = str[start:end].decode('utf-8')
316 else:
317 self.header.frame_id = str[start:end]
318 _x = self
319 start = end
320 end += 8
321 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
322 start = end
323 end += 4
324 (length,) = _struct_I.unpack(str[start:end])
325 start = end
326 end += length
327 if python3:
328 self.goal_id.id = str[start:end].decode('utf-8')
329 else:
330 self.goal_id.id = str[start:end]
331 _x = self
332 start = end
333 end += 32
334 (_x.goal.duration, _x.goal.update_interval, _x.goal.bw, _x.goal.bw_type, _x.goal.latency_threshold, _x.goal.pktloss_threshold, _x.goal.tos, _x.goal.pktsize, _x.goal.ros_returnpath, _x.goal.roundtrip, _x.goal.max_return_time,) = _struct_3fB2fBi2Bf.unpack(str[start:end])
335 self.goal.ros_returnpath = bool(self.goal.ros_returnpath)
336 self.goal.roundtrip = bool(self.goal.roundtrip)
337 start = end
338 end += 4
339 (length,) = _struct_I.unpack(str[start:end])
340 start = end
341 end += length
342 if python3:
343 self.goal.rostopic_prefix = str[start:end].decode('utf-8')
344 else:
345 self.goal.rostopic_prefix = str[start:end]
346 start = end
347 end += 4
348 (length,) = _struct_I.unpack(str[start:end])
349 start = end
350 end += length
351 if python3:
352 self.goal.sink_ip = str[start:end].decode('utf-8')
353 else:
354 self.goal.sink_ip = str[start:end]
355 start = end
356 end += 4
357 (self.goal.sink_port,) = _struct_i.unpack(str[start:end])
358 start = end
359 end += 4
360 (length,) = _struct_I.unpack(str[start:end])
361 pattern = '<%sf'%length
362 start = end
363 end += struct.calcsize(pattern)
364 self.goal.latencybins = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
365 return self
366 except struct.error as e:
367 raise genpy.DeserializationError(e)
368
369 _struct_I = genpy.struct_I
370 _struct_3fB2fBi2Bf = struct.Struct("<3fB2fBi2Bf")
371 _struct_i = struct.Struct("<i")
372 _struct_3I = struct.Struct("<3I")
373 _struct_2I = struct.Struct("<2I")
374