pythondronekit-pythondronekitmavlinkpx4

Can i connect to pixhawk with python?


I want to connect pixhawk without Mission Planner because Mission Planner supported Python 2.7 script but i work on Python 3.7 so can i connect to pixhawk Just Python with telemetry module? OS: Win 10


Solution

  • You can run your drone from python using dronekit-python. https://dronekit-python.readthedocs.io/en/latest/automodule.html

    You can also build a SITL version that runs Arducopter 3.7 so that you can test your commands here before trying on your drone. Following link helps with installing this SITL: http://ardupilot.org/dev/docs/sitl-native-on-windows.html

    To connect with drone, you will have to install Telemetry driver on Windows. To install Telemetry driver this video might help: https://www.youtube.com/watch?v=s_MO4xUySoU

    In python code I use the Telemetry port number and baud rate to connect with drone: vehicle = connect('COM5', wait_ready=False, baud=57600)