-
Notifications
You must be signed in to change notification settings - Fork 0
/
frc3620_2023_codefeatures.tex
118 lines (85 loc) · 4.94 KB
/
frc3620_2023_codefeatures.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
\documentclass[]{article}
\usepackage{caption,subcaption}
\usepackage{enumitem}
\usepackage{listings}
\usepackage[margin=1in]{geometry}
\usepackage{courier}
\usepackage{indentfirst}
\usepackage{graphicx}
\usepackage[framemethod=tikz]{mdframed}
\usepackage[all]{nowidow}
% heavier font
\usepackage{mlmodern}
% make sure that subfigures do not get numbered
% https://tex.stackexchange.com/a/165513
\captionsetup[subfigure]{labelformat=empty}
\lstset{basicstyle=\footnotesize\ttfamily,breaklines=true}
\newcommand{\zztt}[1]{{\texttt{\footnotesize{#1}}}}
%opening
\title{Noteworthy Features of the Average Joes' 2023 FRC Code}
\author{Doug Wegscheid}
\date{January 3, 2024}
\begin{document}
\maketitle
\begin{abstract}
\iffalse
\
\\
\texttt{hi()}
\\
\texttt{\small{hi()}}
\\
\texttt{\scriptsize{hi()}}
\\
\texttt{\tiny{hi()}}
\\
\zztt{hi()}
\fi
FRC Team 3620, "The Average Joes", from St.\ Joseph High School in St.\ Joseph, Michigan, is releasing their 2023 Java code for other FRC teams to learn from.
The robot code is available on github:
\\
\zztt{https://github.com/FRC3620/FRC3620\_2023\_SteveThePirate}
\\
The \zztt{master} branch was typically what the team used for 2023 competition.
The Shuffleboard configuration is available on github:
\\
\zztt{https://github.com/FRC3620/FRC3620\_2023\_Shuffleboard}
This paper is a summary of what the team programming mentor considers to be features that other FRC teams may want to look at and use:
augmented estimation of field position from AprilTags,
odometry,
ability to switch between different drive controllers without code changes.
You may also want to look at our 2022 code and description: some features described there that we continued to use were
event logging, data logging,
using vision to guesstimate range and set up the shooter,
onboard diagnostics,
haptic driver feedback,
dashboard Sendable CANSparkMax objects,
and a file based configuration setup so the same code could be run on similar (but not identical) robots.
Some of the information contained here was not discovered or developed by The Average Joes; much of it was gleaned from other team's postings of code, discussions on Chief Delphi, or other publicly available sources.
We didn't generally keep track of where we got ideas that we reused, and apologize for not being able to attribute them properly.
\end{abstract}
\section{Overview}
Our 2023 FRC programming was done in Java (new) command-based code.
We did version control with git, using github as our central repository.
Branch \zztt{master} had our code through the end of the 2023 season. After the end of the season, the students took on individual projects to get somethings working that they never got working during the season.
\iffalse
In the past, I have listed out the student's names and graduation dates to acknowledge their efforts; because of privacy considerations, I cannot do this in this document.
\else
The code was developed by Liam Allen\footnote{Now battling only 26" of snow at Michigan Tech}, AJ Bacolor, Mic Crawford, Mariah Jhala, Manasvi Mogili, Yeshasvi Mogili, an Grace Yuan\footnote{Someone else may have had contributions to the code, but I can't find it in the history!}.
They were mentored by Greg Fisbeck, Tearesa Wegscheid, and myself.
\fi
\pagebreak
Here are the features of the 2023 code that may be of use to other teams:
\begin{itemize}[topsep=0pt]
\item Augmented estimation of field position from AprilTags
We used (and contributed to) PhotonVision.
PhotonLib has a pose estimator.
Part of it's estimation is based on an estimate of what angle we are viewing a target at (are we facing on a line perpendicular to the face of the target, or at some other angle?), and this what angle we were facing.
It was more accurate to use the IMU to determine what angle we were facing and calculate based on that\footnote{I believe this has since been added to PhotonLib.}. See method \zztt{aprilTagsPeriodic()} in \zztt{VisionSubsystem}.
We did find that pose estimation got a little sketchy at greater distances, and put safeguards in place not to update our odometry if the target was far away.
\item Odometry
We had not used the WPILib provided \zztt{SwerveDriveOdometry} classes in the past because of a lack of awareness of it's existence, and then a perception that it was difficult to use. It's there, and it's not hard. See \zztt{OdometrySubsystem}.
\item Ability to switch between different drive controllers without code changes
Our driver had fallen in love with a FlySky controller. We have one, with no spare. It has radically different axis mappings than the XBox controllers we traditionally use; if it failed, we would need to do different controller mappings in the code. Rather than having two different sets of mappings and having to somehow manually switch between them, we created a \zztt{ChameleonController}. When the robot is enabled, it interrogates WPILib to see what the name of the controller is, and then subsequently uses the correct axis mappings.
\end{itemize}
\end{document}