Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

made changes to replace deprecated methods in standard #225

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 0 additions & 2 deletions CommandRobotBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.command.Scheduler;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

/**
Expand Down Expand Up @@ -216,7 +215,6 @@ public final void testInit() {
*/
@Override
public void testPeriodic() {
LiveWindow.run();
testExecute();
alwaysExecute();
}
Expand Down
2 changes: 2 additions & 0 deletions custom/CANMessageUnavailableException.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* exception being thrown.
*/
public class CANMessageUnavailableException extends Exception {
private static final long serialVersionUID = 4904L;

public CANMessageUnavailableException() {
super();
}
Expand Down
8 changes: 4 additions & 4 deletions custom/CommandSendableChooser.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public class CommandSendableChooser extends SendableChooser<Command> {
*
* @param object
*/
public void addObject(Command object) {
super.addObject(object.getName(), object);
public void addOption(Command object) {
super.addOption(object.getName(), object);
}

/**
Expand All @@ -26,7 +26,7 @@ public void addObject(Command object) {
*
* @param object
*/
public void addDefault(Command object) {
super.addDefault(object.getName() + " (default)", object);
public void setDefaultOption(Command object) {
super.setDefaultOption(object.getName() + " (default)", object);
}
}
8 changes: 4 additions & 4 deletions custom/TypedNamedSendableChooser.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public class TypedNamedSendableChooser<T extends Nameable> extends SendableChoos
*
* @param object
*/
public void addObject(T object) {
super.addObject(object.getName(), object);
public void addOption(T object) {
super.addOption(object.getName(), object);
}

/**
Expand All @@ -27,8 +27,8 @@ public void addObject(T object) {
*
* @param object
*/
public void addDefault(T object) {
super.addDefault(object.getName() + " (default)", object);
public void setDefaultOption(T object) {
super.setDefaultOption(object.getName() + " (default)", object);
}
/**
* Wrapper for getSelected() to conform to Supplier<T>
Expand Down
10 changes: 4 additions & 6 deletions custom/controllers/XboxController.java
Original file line number Diff line number Diff line change
Expand Up @@ -609,11 +609,10 @@ public Joystick getJoystick() {
* How strong the rumble is
*/
public void setRumble(HAND hand, double intensity) {
final float amount = new Float(intensity);
if (hand == HAND.LEFT) {
controller.setRumble(RumbleType.kLeftRumble, amount);
controller.setRumble(RumbleType.kLeftRumble, intensity);
} else {
controller.setRumble(RumbleType.kRightRumble, amount);
controller.setRumble(RumbleType.kRightRumble, intensity);
}
}

Expand All @@ -624,9 +623,8 @@ public void setRumble(HAND hand, double intensity) {
* How strong the rumble is
*/
public void setRumble(double intensity) {
final float amount = new Float(intensity);
controller.setRumble(RumbleType.kLeftRumble, amount);
controller.setRumble(RumbleType.kRightRumble, amount);
controller.setRumble(RumbleType.kLeftRumble, intensity);
controller.setRumble(RumbleType.kRightRumble, intensity);
}

/*
Expand Down
1 change: 0 additions & 1 deletion custom/sensors/NavX.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.usfirst.frc4904.standard.custom.sensors;


import org.usfirst.frc4904.standard.LogKitten;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than getting rid of this, maybe consider logging navx errors?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably be a diff branch

import com.kauailabs.navx.frc.AHRS;
import edu.wpi.first.wpilibj.I2C;
import edu.wpi.first.wpilibj.PIDSourceType;
Expand Down
4 changes: 2 additions & 2 deletions custom/sensors/PDP.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.usfirst.frc4904.standard.LogKitten;
import org.usfirst.frc4904.standard.custom.CANMessageUnavailableException;
import org.usfirst.frc4904.standard.custom.CustomCAN;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.RobotController;

/**
* Simplified version of the PowerDistributionPanel class
Expand Down Expand Up @@ -135,7 +135,7 @@ public double getVoltage() {
}
catch (InvalidSensorException e) {
LogKitten.ex(e);
return DriverStation.getInstance().getBatteryVoltage();
return RobotController.getBatteryVoltage();
}
}

Expand Down
1 change: 0 additions & 1 deletion subsystems/motor/Motor.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import org.usfirst.frc4904.standard.LogKitten;
import org.usfirst.frc4904.standard.commands.motor.MotorIdle;
import org.usfirst.frc4904.standard.subsystems.motor.speedmodifiers.EnableableModifier;
import org.usfirst.frc4904.standard.subsystems.motor.speedmodifiers.IdentityModifier;
import org.usfirst.frc4904.standard.subsystems.motor.speedmodifiers.SpeedModifier;
import com.ctre.phoenix.motorcontrol.IMotorController;
Expand Down
1 change: 0 additions & 1 deletion subsystems/motor/SensorMotor.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

public abstract class SensorMotor extends Motor {
protected final MotionController motionController;
private boolean isMotionControlEnabled;

public SensorMotor(String name, boolean inverted, SpeedModifier speedModifier, MotionController motionController,
SpeedController... motors) {
Expand Down