What version of Python is RoboMaster S1 using?
6985 13 2019-7-30
Uploading and Loding Picture ...(0/1)
o(^-^)o
xiaoyuejin
lvl.1
United States
Offline

This is a life-or-death question to the Python community!

Is it Python 2.7.xx? Or is it Python 3.x.x? Or is it neither? Is the core going to be updated in the future?

2019-7-30
Use props
gpvillamil
lvl.4
Flight distance : 210226 ft
United States
Offline

Good question. I tried using both the sys and platform ways of accessing version_info and neither worked.
2019-7-30
Use props
MarkusXL
lvl.4
United States
Offline

Well, Python 3.x is like, what, 12 years old now?  I really really really doubt they used any branch of Python 2.x.  It's all over Best Practices not to use 2.x anymore, unless you absolutely need some kind backward compatibility, which I can't imagine was needed.

It is probably, a limited branch of 3.x, so not all modules will be there.  I was very happy the math module is there.  No need for f strings since the S1 cannot do any kind of print() that I can see.  Nor can it manipulate or create new files, as it has no File System per se.

As we press on with programming for various tasks, the shortcomings will become evident.  All moot if / when they ever go Open Source - then we can pick an choose our OS, kernel, everything.

As a test, I will incorporate an f-string command line in an S1 program and see if it crashes.  If it does, we are in 2.X land.


2019-7-30
Use props
rhoude57 - YUL
lvl.4
Canada
Offline

MarkusXL Posted at 7-30 07:08
Well, Python 3.x is like, what, 12 years old now?  I really really really doubt they used any branch of Python 2.x.  It's all over Best Practices not to use 2.x anymore, unless you absolutely need some kind backward compatibility, which I can't imagine was needed.

It is probably, a limited branch of 3.x, so not all modules will be there.  I was very happy the math module is there.  No need for f strings since the S1 cannot do any kind of print() that I can see.  Nor can it manipulate or create new files, as it has no File System per se.

I probably would challenge you on the File I/O module. The Robomaster S1 needs it to implement the Media functions like creating and storing a picture or video on the SD Card.
2019-7-30
Use props
gpvillamil
lvl.4
Flight distance : 210226 ft
United States
Offline

MarkusXL Posted at 7-30 07:08
Well, Python 3.x is like, what, 12 years old now?  I really really really doubt they used any branch of Python 2.x.  It's all over Best Practices not to use 2.x anymore, unless you absolutely need some kind backward compatibility, which I can't imagine was needed.

It is probably, a limited branch of 3.x, so not all modules will be there.  I was very happy the math module is there.  No need for f strings since the S1 cannot do any kind of print() that I can see.  Nor can it manipulate or create new files, as it has no File System per se.

You can print to the console, in the app.

When I was doing some experiments, the error messages included a path to the file causing the error, so there is certainly a file system on board.
2019-7-30
Use props
MarkusXL
lvl.4
United States
Offline

gpvillamil Posted at 7-30 08:22
You can print to the console, in the app.

When I was doing some experiments, the error messages included a path to the file causing the error, so there is certainly a file system on board.

Really!  Cool I tried printing some stuff but could not see where the text was going.

What do you mean print to console?  What is the console in our case?  In app, in the FPV viewscreen, or?

Yes of course there is a file system, there would have to be, but our access to it is pretty much limited to seeing pathnames in the error messages.

Now I'm dying to get home from work to try f strings and print statements...
2019-7-30
Use props
rhoude57 - YUL
lvl.4
Canada
Offline

MarkusXL Posted at 7-30 09:46
Really!  Cool I tried printing some stuff but could not see where the text was going.

What do you mean print to console?  What is the console in our case?  In app, in the FPV viewscreen, or?

The Console appears in the PC Windows version of the RoboMaster S1 program, at the bottom of the screen.

It's interesting to note that the Console only appears once the S1 is connected to, meaning Python probably runs native on the Intelligent Controller. This can have significant impact on response times when running programs on the S1 and would certainly be good news.

2019-7-30
Use props
fansc61ebd52
lvl.1
United States
Offline

My biggest worry is that this is a customized version of Python developed by DJI that only run on the S1 virtual platform... Which makes debugging extremely hard (given that there is literally zero documentation so far).
2019-7-30
Use props
rhoude57 - YUL
lvl.4
Canada
Offline

fansc61ebd52 Posted at 7-30 11:46
My biggest worry is that this is a customized version of Python developed by DJI that only run on the S1 virtual platform... Which makes debugging extremely hard (given that there is literally zero documentation so far).

I sure hope that the RoboMaster S1 firmware is based on the big brother's RoboMaster  Real-Time Strategy (RTS) framework.

https://github.com/RoboMaster/RoboRTS-Tutorial

The RoboMaster uses the Robotics Operating System (ROS) as the pivot of the robot's entire computing framework. The Python API actually runs on the micro-controller as a ROS Node.

Fingers crossed...

Perhaps DJI is waiting to see who it is buys in to the S1... People looking for nothing but a toy... or serious roboticians looking for something to really sink their teeth into with spending the mny thousands of dollars a RoboMaster Standard Robot Kit costs???
2019-7-30
Use props
xiaoyuejin
lvl.1
United States
Offline

But they can support both toy players' and programmers' need right now, if they want to. The only reason that this is not happening, as I can see it, is that the serious players are two orders of magnitude less than the toy players, so the market is small and they simply don't care.

And, my sincere hope is that the S1 robot can support extensions of different kinds. Again, there is no technical difficulty (DJI has it in the pocket). But maybe that is not good for business?
2019-7-30
Use props
gpvillamil
lvl.4
Flight distance : 210226 ft
United States
Offline

I tried a hacky way of detecting major Python version, and it suggests that Python 3 is installed, probably 3.5
This is on iOS, you can see the console output at the bottom.

C627C254-2F6B-4B1D-8C20-640D50BEEF0B.png
2019-7-30
Use props
xiaoyuejin
lvl.1
United States
Offline

Did you try raw_input()?
2019-7-30
Use props
MarkusXL
lvl.4
United States
Offline

Oh THAT Console!!!!!!   Wheeeeeee!!!!   Dang that helps soooooooo much!  Printing variable AND WHATEVER because this code works!

A = 0
def start():
    global A
    A = 0
    for count in range(1000):

        A = A + 1
        print(f'VAR A is {A}')
         
As far as I know, f strings only came into Python at around 3.6

But this is GREAT!   Being able to print and format the print wowowowowow
2019-7-30
Use props
Duke blindlight
New

China
Offline

python 3.6.6
2019-8-23
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules