Python & C with Robotics?

So we’re planning to use Robot Mesh software with our VEX EDR robots… I chose python because it’s a good starting point before going to C…

We learnt basic python on Treehouse (Codecademy wasn’t sufficient because it didn’t really teach apply, but thats not the problem here)… Now I want us to move from the basics of python programming to python we can use to actually program the robot…

Would it be best to do Treehouse? (it does a little too much “Web” stuff for my liking)

Would another site be better for going into more python fundamentals for robotics specifically?

Should we just move into C now that coders are comfortable with the coding environment and the absolute basics of python (albeit web python)?

For Treehouse this is what they have learned so far… Would it be good to go into OOP (are they even teaching the right things for OOP or is that still web based stuff?) Object Oriented Programming “Syllabus”

So far they learned in Python: I’m not sure what’s missing / needed for robotics programming, especially with robot mesh

  • Variables
  • Functions
  • Manipulating Strings
  • Manipulating Lists
  • Booleans
  • Conditionals
  • Loops (For & While)
  • If, Else, Elif Statements
  • Try & Except
  • Input (For web application)
  • Indexes
  • Continue & Break
  • Python Shell

I can’t speak to how well the Robot Mesh Python code will work in a realtime environment or what the experience with that system is like, so my advice will be quite general. (And you probably shouldn’t listen to me too much since I’m not really experienced with that software.)

Looking at the list of concepts you’ve covered and the sample Robot Mesh code, your students probably need some basic understanding of OOP to use Python with Robot Mesh. Python is heavily object-oriented, and all library methods are generally wrapped in objects that you have to instantiate, etc. While they probably wouldn’t need to define their own objects, they’d certainly need to know how to use objects from a library, what a method/instance variable is, etc.

What do you mean by “web Python,” too? Looking at the Treehouse site, it appears they’re teaching students to use


input()

for gathering input, which is exactly what you’d use in the shell.

From big-picture standpoint analyzing languages instead of specifically Robot Mesh:

Intuitively, I’d think that this might be somewhat limiting as they get more serious in their code, as Python is notoriously slow and we’re on tiny systems. But, if they’re doing some kind of compilation step in the backend to run this in a non-interpreted form, that could compensate; I’ll leave speed comparisons to someone who’s actually used both C and Python for robots.

C still is pretty much the “standard” in embedded systems programming, and it will put your students in good standing for anything EE/CpE if they know C. Further, C is not object oriented, and so that’s one less item you’d need to cover in learning… and learning new programming languages deepens your understanding of programming in general.

Python is starting to become a more popular introductory language at the college level, but during my time TAing students who started with C-like languages and those who started in Python, the abstractions of Python postponed some of the difficulty in learning more fundamental structures until they met assembly code and pointers head-on. This may or may not be relevant in your case, however (e.g. if you’re dealing with high school seniors who want to major in engineering, teaching them C will be giving them a huge advantage even if it’s hard, while people in middle school/early high school probably still have time to transition later and might benefit from a longer “ramp-up”).

That said, as a now professional software developer and sometime data scientist, Python is my go-to for quick scripts, high-level data processing, etc., while C/C++ are still my languages of choice for high-performing, low-level code.

Anyone else?

@TitanRey15
So I recommend you start by just watching a video series on C (python is much easier to learn so you could learn that too, but most robots are programmed in C). After that, for VEX EDR, you really only need to know the basic syntax, as the rest is from the API of the library you’re using. Oh, one thing you need to know for sure is how libraries work (and how they organize functions, return types, parameters, etc). For me, I knew Java and some other languages beforehand, so picking it up only took around a week at most. Basically, just start reading about RobotC or PROS’ library once you’ve gotten the real basic stuff down… It helps more to actually start coding for the robot than to try and learn the entire language beforehand.

There are literally no Robot C or PROS video series though… And what if we want to use Robot Mesh as a starting point? We’ll go into C later… Are there robot mesh videos? like an actualy tutorial not some failed series. @danielpyon

@Highwayman made a series of PROS tutorial videos.

As for learning Robot Mesh Studio, maybe @Rick TYler or someone else from Robot Mesh could comment on that.

@Rick TYler I remember you saying after the V5 was released you’d make some tutorials? I know theres (https://www.robotmesh.com/docs/vex-iq/activity-guide/blockly/Default.htm), but if you’re making anymore tutorials please let me know!