DronecodeSDK and two Python versions?

#1

Hello. I just listened in on the webinar "Controlling PX4 Powered Drones with the SDK. I thought is was an excellent presentation by everyone involved. I certainly learned a lot. My question involves Python. It was stated that the SDK will be using Python 3.6 and above. I assume this means that I will be developing custom missions in Python 3.6. However, everything currently in the PX4 environment is Python 2.7. That is what I planned to use for my current projects. How will using the SDK affect this, ie, will I have to deal with discrepancies between the two versions of Python? If the SDK was developed to make customized solutions easier, then please explain why two versions of Python.

Since I’m not a programmer (yet) forgive me if I am asking a question that is a non-issue.

Thanks,
Joe

#2

Hi @Joseph_Marrone thanks for posting, can you please clarify what you mean by “everything currently in the PX4 environment is Python 2.7” what tools are you referring to?

#3

Hello,

Do you have any link to the webinar?

thanks,

#4

@rroche, this is the SITL system I’m building.

dronekit-2.9.1
pymavlink-2.0.6
future-0.15.2
monotonic-1.2
MAVProxy-1.7.7
Python-2.7
jMAVSim

All of the internals of this environment use Python 2.7. I don’t find any references to Python 3.

If I want to write a Python script to run the simulator, I think I have to use Python 2.7, don’t I? If not then I guess I don’t care what version I use. The SDK is going to use Python 3, so I need to understand how I can use this in a Python 2.7 environment.

@shrit, the seminar was put on by Auterion, the company Lorenze Meier co-founded and which continues to develop the open source PX4 system and its components like QGroundControl. Their website is www.auterion.com

Joe

#5

Thanks for your answer,

I do not know if the webinar is registered on the website as a video for later. I can see it on the website, However, I will be interested if they had a talk about dronecodeSDK.

Best regards,

#6

@Joseph_Marrone Good question!
In short, this shouldn’t cause any problems.

As we mentioned during the Q&A of the webinar, we decided to use Python 3.6 for Dronecode because this means we can make use of the new Python asyncio functionality. This makes it possible to offer a good async interface as well as a sync interface on top of it.

Now this is just our current suggestion, if many (like you) are not ok with Python 3.6 and later and really need something with Python 2, then we can certainly revisit the decision.

I don’t see a problem with having different Python versions for different software on a machine. It’s quite common that some things run with Python 3 while others are still using Python 2. So in our example, the tooling around PX4 can still be in Python 2 (even though it generally also works with Python 3).

Also, for Python dependencies (things installed using pip) it’s generally recommended to use a virtual enviroment to avoid dependency conflicts.

1 Like
#7

And btw. the webinar is now on youtube: https://www.youtube.com/watch?v=wYRH495sMjo. :tada:

2 Likes
#8

Thanks for pointing to the webinar link

#9

It was interesting to see the webinar, It has very good tutorials, it also allows users to understand better the capabilities of the SDK and the simulation.

I would like to add a point considering the poll. Is it possible to create these kinds of poll inside the forum as an independent pinned thread, that is going to allow to reach better numbers of users.

1 Like
#10

@JulianOes, I am building the environment you demonstrated on the webinar. I am having difficulty with errors regarding the graphics (GL) which causes the GUI to crash and not appear. I don’t know if this is the right thread to bring this up, but wanted to flag it because it has stopped me with this project. If there is another forum i should use for this, please let me know what it is.

ALso, I am interested to know when Python scripting will be available. You mentioned this during the presentation. I know that currently you have to use C++, but I want to develop in Python.

Thanks for your help.
Joe

#11

Could you precise the graphics problem?? Are they related to the simulator: gazebo or javsim??

#12

@Joseph_Marrone please create a new thread for the graphics problem.

Regarding Python, check


and try if you can follow the readme and try it out.