Dronekit python vehicle connection timeout -
we having bit of trouble getting dronekit working our copter. far have tested using sitl , works fine, success has not transferred across real thing well.
our setup is: windows gcs running mavproxy (master via com9, udp outputs dronekit script , mission planner) , basic dronekit script (takeoff , land). please see diagram clearer explanation.
we use following command when running mavproxy: mavproxy.exe --master=com9,57600 --out=udp:127.0.0.1:14550 --out=udp:127.0.0.1:14551 --console
the issue having connecting vehicle (http://python.dronekit.io/guide/connecting_vehicle.html), able connect drone , board information. not receive heartbeat message 30 seconds, leading timeout.
>>> apm:copter v3.5.2 (4322ffda) >>> px4: 1d6bf64c nuttx: 1a99ba58 >>> frame: quad >>> px4v3 0020002e 30365110 35323931 traceback (most recent call last): file "c:/users/simon/pycharmprojects/uas_lol/test_mission.py", line 32, in <module> vehicle = connect(connection_string, wait_ready=true, baud=57600, heartbeat_timeout=120) file "c:\python27\lib\site-packages\dronekit\__init__.py", line 2849, in connect vehicle.wait_ready(true) file "c:\python27\lib\site-packages\dronekit\__init__.py", line 2199, in wait_ready timeout) dronekit.apiexception: wait_ready experienced timeout after 30 seconds. process finished exit code 1
we can bypass timeout setting wait_ready=false. using can connect vehicle , arm drone. when comes taking off, works of time. find more work (takes off) when reset mavproxy.
i confirm connecting drone using udp 127.0.0.1:14550 mission planner works perfectly.
any insight may doing incorrectly appreciated, thank you!
turns out issue because connected on serial telemetry @ baud rate of 57600 takes ~2 minutes download parameters , dronekit times out after 30 seconds.
according documentation can set timeout using heartbeat_timeout=180 (http://python.dronekit.io/automodule.html#dronekit.connect). did not solve problem still timing out after 30 seconds.
it looks 30 seconds may coded library, changing 30 180 in following line solved issue. https://github.com/dronekit/dronekit-python/blob/754ce6223dd26179045eaa394d5df0a5f787ebb2/dronekit/init.py#l2216
Comments
Post a Comment