Skip to main content

Conventions & Notation

Coordinate frames​

All 2-D geometry in the curriculum uses one right-handed convention:

ConventionMeaning
+x+xforward (robot frame) / toward the far wall (field frame)
+y+yleft
+θ+\theta, +ω+\omegacounter-clockwise, viewed from above
anglesradians internally; wrapped to [−π,π)[-\pi, \pi) before use in any controller

Two frames appear constantly:

  • Field frame: fixed to the field. Poses (x,y,θ)(x, y, \theta) and paths live here.
  • Robot frame: rides on the robot: +x+x out the front, +y+y out the left side. Drive commands (vx,vy,ω)(v_x, v_y, \omega) live here, because that is what the mecanum mixer consumes.

Converting a field-frame vector into the robot frame is a rotation by −θ-\theta:

[vxrobotvyrobot]=[cos⁡θsin⁡θ−sin⁡θcos⁡θ][vxfieldvyfield]\begin{bmatrix} v_x^{robot} \\ v_y^{robot} \end{bmatrix} = \begin{bmatrix} \cos\theta & \sin\theta \\ -\sin\theta & \cos\theta \end{bmatrix} \begin{bmatrix} v_x^{field} \\ v_y^{field} \end{bmatrix}
Sign bugs are convention bugs

If a wheel fights the others or the robot strafes when told to turn, fix the convention (motor direction, encoder sign, where zero is), not the math. Most mecanum bugs turn out to be one reversed motor. See angle wrapping for the ±π\pm\pi seam.

Units​

Derivations use SI unless a section explicitly labels another unit. The equations remain dimensionally valid in any consistent unit system; FTC snippets may use inches when variable names or comments state that choice. Convert once at a hardware or library boundary and never mix unit systems in one calculation:

  • Encoder ticks → real units happens in exactly one constant (METERS_PER_TICK) — see From Math to a Loop.
  • Loop time Δt\Delta t is always the measured elapsed seconds, never an assumed constant.
  • Motor commands are computed in volts, then divided by the measured battery voltage — see voltage compensation.

Recurring symbols​

Indices, increments, and decorations​

These show up in almost every equation on the site.

SymbolMeaning
subscript kkthe control loop index. xkx_k is the value this loop, xk+1x_{k+1} the value next loop. It counts loops, not seconds
subscript iian index into a list: path points, samples, wheels. Position in a collection, never time
Δt\Delta tthe measured seconds between loop kk and loop k+1k+1
Δs,Δθ\Delta s, \Delta\thetahow far the robot moved and turned during one loop
x˙,x¨\dot{x}, \ddot{x}first and second derivative with respect to time: x˙\dot{x} is a velocity, x¨\ddot{x} an acceleration
x^\hat{x}an estimate of xx, not a measurement of it
x\mathbf{x} (bold)a vector or matrix; the same letter unbolded is a single number
A⊤A^{\top}transpose: rows and columns swapped
∥v∥\lVert v \rVertthe length of vector vv

So a line like xk+1=f(xk,Δs,Δθ)\mathbf{x}_{k+1} = f(\mathbf{x}_k, \Delta s, \Delta\theta) reads: the state vector at the next loop is some function of the state now, plus how far the robot moved and turned in between.

Pose & geometry​

SymbolMeaningUnit
x,y,θx, y, \thetafield-frame pose: position + headingm, m, rad
v,ωv, \omegalinear speed, angular velocitym/s, rad/s
κ=1/R\kappa = 1/Rpath curvature (radius RR)1/m

Control​

SymbolMeaning
rr (or setpoint)the target value
yy (or measurement)what the sensor reports
e=r−ye = r - yerror — heading errors always wrapped to [−π,π)[-\pi, \pi)
uuthe actuator command the controller outputs
kP,kI,kDk_P, k_I, k_DPID gains (present, past, trend of the error)
kS,kV,kAk_S, k_V, k_Afeedforward: static friction, velocity, acceleration
kGk_Ggravity hold (constant for slides, kGcos⁡θk_G\cos\theta for arms)
vmax,amaxv_{max}, a_{max}the mechanism's real speed and acceleration limits

The same two feedforward terms go by other names in some lessons, following the code they come from:

NameWhere it's usedSame as
kFk_Fthe F in the PDFL controllerkGk_G, the gravity hold
kLk_Lthe L in the PDFL controllerkSk_S, the static-friction push
kStaticpath followerskSk_S, applied only near the target

Motors​

SymbolMeaningUnit
V,I,RV, I, Rapplied voltage, winding current, winding resistanceV, A, Ω
ktk_ttorque constant: τ=ktI\tau = k_t IN·m/A
kek_eback-EMF constant: Vemf=keωV_{emf} = k_e \omegaV·s/rad
τ\tautorque (context makes clear when τ\tau is a time constant instead)N·m
JJrotational inertiakg·m²

Estimation​

SymbolMeaning
x^\hat{x}the estimate of the state (the hat always means "estimate")
zza sensor measurement
PPcovariance of the estimate (its uncertainty)
Q,RQ, Rprocess-noise and measurement-noise covariance — the two tuning knobs
KKKalman gain: how much of the innovation to believe
HHmeasurement matrix/Jacobian: state space → sensor space
α\alpha (low-pass)weight on the new reading, α=1−e−Δt/τ\alpha = 1-e^{-\Delta t/\tau}
α\alpha (complementary)weight on the prediction, α=e−Δt/τ\alpha = e^{-\Delta t/\tau}, the opposite of the row above
τ\taua filter time constant
A,BA, Bin the matrix Kalman filter: how the state moves on its own (AA) and how a command changes it (BB)

Naming in the algorithms​

Every algorithm is shown in Java, usually just the method the lesson is about. The rest of the program, like helper methods, tuned constants, and hardware setup, is left for you to write, so most blocks won't run if you paste them in on their own. Some blocks do call the FTC SDK directly (setPower, getVoltage) where that call is the point of the lesson.

The code is written for Java 8, which is what the FTC SDK compiles by default. Names follow ordinary Java: lowerCamelCase for variables and methods, SCREAMING_CASE for tuned constants. Comments only give units and ranges. Anything worth working out by hand comes after the block as an Exercise, often with a hidden solution.

The names match the math: kP, kV, kG for gains, dt for measured loop time, wrap(angle) for wrapping to [−π,π)[-\pi,\pi), and Pose2d, Vector2d, PoseSample, and moveStatus(...) from Common Implementation, spelled the same everywhere.