Skip to content
This repository was archived by the owner on Dec 25, 2020. It is now read-only.

implimented rampping #23

Merged
merged 1 commit into from
Jan 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/org/_2585robophiles/frc2015/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ public interface RobotMap {
REAR_RIGHT_DRIVE = 4,
SIDEWAYS_DRIVE = 5;

public static final double FORWARD_RAMPING = 1;
public static final double FORWARD_RAMPING = .8;
public static final double SIDEWAYS_RAMPING = .8;

}
4 changes: 2 additions & 2 deletions src/org/_2585robophiles/frc2015/input/XboxInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ public XboxInput(Joystick joystick){
*/
@Override
public double forwardMovement() {
return controller.getRawAxis(XboxConstants.LEFT_Y_AXIS);
return (-controller.getRawAxis(XboxConstants.LEFT_Y_AXIS));
}

/* (non-Javadoc)
* @see org._2585robophiles.frc2015.input.InputMethod#sidewaysMovement()
*/
@Override
public double sidewaysMovement() {
return controller.getRawAxis(XboxConstants.LEFT_X_AXIS);
return (-controller.getRawAxis(XboxConstants.LEFT_X_AXIS));
}

/* (non-Javadoc)
Expand Down
10 changes: 7 additions & 3 deletions src/org/_2585robophiles/frc2015/systems/WheelSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public class WheelSystem implements RobotSystem, Runnable {
private SpeedController sidewaysMotor;
private InputMethod input;
private double previousNormalMovement;
private double currentRampForward;
private double currentRampSideways;

/* (non-Javadoc)
* @see org._2585robophiles.frc2015.Initializable#init(org._2585robophiles.frc2015.Environment)
Expand All @@ -35,8 +37,8 @@ public void init(Environment environment) {
* @param sidewaysMovement left right move value
* @param rotation turn value
*/
public void drive(double normalMovement, double sidewaysMovement, double rotation){
drivetrain.arcadeDrive(normalMovement, rotation);
public void drive(double forwardMovement, double sidewaysMovement, double rotation){
drivetrain.arcadeDrive(forwardMovement, rotation);
sidewaysMotor.set(sidewaysMovement);
}

Expand All @@ -45,7 +47,9 @@ public void drive(double normalMovement, double sidewaysMovement, double rotatio
*/
@Override
public void run() {
drive(input.forwardMovement(), input.sidewaysMovement(), input.rotation());
currentRampForward += (input.forwardMovement()-currentRampForward) * RobotMap.FORWARD_RAMPING;
currentRampSideways += (input.sidewaysMovement()-currentRampSideways) * RobotMap.SIDEWAYS_RAMPING;
drive(currentRampForward, currentRampSideways, input.rotation());
}

/**
Expand Down