Skip to content

Commit

Permalink
Fix tick units
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrott committed Apr 6, 2023
1 parent 5fbb278 commit 491bb42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public final class MecanumDrive {
public static double LATERAL_IN_PER_TICK = 1;
public static double TRACK_WIDTH_TICKS = 0;

// feedforward parameters
// feedforward parameters in tick units
public static double kS = 0;
public static double kV = 0;
public static double kA = 0;
Expand All @@ -80,7 +80,7 @@ public final class MecanumDrive {
IN_PER_TICK * TRACK_WIDTH_TICKS,
IN_PER_TICK / LATERAL_IN_PER_TICK);

public final MotorFeedforward feedforward = new MotorFeedforward(kS, kV, kA);
public final MotorFeedforward feedforward = new MotorFeedforward(kS, kV / IN_PER_TICK, kA / IN_PER_TICK);

public final TurnConstraints defaultTurnConstraints = new TurnConstraints(
MAX_ANG_VEL, -MAX_ANG_ACCEL, MAX_ANG_ACCEL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public final class TankDrive {
public static double IN_PER_TICK = 0;
public static double TRACK_WIDTH_TICKS = 0;

// feedforward parameters
// feedforward parameters in tick units
public static double kS = 0;
public static double kV = 0;
public static double kA = 0;
Expand All @@ -80,7 +80,7 @@ public final class TankDrive {

public final TankKinematics kinematics = new TankKinematics(IN_PER_TICK * TRACK_WIDTH_TICKS);

public final MotorFeedforward feedforward = new MotorFeedforward(kS, kV, kA);
public final MotorFeedforward feedforward = new MotorFeedforward(kS, kV / IN_PER_TICK, kA / IN_PER_TICK);

public final TurnConstraints defaultTurnConstraints = new TurnConstraints(
MAX_ANG_VEL, -MAX_ANG_ACCEL, MAX_ANG_ACCEL);
Expand Down

0 comments on commit 491bb42

Please sign in to comment.