FRC Programming Course - Share Your Methods

In today’s FRC the programming resources teams have available to them are extensive starting from what we have with the WPILIB Documentation, to the 3rd party resources provided by other teams and suppliers, and then the numerous code examples you can find here posted to comply with R303.

This offseason we’ve started down the path of getting our new students started out programming with the XRP robots since we were able to acquire a number of them for cheap with the education discounts. This was a good transition from introductory basic programming into some FRC specific code and the command based framework.

What I’d like to see are the approaches and methods teams are using to help transition to the next steps of FRC programming. There are so many advanced topics and features to cover to be successful at the mid-high end of FRC and the transition to those topics still feels very awkward and challenging for me even today. We have access to a great offseason build robot that we plan to reprogram as an exercise toward the end of familiarizing and building confidence in certain skills, but the best way to go about introducing certain concepts is still a bit fuzzy to me.

Seeing the work done by the frcdesign.org team has made me think that it feels like we really could use an equivalent programming and controls resource put together by the community to help bring up the floor of software development in FRC beyond just reading through hundreds of different team’s code.

10 Likes

https://docs.wpilib.org intended to be that programming and controls resource in an official capacity. It lacks up-to-date mid-level tutorials though due to lack of contributors, which I assume is what this proposal is trying to solve. We’ll see if the refactor mentioned in Documentation Reformat · Issue #2821 · wpilibsuite/frc-docs · GitHub helps things.

There’s a lot more software/controls information to cover than one would think; the PDF version of frc-docs is 1462 pages as of today. You may have an easier time modifying the existing resources than making something from scratch, though the sheer volume of information resists refactoring.

5 Likes

More than calling for a replacement of WPILIB as the learning source for FRC programming I’m interested to know what internal learning tools and resources teams might have created to teach their kids how to code to their standards. I can tell from a glance that a team like Mechanical Advantage is working on a coding course that introduces their kids to code to their standard.

One thing I strong think could improve things is a fusion and direct reference of WPILIB’s topical explanations of things like PID with the existing WPILIB example programs would go a long way to solving the gap that I see in the documentation as it exists today.

This page

Does not refer the user to any of these specific examples.

Additionally I also think an improvement would be a walkthrough of these examples. I understand that the code is commented in almost every case to explain what it happening, but that’s not what I consider an ideal way of teaching something.

If I had the free time on my hands I’d volunteer to do some of what I’m suggesting, but right now I don’t yet.

3 Likes

The thing we still struggle the most with isn’t how to program for FRC, but how to learn Java, every resource I’ve tried so far like Code Academy and the like has just bored the kids to never want to touch code. While I know it isn’t practical due to volunteer resources, it would be neat to have wpilib docs, frcdesign, etc to teach java/programming in a more interactive way with the robot and hardware to help keep their attention during the “boring” stuff like what’s a variable, what’s a method, etc.

The other thing we struggle with is just how to use a computer/windows in general, most of our high school kids have no idea how to turn a computer on/off, log in, what’s a file explorer, whats a folder, etc. Chrome books are great and all, but has hurt this area a bit.

3 Likes

Simulation is an extremely underutilized tool for this as well; it’s hard to give every student their own reliable robot. AdvantageScope even has a 3D field display.

2 Likes

Agreed, 100% guilty here for sure of not using it enough for training. I will say though our kids do tend to want to work with the real thing, but AdvantageScope does kind of help fill this in which we’ve yet to fully explore.

We do these two activities in parallel. For the one day a week two hour team session the students learn Command-Based programming and make their Romis move. They have a homework assignment for the week of a few sections of the codeHS beginning Java course. The students at least get to control their environment and pace for the online Java course. Still they need a lot of urging to do the online sections (coach can track student progress).

The above doesn’t address OP’s request. For more advanced programming the experienced students have projects to do such as use CTRE swerve generator, or look at why the LL megatag2 isn’t working well enough to use in competitions, or let’s try Choreo this season and improve using PathPlanner if that is appropriate. With increased student numbers this season we added a rookie FRC team to keep the freshmen and sophomores busy, too. All this keeps the few mentors very busy.

1 Like

Would concur, this is generally not a great way to learn, especially if there isn’t someone who already fully understands the other codebase and can guide.

We intentionally put together our own barebones, “minimum you need to know” training for. GitHub - RobotCasserole1736/pythonTraining: Basic software team training for Python

It intentionally skips a ton of topics, focusing only on what (our team believes) is the bare minimum a new student needs to start making changes to our own codebase. Historically, students are able to rip through that training in a few meetings (or, even, on their own since it’s just in a browser).

The next steps for us are usually to get a basic tank drive robot (with pwm motor controllers) driving around. Then some basic autonomous.

From there though… it’s rough. Usually they know enough to contribute to a bigger project under guidance, but I’ve yet to figure out the secret sauce to trigger a student into being self supporting.

But also

3 Likes

Can I offer a similar, but alternative suggestion: Publish sample code that aligns with the the tuning tutorials ?

A big gap in bringing PID examples to life is the fact that they only work if you know what the underlying hardware is (which examples are leery to assume). Having a tuning tutorial to reference at least constrains that hardware choice. Also lets the theory page remain focused on theory.

There’s a lot of learning research and instructional theory that is required for developing resources like frcdesign.org. For context, I pretty much spend most of my time reading literature and learning about current theories about learning.

Additionally, although it seems like frcdesign.org appeared out of nowhere, it was in development for about 6 months before release with testing in an an online design learning community, and the initial paper creating the framework was actually written in March 2023. I personally have been interested in learning research since early 2022.

(We also have a conference paper in progress :eyes:)

In addition, you kind of need to get lucky and a lot of the stars need to align just right in order to find the people who are able to projects like this to a decent state. You need to have people deeply knowledgeable about the topic, interested in making good content, and have the unholy amount of free time to dedicate to it without pay and are dedicated in the mission. I am incredibly lucky to have the current team and I don’t think it would be possible without them.

There has been discussion and some theoretical frameworks based on learning research has been made for teaching programming for frc, though to be honest, it’s not really my current focus right now so most stuff is just in theory for fun. It just requires a lot of time and effort and research/course development for frcdesign is my current focus.

For anyone who wants to give it a try anyway, I wish them luck.

10 Likes

image

6 Likes

Education is such a glorious freaking mess. Doubly so science ed… Some of the old psychology literature on spatial reasoning is fascinating.

Did you know spatial reasoning is a better indicator of stem success than raw math skill? (Ill see if I can find the paper)

Maybe not so suprising in retrospect… Coding, cad (and a lot of engineering), any of the natural scienes, and a very large branch of mathematics can be highly spatial in nature.

Edit i guess the stat is:

“over 1/2 of the top 1% scorers on spatial thinking test more than 3% below on math and verbal on the SAT”

(still looking for the paper, may have to ask the geo-science ed prof for it)

2 Likes

Funky. In my world 0.5% is noise that is summarily dismissed.

To be clear I just like learning how people learn so I can help them learn better.

But if someone made up their own facts about how people learn and then advertised them as real facts, well, that person is just a jerk.

In this case I think they had a pretty substantial sample (thousands) of SAT scores, so the SNR was better, but that’s off memory, not me reading the data/methods

I think the take home here is that spatial reasoning is very important in stem, perhaps moreso than other skills we stick on a pillar.

If I find that actually paper with the stat frim the study (and remember) ill try to link it in.

1 Like

I have used this with mixed success… unfortunately, programming patterns aren’t very FRC-ish.

But students seem to enjoy the “gamification” of learning java.

https://robowiki.net/wiki/Robocode

Hi! I’m the Programming Captain of 1923, and this is something I’ve been working through myself. FRC programming has so much to learn for a new programmer, and more keeps getting added on. I know it’s possible to learn-- I started FRC with zero FIRST experience and zero Java experience and now I’m here–but it’s tough and intimidating. Also, my team has 154 members, so we get ~20 new programmers each year in addition to returning programmers. I’ve been trying to figure out how to give EVERYONE the best experience.

My team runs yearly Foundations for all of our subteams, so that new team members are prepared for the season and returning members can get a brush-up. Our Programming Foundations have improved significantly since my freshman year. The thing I saw that made the most difference was more opportunities for testing and asking questions, with less teaching. We’ve been splitting our programmers up into groups of ~4 with just one laptop, and having them switch who is typing periodically. This is to make sure that nobody gets left out, and forces ideas to be shared around. Then, we teach a minimum to get the groups up and running, then give them challenges. The summer of my freshman year, my programming leads tested some new programming tutorials on a small group, so I had the time to struggle through making the robot work. This was what made me realize I loved programming robots, and it’s also the accurate preparation for how a season actually goes. So I’ve been trying to pass this experience on as best as I can to everyone on our team.

But, there’s only so much lab time and only so many hours that people are willing to commit, especially when they’re just getting started. So, my current programming mentor/former programming captain and I are working on an FRC programming course, made up of web videos and projects as part of the mission4stem project. This course can be completed purely in simulation, which cuts out the bottleneck needing to be in the lab and dividing a single robot’s time among many students. On our team, this has people to dig in and get a lot of experience on their own time. We are working on expanding the material in this course; we want this to end up being that programming equivalent to frcdesign.

Here’s the link to the Chief post with more details, we’d appreciate it if you took a look! Introducing mission4stem.com - A Free & Fun STEM Education Platform

3 Likes

Team Paradox 2102 has an in house series of Mini robot designs (like XRP) to teach our programmers. The main feature is a subset of WPILIB running on a PI4 platform. This allows the MiniBots to be programmed exactly like FRC robots. No relearning.
Level1 is an XRP style turtle bot.
Level2 adds a shooter and camera for auto/vision/navigation skills
Level3 is a swerve platform for motor controls and tuning, Kinematics, advanced Navigation and maneuver. Using the same shooter and camera.
The Swerve platform is new this year, Out students are just starting to learn on it.
Our plan is to release the MiniSwerve and training materials, as opensource, soon–but maybe after champs. In the future we are working on offering Hardware/Electronics kits to be completed by 3d printed parts. We will also develop a “train the trainer” workshop and materials do advanced teams can help newer teams enter swerve competency.
for more technical detail see: About – Robotics Programming
Use this form if you want to stay informed of our offerings.
image

2 Likes

Everyone has the Simulate Robot Code. I’ve accomplished a lot of controller experiments with simulated devices.

We developed a pretty good educational program for FRC programming students, designed to start from the very beginning (no Java knowledge) and bring them to competent robotics programming.

We start with Java education. The students learn datatypes, variables, control structures, arrays and basics of OOP up to and including interfaces, but not Lambda functions, streams and more advanced concepts (that happens in Phase-3).

Then they start a series of robotic programming exercises we designed to go from simplest one (enable robot, press a button on a joystick, print a message on a console), to the progressively more advanced ones, learning all normal “regular” robotics devices (motor controllers, encoders, pneumatics).
This is also the time when they learn basic FRC programming-related maintenance - flash images with rio imager and balena etcher, software install and update, limelight and photonvision calibration, firmware updates for CTR and REV components, robot log analysis etc.
After that we get them to program a simple drivetrain for the tank robot (we have old bots from prior years we use for all this).
After that they learn basics of PID and PID calibration.
After that they learn auto driving and trajectories as well as details of autonomous and more advanced commands. This is also time where we introduce lambda functions, suppliers/consumers and streams in their Java education.
After that they learn basics of vision, both Limelight and PhotonVision, and image processing via neural networks.
Finally we go through a design and implementation of the swerve drive, which (in my opinion) is the most difficult one to understand in detail and program from scratch (we let them follow examples and modify existing code we created).
Overall the program takes close to 6-7 months to make a student fully productive. However, even the first years enjoy the program. In our case it takes 2-3 programming mentors, depending on the number of students to get things running concurrently.
Note that we do not have robotics as part of the school curriculum, so all relevant education is done in the frc program as an after-school activity. We feel that programmers have the highest barrier to entry in the frc, so we continue to run the program in a summer, and throughout the year.

If interested, I can share the details of the various stages of the program, programming exercises etc.
We do not have the whole process currently written down in a systematic way. But it seems to work. All of our code is always public (so we’re in compliance with R303), as we feel that this benefits the community, and we occasionally teach other team members from our sister teams in the community. We also record quite a bit of our educational content and publish it online. Our team’s web site has close to 200 hours of educational video content related to programming specifically.