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: https://github.com/robotpy/pyrobottraining
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.
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ā¦
-
Learn Hello World.
-
Talk about functions.
2.5. Passing by reference and passing by value
-
Talk about classes and objects.
-
Class inheritance
-
Java interfaces and lambdas
-
Print a message from the console. Figure out how command based programming works.
-
Make a drivetrain for teleop.
-
Use encoders to control that drivetrain with bang-bang control.
-
Use an ultrasonic to control the drivetrain.
-
Use a lidar to control the drivetrain.
-
PID Control on a motor.
-
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:
http://stemrobotics.cs.pdx.edu/node/4196?root=4196
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.