Skip to content

Commit

Permalink
update RC for driving
Browse files Browse the repository at this point in the history
  • Loading branch information
IanShiii committed Sep 14, 2024
1 parent 4ab8196 commit a2266e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.stuypulse.stuylib.streams.vectors.VStream;
import com.stuypulse.stuylib.streams.vectors.filters.VDeadZone;
import com.stuypulse.stuylib.streams.vectors.filters.VLowPassFilter;
import com.stuypulse.stuylib.streams.vectors.filters.VMotionProfile;
import com.stuypulse.stuylib.streams.vectors.filters.VRateLimit;

import com.stuypulse.robot.constants.Settings.Driver.Drive;
Expand Down Expand Up @@ -34,15 +35,15 @@ public SwerveDriveDrive(Gamepad driver) {
x -> x.clamp(1),
x -> x.pow(Drive.POWER.get()),
x -> x.mul(Drive.MAX_TELEOP_SPEED.get()),
new VRateLimit(Drive.MAX_TELEOP_ACCEL.get()),
new VLowPassFilter(Drive.RC.get()));
new VRateLimit(Drive.MAX_TELEOP_ACCEL),
new VLowPassFilter(Drive.RC));

turn = IStream.create(driver::getRightX)
.filtered(
x -> SLMath.deadband(x, Turn.DEADBAND.get()),
x -> SLMath.spow(x, Turn.POWER.get()),
x -> x * Turn.MAX_TELEOP_TURN_SPEED.get(),
new LowPassFilter(Turn.RC.get()));
new LowPassFilter(Turn.RC));

this.driver = driver;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/stuypulse/robot/constants/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public interface Driver {
public interface Drive {
SmartNumber DEADBAND = new SmartNumber("Driver Settings/Drive/Deadband", 0.03);

SmartNumber RC = new SmartNumber("Driver Settings/Drive/RC", 0.01);
SmartNumber RC = new SmartNumber("Driver Settings/Drive/RC", 0.05);
SmartNumber POWER = new SmartNumber("Driver Settings/Drive/Power", 2);

SmartNumber MAX_TELEOP_SPEED = new SmartNumber("Driver Settings/Drive/Max Speed", Swerve.MAX_LINEAR_VELOCITY);
Expand Down

0 comments on commit a2266e1

Please sign in to comment.