examples
examples copied to clipboard
Add necessary examples to be linked from frc-docs
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:
- [x] addressableled
- [x] armbot
- [x] armbotoffboard
- [x] drivedistanceoffboard
- [x] elevatorprofiledpid
- [x] elevatorsimulation
- [x] elevatortrapezoidprofile
- [x] frisbeebot
- [x] gettingstarted
- [x] gyrodrivecommands
- [x] hatchbotinlined
- [x] hatchbottraditional
- [x] mecanumdrive
- [x] mechanism2d
- [x] ramsetecommand
- [x] schedulereventlogging
- [x] selectcommand
- [x] statespaceflywheel
Here are additional examples that need to be created too:
- [x] AprilTagsVision (#107)
- [x] Arcade Drive Xbox Controller (#83)
- [ ] Axis Camera Sample
- [x] DifferentialDriveBot
- ~[ ] DMA~
- [x] Duty Cycle Encoder(#91)
- [x] DutyCycleInput(#91)
- [x] Encoder
- [x] Gyro Mecanum(#91)
- [x] HID Rumble(#91)
- [ ] MecanumControllerCommand
- [x] PotentiometerPID
- [ ] Power Distribution CAN Monitoring
- [x] RamseteController(#91)
- [x] Relay
- [ ] RomiReference
- [ ] SimpleDifferentialDriveSimulation
- [x] Solenoid (#82)
- [ ] StateSpaceArm (#101)
- [ ] StateSpaceDriveSimulation
- [ ] StateSpaceElevator (#101)
- [x] StateSpaceFlywheel(#101)
- [x] StateSpaceFlywheelSysId(#99)
- [x] SwerveBot
- [ ] SwerveControllerCommand
- [x] Tank Drive Xbox Controller (#84)
- [ ] Traditional Hatchbot
- [x] Ultrasonic(#85)
- [x] UltrasonicPID(#94)
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: