Skip to content

Commit

Permalink
Merge branch 'main' into refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
fruzyna committed Jan 9, 2024
2 parents 6d581b0 + a973cd5 commit 31ad5fe
Show file tree
Hide file tree
Showing 16 changed files with 136 additions and 280 deletions.
11 changes: 0 additions & 11 deletions src/main/java/frc/paths/Paths.txt

This file was deleted.

122 changes: 0 additions & 122 deletions src/main/java/frc/paths/Test.java

This file was deleted.

6 changes: 0 additions & 6 deletions src/main/java/frc/paths/config.txt

This file was deleted.

9 changes: 0 additions & 9 deletions src/main/java/org/wildstang/framework/auto/BobTrajectory.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.wildstang.hardware.roborio.outputs.WsRelay;
import org.wildstang.hardware.roborio.outputs.WsServo;
import org.wildstang.hardware.roborio.outputs.WsSolenoid;
import org.wildstang.hardware.roborio.outputs.WsSparkMax;
import org.wildstang.hardware.roborio.outputs.WsSpark;
import org.wildstang.hardware.roborio.outputs.WsRemoteAnalogOutput;
import org.wildstang.hardware.roborio.outputs.WsRemoteDigitalOutput;
import org.wildstang.hardware.roborio.outputs.config.WsDigitalOutputConfig;
Expand All @@ -23,8 +23,8 @@
import org.wildstang.hardware.roborio.outputs.config.WsRelayConfig;
import org.wildstang.hardware.roborio.outputs.config.WsServoConfig;
import org.wildstang.hardware.roborio.outputs.config.WsSolenoidConfig;
import org.wildstang.hardware.roborio.outputs.config.WsSparkMaxConfig;
import org.wildstang.hardware.roborio.outputs.config.WsSparkMaxFollowerConfig;
import org.wildstang.hardware.roborio.outputs.config.WsSparkConfig;
import org.wildstang.hardware.roborio.outputs.config.WsSparkFollowerConfig;
import org.wildstang.hardware.roborio.outputs.config.WsRemoteAnalogOutputConfig;
import org.wildstang.hardware.roborio.outputs.config.WsRemoteDigitalOutputConfig;

Expand Down Expand Up @@ -79,18 +79,17 @@ else if (config instanceof WsPhoenixFollowerConfig) {
out = Core.getOutputManager().getOutput(c.getFollowing());
((WsPhoenix) out).addFollower(c.getChannel(), c.getType(), c.isOpposing());
}
else if (config instanceof WsSparkMaxConfig) {
WsSparkMaxConfig c = (WsSparkMaxConfig) config;
out = new WsSparkMax(p_output.getName(), c.getChannel(), c.isBrushless(),
c.getDefault(), c.isInverted());
else if (config instanceof WsSparkConfig) {
WsSparkConfig c = (WsSparkConfig) config;
out = new WsSpark(p_output.getName(), c.getChannel(), c.getType(), c.getDefault(), c.isInverted());
}
// Note a WsSparkMaxFollower must be defined after its corresponding WsSparkMax
else if (config instanceof WsSparkMaxFollowerConfig) {
WsSparkMaxFollowerConfig c = (WsSparkMaxFollowerConfig) config;
else if (config instanceof WsSparkFollowerConfig) {
WsSparkFollowerConfig c = (WsSparkFollowerConfig) config;
// Returns the follwed WsSparkMax because a return is required
// and duplicate outputs are thrown out when encountered.
out = Core.getOutputManager().getOutput(c.getFollowing());
((WsSparkMax) out).addFollower(c.getChannel(), c.isBrushless(), c.isOpposing());
((WsSpark) out).addFollower(c.getChannel(), c.getType(), c.isOpposing());
}
else if (config instanceof WsSolenoidConfig) {
WsSolenoidConfig c = (WsSolenoidConfig) config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public WsPhoenix(String name, int channel, double p_default, WsMotorControllers
motor = new TalonFX(channel);
break;
default:
Log.error("Invalid motor control for WsPhoenix!");
Log.error("Invalid motor controller for WsPhoenix!");
return;
}
motor.setInverted(invert);
Expand All @@ -73,7 +73,7 @@ public void addFollower(int canConstant, WsMotorControllers controller, boolean
follower = new TalonFX(canConstant);
break;
default:
Log.error("Invalid follower motor control for WsPhoenix!");
Log.error("Invalid follower motor controller for WsPhoenix!");
return;
}
follower.follow(motor);
Expand Down
Loading

0 comments on commit 31ad5fe

Please sign in to comment.