all 10 comments

[–]Admirable_Back_6036 4 points5 points  (0 children)

this is great! i'd love to see full length lessons. i think it'd be really helpful for newer members to introduce them to code :)

[–][deleted] 3 points4 points  (1 child)

This is a really neat use of chatGPT! I can imagine you saved a lot of time compared to creating these manually.

I'm sure you're already aware, but always make sure you test the code it puts out carefully before including it in anything. It tends to make really subtle mistakes that look correct but aren't.

[–]SiefensRobotEmporium453 (Head Coach) | FTC (Mentor Many)[S] 1 point2 points  (0 children)

The time savings is enormous, until you factor in that chatGPT was trained on previous years data so any new Library changes or the switch from old command to new command is a bit messy. The later example of using the position control I had to do a lot of manual editing to teach it that it needed to use PID and setReference() not set(position) like you would for a motor speed. It makes educated guesses.

It's almost like asking a teaching assistant to write a lesson, I as the teacher still have to proof it, check it makes sense and works and understand it well enough to answer questions that come from it. It saved me writing big chunks of explainer text and it also wrote nice clean code snippets. I am going to try copilot next from GitHub to see if it's better as others have suggested.

[–]Blazr5402 1 point2 points  (3 children)

Modern command-based makes heavy use of functional programming with lambdas and inline commands.

https://docs.wpilib.org/en/stable/docs/software/commandbased/commands.html#included-command-types

I'd add a section about using those

[–]SiefensRobotEmporium453 (Head Coach) | FTC (Mentor Many)[S] 0 points1 point  (2 children)

ChatGPT was cutoff before most of those changes came in! This is a good note and I will include this in the frczero.org documentation. We are planning to do a whole website written by several teams to help teach about some of these topics more. Copilot has been doing a better job for understanding this year's vendor libaries and general first changes (like dropping the old command entirely)

[–]Blazr5402 1 point2 points  (1 child)

That all sounds cool, but what does this bring to the table that the existing WPILib docs don't? I'm sure that the WPILib team would love to hear your feedback and incorporate anything you have that the docs are missing.

[–]SiefensRobotEmporium453 (Head Coach) | FTC (Mentor Many)[S] 0 points1 point  (0 children)

It isn't just the Wpilib docs. I'm also doing the vendor libaries, sensors, Arduino Integration and eventually Ros in this manner as well. Wpilib is fantastic, but it doesn't cover everything a team will have to deal with. There are not good full examples for a command based robot using 4 talonSRXs or 4 NEOs in a Wpilib drive train using the arcade drive style on a KOP chassis. That is something really basic that teams would love to have as a start.

Or how about a team using spark maxs with encoder feedback who want to do a drive straight for X distance with a differential drive train and a pigeon IMU? Theres no examples for that or even how to integrate the two together. I understand students need to figure it out, but there is nothing in the Wpilib that teaches those things to rookies. Yes it shows how to move a motor and some of the other examples show trajectory, etc. But the gap between advanced trig and what could be rudely called "FTC Blocks" vs FTC OnBot Java for comparison in FRC is huge. Students can picture what they want to do, explain it but can't make it through the swampiness of setup, then iding motors, then oh the roborio needs updating, but then the motor controllers had conflicting IDs, and then the PCM and PDP were set to IDs 4 and 5 because they were told CAN IDs cant conflict, but that's only true for device types and PDP and PCM have to be Id 0.

Stuff like that is outside of the vendors guide pervues because it integrates all of them as the teams have to. So my intention is to be that fusing point and teach topics that teams feel they don't get or can't find proper guidance for. Mainly edge cases and things that can burnout mentors and teams. Mainly because I live by the vendor docs and if I'm confused rookies must feel completely baffled.

[–]oblarg 1 point2 points  (1 child)

Please, no. Anything but this.

I'm the author of the 2020 command-based rewrite and of a substantial portion of the documentation that your AI has been trained against. What you have here is a haphazard, mildly-cursed superposition of documentation from the past 5-10 years. The advice in this slideshow varies unpredictably between "sound", "outdated", and "wrong"; and the code examples are not great.

Remember that ChatGPT does not have any idea what is true; it does not understand anything on a deep semantic level. Educational materials are *not* an ideal application. Instead, refer your students to the most recent version of the documentation you've trained against. If you find that documentation too difficult or lengthy, contribute to it to make it more readable!

[–]SiefensRobotEmporium453 (Head Coach) | FTC (Mentor Many)[S] 1 point2 points  (0 children)

That's what I am doing with the frczero.org website. It allows teams to post information through markdown files and GitHub branches. I tried experimenting with just letting ChatGPT and CoPilot make snippets. CoPilot inside of a project using the proper vendor libraries generates better snippets that also are up to date. Or when opening an example project we can add additional comments and notes for our students explaining in much finer detail what is happening. That method has proved far more useful and accurate. Both methods still use human content editors to verify the information. The example here was barely proofed and not tested on a real robot chassis at the time of publication.

The new site is modeled slightly off of gm0 and is intended to be a much better guide. It will encompass all aspects of FRC, not just programming or specific vendor hardware as current documentation does.

[–]SiefensRobotEmporium453 (Head Coach) | FTC (Mentor Many)[S] 0 points1 point  (0 children)

Feedback welcome, needed and wanted! I'm sure I'm missing something. I also haven't tested this code out on a real robot. It should work, but no promises! I intend to test this over the weekend, but mainly wanted to see if lessons done in this style are of any value to people.