examples icon indicating copy to clipboard operation
examples copied to clipboard

Add necessary examples to be linked from frc-docs

Open virtuald opened this issue 3 years ago • 15 comments
trafficstars

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:

virtuald avatar Apr 28 '22 04:04 virtuald

@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 https://github.com/wpilibsuite/frc-docs/pull/2019, but obviously there's a lot more.

virtuald avatar Jan 07 '23 02:01 virtuald

@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 https://github.com/wpilibsuite/frc-docs/pull/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!

BerkeSinanYetkin avatar Jan 07 '23 04:01 BerkeSinanYetkin

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). :)

virtuald avatar Jan 07 '23 05:01 virtuald

seems like we got everything rounded up

BerkeSinanYetkin avatar Feb 06 '23 22:02 BerkeSinanYetkin

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

jasondaming avatar Dec 01 '23 06:12 jasondaming

A bunch of those examples are in the commands subdirectory.

virtuald avatar Dec 02 '23 19:12 virtuald

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.

jasondaming avatar Dec 03 '23 20:12 jasondaming

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)?

auscompgeek avatar Dec 03 '23 22:12 auscompgeek

Yes, the groupings suck. I like the organization idea in https://github.com/robotpy/examples/pull/74?

virtuald avatar Dec 03 '23 22:12 virtuald

The list above has been updated

jasondaming avatar Dec 08 '23 03:12 jasondaming

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:

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

jasondaming avatar Dec 21 '23 01:12 jasondaming

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

Suave101 avatar Jan 08 '24 02:01 Suave101

Should be updated now.

jasondaming avatar Jan 08 '24 15:01 jasondaming

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

Suave101 avatar Jan 08 '24 23:01 Suave101

Additional examples that need to be ported. I saw a few in PRs.

jasondaming avatar Sep 01 '24 20:09 jasondaming