Programming Curriculum

I am an engineering teacher at our school and I was thinking that it might be cool to expose students to programming by allowing them to program some old FRC robots from last year and the year before. Is there any tutorials or lesson plans that teams have developed that I could use to teach my class? I am a mechanical engineer so my programming skills in Java are very minimal so anything helps. Thanks.

My honest thought is that FRC robots don’t really make great vehicles for beginners, for a number of reasons:

  • they are large and heavy, and can (usually) go very fast, so there is a physical safety factor
  • they are inconvenient to transport
  • only one person at a time can deploy and try their code
  • the paradigm of being “inside” an iterative periodic loop is not immediately intuitive to a beginner programmer, when traditionally you write code “outside” the loop
  • There’s not actually a whole lot to program on an FRC robot for beginners - it is a glorified radio controlled car until you start getting into the more advanced stuff

Not to say don’t do it, just be aware of its limitations as a platform. It is very cool to watch, and the sense of gratification of moving a physical robot is much bigger than watching words appear on a screen, “Hello world” style.

On our team we built some little 2WD robot chassis’ based on Raspberry Pi with an L298 motor controller board wired to its GPIO outputs, then teach kids to write programs in Python to activate the motors and make the robots move. We have about a dozen of these “minibot” kits and we find them great for outreach workshops.

I agree that FRC isn’t a particularly good platform for this because of the reasons that the prior poster mentioned. However… if you’re open to using RobotPy, there’s a simulator you can use to allow students to experiment with code without needing a real robot to do so.

We had started a series of challenges that students can use to learn about programming robot stuff:

That is really Cool! Do you have the completed challenges and completed code that we can use as a reference?

Yep. I hadn’t decided on the best way to distribute them, but I’ll send you a copy.

I have now spent 8 seasons proving that FRC was a terrible way to introduce young’uns to programming. Even when we got a respectable CS090 curriculum together, the leap to coping with the command based java framework was almost unbridgeable.

Do Vex, get them to understand time and loops on top of algorithms, decisions and data structures.

I as a current team member, and being a pretty much entirely self-taught programmer would love to give you some tips on ‘teaching’ your student’s programming.

I have never seen much progress from ‘teaching’ someone how to program, simply because what programming is, in general, can’t be taught. Programming is something someone needs to experienced through practice. The BEST advice that I can give you to prepare your team for the robotics competition is to look at the plenty of example robot code(available in the Eclipse New Project Panel) and actually code a basic robot.

Doing it is the best way to learn it(from my experiences), having your kids sit down(the ones interested in programming) and code a robot will definitely prepare them for what is to come. I would definitely look at the examples, and be sure to always reference the WPILIB documentation and if using Talons or any other Cross The Road Electronics Appliances, the Phoenix Documentation for any questions you might have. Examples are a great starting place if you need to see examples of working code many teams post their robot code yearly on GitHub. You can easily get a head start on being ready by writing code for a small bot beforehand.

Here is a link to my team’s code from last year that you can reference if need be: 2017 Offseason Steam Works

I’ve been working on some 0 to robot programming tutorials. It’s not complete yet but it’s a start. The hard part is building up the programming basics… once those are there the robot part is easy.

1 Like

If they don’t know anything about Java, direct them to Code Academy and Tutorialspoint – Java. Usually, Team 135’s curriculum goes as follows…

If they do not know Java…

  1. Learn Hello World.

  2. Talk about functions.

2.5. Passing by reference and passing by value

  1. Talk about classes and objects.

  2. Class inheritance

  3. Java interfaces and lambdas

  1. Print a message from the console. Figure out how command based programming works.

  2. Make a drivetrain for teleop.

  3. Use encoders to control that drivetrain with bang-bang control.

  4. Use an ultrasonic to control the drivetrain.

  5. Use a lidar to control the drivetrain.

  6. PID Control on a motor.

  7. Motion profiling (if we ever have time).

While I keep saying drivetrain, typically these concepts can be applied to any motor or control unit. Usually bots aren’t that great for testing though. Try having some sort of test table with a motor, encoder, lidar, sonar, some sort of plate that lets you modify their distance reading from a surface, camera, and a square outline of reflective tape (usually i’d go for 12" by 12"). Additionally have a shaft handy for that motor. You can put it into some loose foam or other malleable materials to simulate the effect of friction on wheels.

Usually, there is a dedicated person doing camera tracking on our team due to the amount of overhead it requires. OpenCV has good tutorials and documentation written on the subject.

We have a basic curriculum that covers all 3 FIRST platforms at:

The FRC section does not have many examples due to the complexity of FRC robots but students can learn a lot by using EV3 or Tetrix robots.

Personally I would start them on arduinos. They are cheap, and can control most frc components with cheap add ons. Cheap sensors can be found for them as well.

Computer science education is a notoriously difficult topic. Intro to computer science classes have a fail rate on par with calculus and university physics.

FRC programming is not an ideal environment to introduce computer science, as many of us have realized. Utilization of a third party API, being thrown into the deep end of object oriented, and needing UI handling get the robot driving is not ideal.

What FRC programming excels at is giving students who already know the basics of computer science an opportunity to create something with their knowledge. CS is all about personal projects. If you don’t have a github full of personal projects by the end of your undergrad, you did something wrong. FRC starts building that portfolio early.