Running MAVSDK directly on M500 and Python update
-
The team and I are developing a learning AI algorithm deployed on a raspberry pi to fly an obstacle course with the M500. We are only using the Hires camera frames and aircraft position data.
We wanted to run our python code directly on your VOXL flight deck, but I'm having trouble updating the python version on the M500. Our AI is running on Ubuntu 20.04 with Python 3.9.15. Any way we can update this to something closer to 3.9?
I also am using python based MAVSDK commands from the AI to control movement through the obstacle course, do you know if we can run this directly on the system as well?
We are aware of the docker option and would just like to know if we can run on the aircraft without docker, or if we should go ahead and set up what we need to run in a docker container.
Any feedback on the two questions is appreciated!Kind Regards,
Steve -
Have you looked at the tutorial on MAVSDK? https://docs.modalai.com/mavsdk
-
You should be able to build python3 from source on target, for example i used the following instructions to build python 3.8.16 on VOXL1 Flight
mkdir ~/python-build cd ~/python-build wget https://www.python.org/ftp/python/3.8.16/Python-3.8.16.tgz tar xzf Python-3.8.16.tgz cd Python-3.8.16 ./configure --enable-optimizations make -j 8 make altinstall ~ # python3.8 --version Python 3.8.16
It took like 20 minutes to build it on VOXL1 -- tests took a while which generate some data for optimizations (
--enable-optimizations
enables this).You can build newer versions of Python using the same approach too, just check the path of .tgz archive (you can browse the http)
-
@Chad-Sweet
Thanks for the quick reply, our team looked into the docker examples, and know that is an option. We are looking to run MAVSDK python directly on M500's VOXL.
We'll use docker if this cannot be done, since we need the architecture bloating to stay as low as possible due to the AI. -
The Docker is 64-bit, so the code that runs inside is usually faster than the code that runs outside of the Docker
-
@Alex-Kushleyev
Thanks a bunch for the quick guide we are successful in upgrading our system to the desired 3.9.15 python version.
Would we be able to follow the same steps for MAVSDK python install to M500?
We are trying to run MAVSDK python files directly in the VOXL data folder currently and receiving an invalid syntax error on the "async def run()" line. I was under the impression we had MAVSDK in the aircraft already from the functional diagram on the docs shown in the MAVSDK link.
https://docs.modalai.com/mavsdk/
Do we need to install Asyncio too to fix this error? -
@Chad-Sweet said in Running MAVSDK directly on M500 and Python update:
The Docker is 64-bit, so the code that runs inside is usually faster than the code that runs outside of the Docker
Oh, that's interesting, thanks for the insight. I'll share with the others, and let you know how it all goes.