mirror of
https://github.com/Team4388/RiseOfRidgebotics2020.git
synced 2026-06-09 08:48:01 -06:00
Work on dead assist
This commit is contained in:
@@ -82,7 +82,7 @@ public class DriveWithJoystickUsingDeadAssistPID extends CommandBase {
|
||||
}
|
||||
|
||||
/* If move stick is being used */
|
||||
if (moveInput != 0) {
|
||||
if (true) {
|
||||
m_deadTimeMove = m_currTime;
|
||||
m_stopPos = m_drive.m_rightFrontMotor.getSelectedSensorPosition()
|
||||
+ (m_drive.m_rightFrontMotor.getSelectedSensorVelocity());
|
||||
@@ -122,14 +122,14 @@ public class DriveWithJoystickUsingDeadAssistPID extends CommandBase {
|
||||
}
|
||||
|
||||
private void runDriveWithInput(double move, double steerInput) {
|
||||
double cosMultiplier = .55;
|
||||
double cosMultiplier = .70;
|
||||
double steerOutput = 0;
|
||||
double deadzone = .2;
|
||||
double deadzone = .1;
|
||||
/* Curves the steer output to be similarily gradual */
|
||||
if (steerInput > 0){
|
||||
steerOutput = -cosMultiplier*Math.cos(1.571*steerInput)+(cosMultiplier+deadzone);
|
||||
steerOutput = -(cosMultiplier - deadzone)*Math.cos(1.571*steerInput)+(cosMultiplier);
|
||||
} else if (steerInput < 0) {
|
||||
steerOutput = cosMultiplier*Math.cos(1.571*steerInput)-(cosMultiplier+deadzone);
|
||||
steerOutput = (cosMultiplier - deadzone)*Math.cos(1.571*steerInput)-(cosMultiplier);
|
||||
}
|
||||
|
||||
m_drive.driveWithInput(move, steerOutput);
|
||||
|
||||
@@ -114,6 +114,11 @@ public class Drive extends SubsystemBase {
|
||||
m_leftFrontMotor.configOpenloopRamp(DriveConstants.OPEN_LOOP_RAMP_RATE, DriveConstants.DRIVE_TIMEOUT_MS);
|
||||
m_leftBackMotor.configOpenloopRamp(DriveConstants.OPEN_LOOP_RAMP_RATE, DriveConstants.DRIVE_TIMEOUT_MS);
|
||||
|
||||
m_rightFrontMotor.configClosedloopRamp(DriveConstants.OPEN_LOOP_RAMP_RATE, DriveConstants.DRIVE_TIMEOUT_MS);
|
||||
m_rightBackMotor.configClosedloopRamp(DriveConstants.OPEN_LOOP_RAMP_RATE, DriveConstants.DRIVE_TIMEOUT_MS);
|
||||
m_leftFrontMotor.configClosedloopRamp(DriveConstants.OPEN_LOOP_RAMP_RATE, DriveConstants.DRIVE_TIMEOUT_MS);
|
||||
m_leftBackMotor.configClosedloopRamp(DriveConstants.OPEN_LOOP_RAMP_RATE, DriveConstants.DRIVE_TIMEOUT_MS);
|
||||
|
||||
/* Config Supply Current Limit (Use only for debugging) */
|
||||
//m_rightFrontMotor.configSupplyCurrentLimit(DriveConstants.SUPPLY_CURRENT_LIMIT_CONFIG);
|
||||
//m_leftFrontMotor.configSupplyCurrentLimit(DriveConstants.SUPPLY_CURRENT_LIMIT_CONFIG);
|
||||
|
||||
Reference in New Issue
Block a user