robotpy/examples

Add necessary examples to be linked from frc-docs

virtuald opened this issue · 15 comments

If RobotPy is to be included in frc-docs (see initial PR), then we need to have existing working examples that can be linked to from the documentation that match the WPILib examples closely. By running the following on frc-docs:

grep -r --no-filename remoteliteralinclude * | grep java | sort | uniq

I get the following examples required:

Here are additional examples that need to be created too:

I tried using ChatGPT to do automated translation of examples, and it's pretty good! Here's a prompt I started with that I got reasonable results with:

RobotPy code translator will translate code from WPILib Java to RobotPy python. The output python code is semantically the same as the original java code, and has identical comments. The output python code is complete and contains all of the code present in the original Java code. Here is the input code for the translator, output only the output code:

@mrguisamuel and @BerkeSinanYetkin (or anyone else) if you're interested, now that we have a lot of these examples someone needs to add them to frc-docs? I did one of them at wpilibsuite/frc-docs#2019, but obviously there's a lot more.

@mrguisamuel and @BerkeSinanYetkin (or anyone else) if you're interested, now that we have a lot of these examples someone needs to add them to frc-docs? I did one of them at wpilibsuite/frc-docs#2019, but obviously there's a lot more.

Can't we complete all of them and add them through a grand PR? In my timezone it is already kickoff day, examples we haven't done don't seem like a whole lot of work. Maybe we can divide the workload and finish all of them after kickoff?

Also, happy kickoff day everyone!

In my timezone it's almost 1am, and I still have a bunch of stuff left for the RobotPy 2023 release (mostly documentation at this point). :)

seems like we got everything rounded up

Still need all of these, here is the PR to add them. I noticed a few were on the list above as done but I couldn't find them in the directory:
SwerveBot
Axis Camera Sample
AprilTagsVision
Gears Bot
MecanumControllerCommand
SwerveControllerCommand
StateSpaceFlywheelSysId
StateSpaceElevator
StateSpaceArm
StateSpaceDriveSimulation
SimpleDifferentialDriveSimulation
DMA

A bunch of those examples are in the commands subdirectory.

That does not seem at all intuitive. I think that should be fixed. There are many other examples that could be grouped but aren't.

They're grouped by the commands dependency. I presume you mean we should group our CV examples (since we don't install OpenCV things on the robot by default)?

Yes, the groupings suck. I like the organization idea in #74?

The list above has been updated

Still need all of these, here is the PR to add them. I noticed a few were on the list above as done but I couldn't find them in the directory:

  • SwerveBot
  • Axis Camera Sample
  • AprilTagsVision
  • Gears Bot
  • MecanumControllerCommand
  • SwerveControllerCommand
  • StateSpaceFlywheelSysId
  • StateSpaceElevator
  • StateSpaceArm
  • StateSpaceDriveSimulation
  • SimpleDifferentialDriveSimulation
  • DMA
  • SysIdRoutine

Could state space elevator be checked off please? I accidentally ported the example when it was already written because I just looked at the list and my clone of the repo hadn't updated

Should be updated now.

The XRP Reference might need to be ported for the vscode-wpilib reference example:
https://docs.wpilib.org/en/stable/docs/xrp-robot/programming-xrp.html