Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/saquer916/odyssey/llms.txt

Use this file to discover all available pages before exploring further.

DriveSignal is the output value returned by Follower.update(). It carries five scalar components — robot-frame forward velocity, strafe velocity, forward acceleration, strafe acceleration, and a heading correction turn — that MecanumDrive.drive() converts into per-wheel motor powers using kS/kV/kA feedforward with voltage compensation. Package: org.firstinspires.ftc.teamcode.odyssey.follower

Constructor

public DriveSignal(
    double forwardVelocity,
    double strafeVelocity,
    double forwardAcceleration,
    double strafeAcceleration,
    double turn
)
All fields are finalDriveSignal is immutable once constructed. Follower creates a new instance on every update() call.
forwardVelocity
double
required
Robot-frame forward velocity in mm/s. Positive values command forward motion; negative values command reverse motion.
strafeVelocity
double
required
Robot-frame strafe velocity in mm/s. Positive values command rightward lateral motion; negative values command leftward lateral motion.
forwardAcceleration
double
required
Feedforward acceleration in the forward direction (mm/s²). Combined with kA in MecanumDrive to reduce velocity lag during acceleration and deceleration phases of the profile.
strafeAcceleration
double
required
Feedforward acceleration in the strafe direction (mm/s²). Combined with kA in MecanumDrive. Non-zero on curved path segments where the centripetal acceleration vector has a lateral component in the robot frame.
turn
double
required
Output of the heading PID controller. Used directly as an angular velocity command — MecanumDrive scales it against k = lX + lY when distributing it to the four wheels.

Methods

getForwardVelocity()
double
Robot-frame forward velocity component (mm/s). Mapped to all four wheels in equal measure by MecanumDrive.drive().
getStrafeVelocity()
double
Robot-frame strafe velocity component (mm/s). Flips sign for front vs. back wheels to produce lateral motion via the mecanum rollers.
getTurn()
double
Heading PID output used as the angular velocity command. MecanumDrive applies it as ±k·w per wheel, where k = lX + lY (sum of the robot’s half-track widths).
getForwardAcceleration()
double
Feedforward acceleration in the forward direction (mm/s²). Added to each wheel’s power computation as kA · a.
getStrafeAcceleration()
double
Feedforward acceleration in the strafe direction (mm/s²). Flips sign across front/back wheel pairs, mirroring the same layout as strafe velocity.

How MecanumDrive uses DriveSignal

MecanumDrive.drive() decomposes the signal into per-wheel velocities and accelerations, then applies kS/kV/kA feedforward with real-time voltage compensation:
v_FL = forwardVelocity - strafeVelocity - k·turn
v_FR = forwardVelocity + strafeVelocity + k·turn
v_BL = forwardVelocity + strafeVelocity - k·turn
v_BR = forwardVelocity - strafeVelocity + k·turn

a_FL = forwardAcceleration - strafeAcceleration
a_FR = forwardAcceleration + strafeAcceleration
a_BL = forwardAcceleration + strafeAcceleration
a_BR = forwardAcceleration - strafeAcceleration

voltageComp = 12.0 / batteryVoltage

p_i = (kS·sign(v_i) + kV·v_i + kA·a_i) · voltageComp
If any wheel power magnitude exceeds 1.0, all four powers are normalized by the maximum so the ratio between wheels is preserved.

Stop signal

To bring the robot to an immediate halt, send a zero DriveSignal. All motors will receive setPower(0) and, because MecanumDrive configures motors with ZeroPowerBehavior.BRAKE, the robot will lock in place:
drive.drive(new DriveSignal(0, 0, 0, 0, 0)); // zero velocity and acceleration

Build docs developers (and LLMs) love