MCPcopy
hub / github.com/dronekit/dronekit-python / test_mavlink

Function test_mavlink

dronekit/test/sitl/test_mavlink.py:10–28  ·  view source on GitHub ↗
(connpath)

Source from the content-addressed store, hash-verified

8
9@with_sitl
10def test_mavlink(connpath):
11 vehicle = connect(connpath)
12 out = MAVConnection('udpin:localhost:15668')
13 vehicle._handler.pipe(out)
14 out.start()
15
16 vehicle2 = connect('udpout:localhost:15668')
17
18 result = {'success': False}
19
20 @vehicle2.on_attribute('location')
21 def callback(*args):
22 result['success'] = True
23
24 i = 20
25 while not result['success'] and i > 0:
26 time.sleep(1)
27
28 assert result['success']

Callers

nothing calls this directly

Calls 4

startMethod · 0.95
connectFunction · 0.90
MAVConnectionClass · 0.90
pipeMethod · 0.80

Tested by

no test coverage detected