Raspberry Pi autonomous Drone

January 1, 2024, 06:50

wadegamer

I am currently trying to implement a couple of Python packages called Dronekit: https://dronekit-python.readthedocs.io/en/latest/develop/installation.html It allows me to interact with the flight firmware for autonomous flight MAVproxy:https://ardupilot.org/dev/docs/raspberry-pi-via-mavlink.html Communication protocol that allows me to send commands from the flight computer(Raspberry Pi) to a flight controller The only issue is these libraries still only exist in Python 2.7. I tried using Legacy OS but it does not support Python 2.7 packages either. Any ideas?

k9t33n

can't when you run the code just run it with python2

k9t33n

or even start a venv with python 2 not 3

wadegamer

I get an error massage that says can’t locate the package when I use python 2

wadegamer

<@1071178789939331253> what is a Venv?

k9t33n

create the venv like this python2 -m venv my_venv then activate it like this source my_venv/bin/activate

wadegamer

So in the Venv python 2 libraries are supported?

wadegamer

And since it’s a virtual environment could I still interact with the Uart of the raspberry pi ?

k9t33n

I'm not sure whether they are supported but it should work, because your creating a environment specifically for python 2

k9t33n

you might need to use sudo but when you run files within it, it should work

wadegamer


wadegamer

<@1071178789939331253> I get this error

k9t33n

one second

k9t33n

try this python2 -m venv path/to/venv

k9t33n

then source path/to/venv/bin/activate

wadegamer

same error

k9t33n

try it with python 3 just to test

wadegamer

aight

wadegamer

]

wadegamer

Im on the legacy os btw

wadegamer

ok Instead of using sudo apt-get install python- dronekit I used pip sudo pip install dronekit

wadegamer


wadegamer

but I get this error

k9t33n

yeah that might be a problem

k9t33n

try sudo pip2 install dronekit after this you just need to find a python 3 alternative module unfortunately

wadegamer

pip2 didn't work, there are no py3 alternatives

wadegamer

thanks for the help tho

k9t33n

yeah sorry I couldn't help

wadegamer

No worries

oops.se

What is the output from cat /etc/os-release?

wadegamer

I get this

wadegamer


oops.se

I spent a hour to try to work around it but I only got deeper and deeper into what is called "Dependency Hell"! Dronekit need:
sudo apt install libxml2-dev libxslt1-dev python2-dev python2

sudo pip2 install lxml

sudo pip2 install dronekit
But it always fails on lxml. And then I discover that it is outdated (2016) and the repo is asking for new maintainers https://github.com/dronekit/dronekit-python

oops.se

So I think you need to look for an alternative or asking in the "issue" on github

wadegamer

<@796000224690307072> thank you for your time and looking in to it

oops.se

Your welcome

wadegamer

I might have to create a project and create a control firmware myself, I’ll keep you posted if interested

oops.se

Search for "alternative dronekit"