Skip to content

Commit

Permalink
converted some RST to MD
Browse files Browse the repository at this point in the history
  • Loading branch information
JediScoy committed Dec 11, 2023
1 parent 308bd71 commit d57d81b
Show file tree
Hide file tree
Showing 13 changed files with 402 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/source/controls/FAQ-for-beginners.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
------------------------------------------
FAQ and Getting Started with Programming
------------------------------------------

VS Code has some built in examples and templates to get you started. We
have uploaded some of the Timed Robot examples and Command Robot
examples to out Github page and compliled a list of other teams\' code
[here
\<https://cyber-coyotes-handbook.readthedocs.io/en/latest/controls/code-examples.html]().
The FRC community is very good about helping each other.

A few questions when helping new teams with code: ==== #. Are you using
a Timed Robot or Command Based code setup? We use command based, but
many teams starting out find it easier to used Timed because almost all
of the coding is done in one file (Robot.java) #. What drivetrain are
you using (mechanically)? I would guess Differential Drive for most
teams, especially younger ones. #. What drive mode are you wanting to
use? (tank vs arcade) Personal preference, but we recommend Arcade #.
Have you thought about what physical game controllers (xBox, Flight
joystick, etc) you have or want to use? Again, personal preference. #.
Do you have your code posted on Github? Highly recommended. This will
allow our team or other folks to view your code and offer assistance
from affar. See the [Github
tutorial](https://docs.github.com/en/get-started/quickstart/hello-world)
for help getting started.
8 changes: 8 additions & 0 deletions docs/source/controls/auton-pathplanner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
PathPlanner ==== We were unable to use PathPlanner with a SDS code-base
during the 2022 season. We have had pre-season success using Bear drive.

Resources \-\-\--\* [RDc12 -
PathPlanner](https://github.com/RDc12Programming/PathPlanner) github \*
[M Jansen4857](https://github.com/mjansen4857/pathplanner) github \*
[Introoducing PathPlanner 2.0 -
ChiefDelphi](https://www.chiefdelphi.com/t/introducing-pathplanner-2-0/397629).
57 changes: 57 additions & 0 deletions docs/source/controls/code-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
--------------------
Java Code Examples
--------------------

Timed Robot EXAMPLES from VS Code \-\-\--#. [Tank Drive (Timed
Robot)](https://github.com/CyberCoyotes/Example-TankDrive) #. [Arcade
Drive (Timed
Robot)](https://github.com/CyberCoyotes/Example-ArcadeDrive) #.
[Pneumatics (Timed
Robot)](https://github.com/CyberCoyotes/Example-Pneumatics)

Command Based EXAMPLES from VS Code \-\-\--#. [Traditional
Hatchbot](https://github.com/CyberCoyotes/2023-Example-TraditionalHatchbot).
Although the \"Traditional Hatchbot\" uses pneumatics, in my opinion it
is the most straight forward \"outline\" and the subsystem and commands
can be adapted to motors by looking at the drive subsystem and drive
commands. #. [Gears
Bot](https://github.com/CyberCoyotes/2023-Example-GearsBot). #. [Command
Robot \<https://github.com/CyberCoyotes/2023-Example-CommandRobot]().

Command Based Examples from Teams \-\-\--#. Cyber Coyotes [Code
Repositories](https://github.com/CyberCoyotes) \| [2021 Rapid React
code](https://github.com/CyberCoyotes/2022-RapidReact). #. [Falcon
Swerve](https://github.com/team364). #.
[Bearswerve](https://github.com/6391-Ursuline-Bearbotics/BearSwerve)
drive code #. [Swerve Drive
Specialties](https://github.com/SwerveDriveSpecialties) drive code #.
[Triple Helix](https://github.com/TripleHelixProgramming/offseason-2022)
drive code

FRC teams to follow \-\-\--The following includes some teams that have
been very helpful to our learning.

- Citrus Circuits [Website](https://www.citruscircuits.org/) \| [2022
CAD and
Code](https://www.citruscircuits.org/2022-cad-and-code-release.html).
- Enginerds - Team 2337 [Github](https://github.com/Team2337/) \|
[2021 Skills
Bot](https://github.com/Team2337/2021-Skills-Bot/tree/main/src/main/java/frc/robot).
- Raptors - Team 1711 [Github](https://github.com/frc1711).
- NCGears - Team 1918 [Github](https://github.com/ncgears).
- Jack in the Bot - Team 2910 [Github](https://github.com/FRCTeam2910)
- Team Fusion - Team 364 [Github](https://github.com/team364)

Tutorials \-\-\--#. Sen Sun [FRC 0 to
Autonomous](https://www.youtube.com/channel/UCmJAoN-yI6AJDv7JJ3372yg).
Helpful tutorials with video and code examples #. WPI Lib [Creating and
Following a
Trajectory](https://docs.wpilib.org/en/stable/docs/software/pathplanning/trajectory-tutorial/creating-following-trajectory.html).
#. Team 2910 [Path Viewer](https://github.com/FRCTeam2910/PathViewer).

Things for us to Follow up \-\-\--#. Lamda Corps [2022 Rapid
React](https://github.com/Lambda-Corps/2022_RapidReact) #. [FRC 6995
NOMAD](https://github.com/frc6995) #. [Cyber
Dragons](https://github.com/SOTACyberdragons/FRC-Robot-2020/blob/master/src/main/java/frc/robot/oi/limelightvision/limelight/ControlMode.java).
#.
<https://www.chiefdelphi.com/t/frc-95-the-grasshoppers-2023-build-thread/419845/>
88 changes: 88 additions & 0 deletions docs/source/controls/command-and-declarative-programming.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
==== Command Based Programming ==== There are two approaches to making
an FRC robot: **Imperative**, and **Command-Based**, of which we use the
latter.

Imperative \-\-\--Imperative is like designing a linear list of orders
for the robot to follow. It\'s hard to properly communicate the
differences between the two philopsophies in a tl;dr format, but the
cliff notes are that Imperative is what most inexperienced people would
default to. While it\'s easier in the very short term, the drawbacks are
too large to be viable; added maintenience, dependency, and ambiguity in
control flow are all reasons to avoid imperative.

Command Based (and declarative) \-\-\--Command based is like designing a
set of rules for the robot to follow. A quick distinction is in order:
\"Command-Based\" refers to the way robot properties and actions are
broken into **subsystems** and **commands**, with a large arsenal of
classes and functions to help with the subsystems and commands.
\"Declarative\" programming is the \~\~programming Paradigm\~\~ more
sustainable, effective method of programming that goes with
command-based like PB+J. For this reason, they will often be grouped
together as simply \"Command-Based\" (occasionally, \"sane, functional
human being code\")

\# A quick table, summing up the uses \<table\> \<thead\> \<tr\>
\<th\>Issue\</th\> \<th\>Imperative\</th\> \<th\>Command-Based +
Declarative\</th\> \</tr\> \</thead\> \<tbody\> \<tr\> \<td\>Quick
prototyping\</td\> \<td\>Good; makes it easy to prototype simple
code\</td\> \<td\>Not needed; thinking about code structure for simple
tests and whatnot isn\'t needed,\</td\> \</tr\> \<tr\>
\<td\>dependence\</td\> \<td\>nightmarish; like soldering a lamp to a
socket\</td\> \<td\>Non-existent (if you\'re smart) due to much more
modular design\</td\> \</tr\> \<tr\> \<td\>Reading and
comprehension\</td\> \<td\>Fine for short snippets of code, \<br\>but
complex systems and developers will suffer greatly from the inherent
\<br\>lack of clarity\</td\> \<td\>Easier to separate each function call
and class into individual parts, \<br\>and debugging can be made much
easier (if you\'re smart)\</td\> \</tr\> \<tr\> \<td\>Issuing Robot
Orders\</td\> \<td\>Calling robot methods directly; easy to understand
for a whole 5 seconds,\<br\>dependencies will FESTER\</td\> \<td\>Robot
properties and actions are neatly fit into subsystems and commands,
\<br\>allowing for greater control and mental ease\</td\> \</tr\> \<tr\>
\<td\>reaction of pretentious team 1XX member\</td\> \<td\>dude what is
this youre disgusting\</td\> \<td\>this is so good marry me\</td\>
\</tr\> \</tbody\> \</table\>

If you yet hunger for perfection beyond Declarative, check out the SOLID
principles, one of the most popular set of guidelines for clean code out
there. I would recommend watching Tim Corey\'s videos on the principles.
They\'re boring as *redacted*, but they are presented carefully enough
to actually teach. Another caveat is that he uses C#. Even though he
uses a different language, the principles still apply in Java. Also, C#
and Java are very similar in basic syntax, with differences you don\'t
need to worry about yet.

Resources \-\-\--1. [Command-Based
Programming](https://docs.wpilib.org/en/stable/docs/software/commandbased/index.html)
FIRST documenation 2. [FRC 0 to Autonomous: #5 Command-Based
Robot](https://youtu.be/VoxeXqy1bdQ) video 3. [Overview - SwerveIO 5.0.2
User Documentation](https://javadoc.bancino.net/SwerveIO/latest/)

Trajectories \-\-\--1. [Trajectory Generation and Following with
WPILib](https://docs.wpilib.org/en/stable/docs/software/advanced-controls/trajectories/index.html)
FIRST documentation 2. [Introduction to
PathWeaver](https://docs.wpilib.org/en/stable/docs/software/wpilib-tools/pathweaver/introduction.html)
FIRST documentation *Not using with Swerve* 3.
[PathPlanner](https://github.com/mjansen4857/pathplanner/wiki) 4.
[Ramsete
Controller](https://docs.wpilib.org/en/stable/docs/software/advanced-controls/trajectories/ramsete.html)
The Ramsete Controller is a trajectory tracker that is built in to
WPILib. This tracker can be used to accurately track trajectories with
correction for minor disturbances.

Chief Delphi References \-\-\--1. [A Problem When Using Trajectory in
Swerve](https://www.chiefdelphi.com/t/a-problem-when-using-trajectory-in-a-swerve-drive/395400)
2. [Seeking Examples for Applying Trajectory Constraints to WPI
Trajectory](https://www.chiefdelphi.com/t/seeking-examples-for-applying-trajectory-constraints-to-wpi-trajectory/392813)
3. [Running Multiple Cameras - USB for front and back or side
viewing](https://www.chiefdelphi.com/t/is-it-possible-to-have-two-cameras/338519/2)
4. [3630 Stampede Robotics OffSeason Swerve Code
release](https://www.chiefdelphi.com/t/3630-stampede-robotics-offseason-swerve-code-release/398713)
5. AUTON help
<https://www.chiefdelphi.com/t/motion-profile-in-swerve-autonomous-mode/398318/7>
6. [Paper: 4 wheel independent drive & independent steering \"swerve\" -
CD-Media:
Papers](https://www.chiefdelphi.com/t/paper-4-wheel-independent-drive-independent-steering-swerve/107383)

White Papers \-\-\--1. [Chimera\'s Swerve
PDF](https://www.first1684.com/uploads/2/0/1/6/20161347/chimiswerve_whitepaper__2_.pdf).
3 changes: 3 additions & 0 deletions docs/source/controls/conventions-style-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-----------------------------
Conventions and Style Guide
-----------------------------
7 changes: 7 additions & 0 deletions docs/source/controls/ctre.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# CTRE

Cross The Road Electronics links - [Official Phoenix Pro
Documentation](https://v6.docs.ctr-electronics.com/en/2023-pro/index.html)

See also [links on motion
profiling](https://github.com/CyberCoyotes/Handbook/blob/main/docs/source/controls/motion-profiling.rst).
19 changes: 19 additions & 0 deletions docs/source/controls/history-controls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
------------------------
Team History: Controls
------------------------

A little history about our controls approaches.

2019 and Prior \-\-\--\* **Drivetrain**: Mecanum, tank drive,
rhinotracks, or omni wheels combined with others depending on the game
demands \* **Drive motors**: CIM motors mostly, switched to Falcons in
2019? \* **Gyro**: NavX \* **Programming**: *Iterative* Java

2022 Season Changes \-\-\--\* **Drivetrain**: MK3 swerve \* **Drive
motors**: Falcon500 motors \* **Programming**: *Command based* Java
adapted from SDS

2023 Season Changes \-\-\--\* **Drivetrain**: MK4 swerve \* **Gyro**:
CTRE Pigeon \* **Programming**: *Command based* Java adapted from
[BearSwerve](https://github.com/6391-Ursuline-Bearbotics/BearSwerve)
code base.
35 changes: 35 additions & 0 deletions docs/source/controls/leds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# LEDs

There (seems to be) two approaches to controlling LEDs on a FRC robot.
The REV Blinkin module or using the WPI Addressable with hooking up the
LEDs directly to the Rio. The terms **individually addressable** is a
reference to the ability of a program, app, or remote to make very
specific changes to the LEDs themselves whereas WPI AddressableLED is
program specific reference.

Using a Blinkin \-\-\--#. [Blinkin LED Driver
page](https://www.revrobotics.com/rev-11-1105/) and including the [PDF
manual](https://www.revrobotics.com/content/docs/REV-11-1105-UM.pdf) #.
[REV Robotics Blinkin Overview - YouTube
\<https://youtu.be/wMdkM2rr1a4\>]{.title-ref} #. [Cyber Coyotes Blinkin
Example](https://github.com/CyberCoyotes/LED-BlinkinExample). Based on
Sonic Squirrels example, but updated for 2023 codebase. #. [Sonic
Squirrels
Example](https://github.com/FRC-Sonic-Squirrels/MinibotCode/blob/5b58f10ef78b79384b12a69ffbe3fcba4775bba1/src/main/java/frc/robot/subsystems/blinkin.java)
#. [Mechanical Advantage
Example](https://github.com/Mechanical-Advantage/RobotCode2022/tree/main/src/main/java/frc/robot/subsystems/leds)
has Blinkin and Rio (Addressable) examples #. Chief Delphi
[blinkin-led-programming](https://www.chiefdelphi.com/t/blinkin-led-programming/339003)
#. Chief Delphi
[rev-blinkin-led](https://www.chiefdelphi.com/t/rev-blinkin-led/396966)

Using WPI Addressable \-\-\--#. [Addressable LEDs -
WPILib](https://docs.wpilib.org/en/stable/docs/software/hardware-apis/misc/addressable-leds.html)
#. [Mechanical
Advantage](https://github.com/Mechanical-Advantage/RobotCode2022/tree/main/src/main/java/frc/robot/subsystems/leds)
has Blinkin and Rio (Addressable) examples #. [Yeti
Robotics](https://github.com/Yeti-Robotics/aurora-java-2022) #.
[Ursuline
Bearbotics](https://github.com/6391-Ursuline-Bearbotics/2022_UARobotics_Rapid_React/blob/master/src/main/java/frc/robot/subsystems/LEDSubsystem.java)
#. Chief Delphi
[addressableleds-and-rev-robotics-blinkin](https://www.chiefdelphi.com/t/addressableleds-and-rev-robotics-blinkin/375753)
35 changes: 35 additions & 0 deletions docs/source/controls/limelight.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Limelight

\"Limelight is an easy-to-use smart camera for FRC.\"

See the Official Limelight
[docs](https://docs.limelightvision.io/en/latest/) and
[downloads](https://limelightvision.io/pages/downloads) page. The [quick
start](https://docs.limelightvision.io/docs/docs-limelight/getting-started/programming)
is a good place to start

## Links to Other Resources

- Limelight
[Post](https://www.chiefdelphi.com/t/limelight-2022-0-3-update/400306)
Chief Delphi
- [Basic Vision in FRC Programming -
YouTube](https://youtu.be/hk8yAgDogPE) Broward Botcats

## AprilTags

1. [Tracking AprilTags with
Limelight](https://docs.limelightvision.io/en/latest/apriltags_in_2d.html)
hardware and software **RELEASED Jan 10, 2023**
2. [AprilTag Introduction -
WPILib](https://docs.wpilib.org/en/stable/docs/software/vision-processing/apriltag/index.html).

## Code Examples

1. Lamda Corps [Limelight (vision)
Example](https://github.com/Lambda-Corps/2020InfiniteRecharge/blob/master/src/main/java/frc/robot/subsystems/Vision.java).
2. <https://www.chiefdelphi.com/t/frc-95-the-grasshoppers-2023-build-thread/419845/>
3. [FRC 2910
vision](https://github.com/FRCTeam2910/2023CompetitionRobot-Public/tree/main/src/main/java/org/frcteam2910/c2023/subsystems/vision)
4. [FRC 2910 - drive to scoring
location](https://github.com/FRCTeam2910/2023CompetitionRobot-Public/blob/main/src/main/java/org/frcteam2910/c2023/commands/DriveToScoringLocationCommand.java)
49 changes: 49 additions & 0 deletions docs/source/controls/motion-profiling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Motion Profiling ====

When controlling a mechanism, is often desirable to move it smoothly
between two positions, rather than to abruptly change its setpoint. This
is called "motion-profiling," and is supported in WPILib through the
TrapezoidProfile class

# WPI

For a description of the WPILib motion profiling features used by these
command-based wrappers, see [Trapezoidal Motion Profiles in
WPILib](https://docs.wpilib.org/en/stable/docs/software/advanced-controls/controllers/trapezoidal-profiles.html#trapezoidal-motion-profiles-in-wpilib).
Note: The TrapezoidProfile command wrappers are generally intended for
composition with custom or external controllers. For combining
trapezoidal motion profiling with WPILib's PIDController, see [Combining
Motion Profiling and PID in
Command-Based](https://docs.wpilib.org/en/stable/docs/software/commandbased/profilepid-subsystems-commands.html).
To further help teams integrate motion profiling into their
command-based robot projects, WPILib includes two convenience wrappers
for the TrapezoidProfile class: TrapezoidProfileSubsystem, which
automatically generates and executes motion profiles in its periodic()
method, and the TrapezoidProfileCommand, which executes a single
user-provided TrapezoidProfile. [Motion Profiling through
TrapezoidProfileSubsystems and
TrapezoidProfileCommands](https://docs.wpilib.org/en/stable/docs/software/commandbased/profilepid-subsystems-commands.html)

# CTRE

- [Motion Magic and other Motion
Profiling](https://docs.ctre-phoenix.com/en/stable/ch16_ClosedLoop.html)
with CTRE.
- [254](https://www.chiefdelphi.com/uploads/default/original/3X/a/b/ab808bbf5f212c6deba8565dac83852bbd9b4394.pdf)
PDF explaining motion planning
- [2019 Motion
Magic](https://docs.google.com/presentation/d/1zzMI3DW-elButNH0QLFdYnDyaIapeI-zZnv9CAC6WY8/edit)
slide presentation. Video of Corey Applegate (FRC 3244) [CTRE Motion
Magic](https://youtu.be/VQIgdLslU_E)

Come highly recommended [Team 195- FRC Motion Control: part
1](https://youtu.be/4rbT-oscpx0) BUT\... its from 2018 AND its 4.5 hrs
long for both parts

Additional Resources \-\-\--\* [Motion Profiling -
wiki](https://github.com/CyberCoyotes/Handbook/wiki/Motion-Profiling)
page \* [Telemetry
docs](https://docs.wpilib.org/en/stable/docs/software/telemetry/index.html)
docs page. \* [Control Modes Configuration for TalonFX and
Falcon500](https://www.chiefdelphi.com/t/control-modes-configuration-for-talonfx-and-falcon500/374704/12)
ChiefDelphi post.
25 changes: 25 additions & 0 deletions docs/source/controls/path-planner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# PathPlanner

\"PathPlanner is a motion profile generator for FRC robots created by
team 3015.\"

It is available from the [github
repo](https://github.com/mjansen4857/pathplanner) and in the Microsoft
Store. The [wiki](https://github.com/mjansen4857/pathplanner/wiki) is
kept up to date so I would check there for instructions and Chief Delphi
for tips & clarifications.

You must install
[PathPlannerLib](https://github.com/mjansen4857/pathplanner/wiki/PathPlannerLib:-Installing)
to generate your paths.

`https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLib.json`

Just need the latest
[release](https://github.com/mjansen4857/pathplanner/releases)?

## Links

- [PathPlanner 2024
Beta](https://www.chiefdelphi.com/t/pathplanner-2024-beta/442364)
Chief Delphi discussion.
Loading

0 comments on commit d57d81b

Please sign in to comment.