Python Autofill Feature
3269 9 2019-7-30
Uploading and Loding Picture ...(0/1)
o(^-^)o
rhoude57 - YUL
lvl.4
Canada
Offline

Here is another interesting feature available in the Windows PC RoboMaster S1 program... The Python IDE will autofill function names for you, either S1 functions or Python ones. These lists could serve as the basis for an unofficial RoboMaster S1 SDK User Manual for Python.



S1_Python_Autofill.jpg
2019-7-30
Use props
MarkusXL
lvl.4
United States
Offline

That's, eh, nice...  I noticed some of that on the app on my iPad Mini.

But really - the app is not the place to code.   C.L.U.N.K.Y.

Do yourself a huge favor early - download and install PyCharm.  Just do it, learn it, love it, and never go to no nothing else not no never.  Feel like a real developer...

Then copy and paste into the app.

In PyCharm, it has a built-in console for testing your programs - just comment out the S1 hardware specific command lines - and test away.

It even has git built-in and tracks all your changes - totally pro dude.
2019-7-30
Use props
MarkusXL
lvl.4
United States
Offline

Ahh, this is heaven...  everything, and I mean everything, you could ask for in a Python IDE



PyCharm!


2019-7-30
Use props
Malibu Aerial
lvl.4
Flight distance : 143898 ft
United States
Offline

MarkusXL Posted at 7-30 19:05
That's, eh, nice...  I noticed some of that on the app on my iPad Mini.

But really - the app is not the place to code.   C.L.U.N.K.Y.

Thanks for the tip.  I'll try PyCharm.
2019-7-31
Use props
MarkusXL
lvl.4
United States
Offline

It looks a little overwhelming at first, but just keep going through a few Tips every time you launch it, and soon you'll be saying "wow, yet another powerful feature to help me code" over and over...  If you get stuck, there is an intensive help system, and you can google up any issue and you'll find tons of help to get you going again.

First tip:  just hit a Shift key twice quickly to bring a menu that let's you quickly jump to any feature / keyword.
2019-7-31
Use props
rhoude57 - YUL
lvl.4
Canada
Offline

MarkusXL Posted at 7-30 19:05
That's, eh, nice...  I noticed some of that on the app on my iPad Mini.

But really - the app is not the place to code.   C.L.U.N.K.Y.

Thanks for pointing out PyCharm.

In Python, I typically work with the Anaconda Navigator and Jupyter Notebook running on a Ubuntu Virtual Machine. I use this configuration to connect and run Python scripts on my DJI Tello and Tello EDU drones.

Perhaps, in a not-so-distant future, I will be able to extend that interface to the RoboMaster S1.

2019-7-31
Use props
DJI Stephen
DJI team
Offline

Hello and good day. Thank you for sharing these informative information and tips. Have a safe driving and a happy programming always.
2019-8-2
Use props
cdir
lvl.1
Flight distance : 167428 ft
Canada
Offline

DJI Stephen Posted at 8-2 10:06
Hello and good day. Thank you for sharing these informative information and tips. Have a safe driving and a happy programming always.

Thanks all!  On a related note, does anybody have a way to dump the Python API definition to take a look at it?  Playing around with the autocomplete, and looking at the conversion of the Scratch code to Python, but feels a little like I’m feeling my way around a room blindfolded.  Anybody else have any better luck?
2019-8-5
Use props
gpvillamil
lvl.4
Flight distance : 210226 ft
United States
Offline

cdir Posted at 8-5 20:33
Thanks all!  On a related note, does anybody have a way to dump the Python API definition to take a look at it?  Playing around with the autocomplete, and looking at the conversion of the Scratch code to Python, but feels a little like I’m feeling my way around a room blindfolded.  Anybody else have any better luck?

The programming documentation shows the Scratch blocks, but also includes the Python API at the end of each entry:

https://www.dji.com/mobile/robomaster-s1/programming-guide
2019-8-5
Use props
DJI Stephen
DJI team
Offline

Hello and good day cdir. I hope you will get the best recommendation and information from our valued DJI members who owns this DJI Robomaster S1. Thank you for your support.
2019-8-6
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules