-
Notifications
You must be signed in to change notification settings - Fork 1
REV Motor IO Layer #190
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
base: dev
Are you sure you want to change the base?
REV Motor IO Layer #190
Changes from all commits
4560855
f70cae7
35fc34f
6b067e8
cd9d261
e152663
cbb9d84
631cc53
1e90100
b9de937
6bdb24f
ee5d549
53a3377
cb649e1
ecf6f8f
e285b3e
f29b6e6
b125589
80e922b
c9cc5b5
afd56fd
97d8fc8
21602a8
81f0df1
078adda
2448e41
01e8bb3
2b5bef9
9952272
3e7c325
475d964
66dc14c
5eed051
c0dd131
6743832
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
| import static edu.wpi.first.units.Units.RadiansPerSecond; | ||
| import static edu.wpi.first.units.Units.Volts; | ||
|
|
||
| import org.apache.commons.lang3.NotImplementedException; | ||
| import org.littletonrobotics.junction.AutoLog; | ||
|
|
||
| import edu.wpi.first.units.AngularAccelerationUnit; | ||
|
|
@@ -97,7 +98,7 @@ abstract class MotorInputs { | |
| */ | ||
| public default String getName() | ||
| { | ||
| return ""; | ||
| throw new NotImplementedException("This method has not been implemented"); | ||
|
Comment on lines
-100
to
+101
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method needs to be removed for replay support |
||
| } | ||
|
|
||
| /** | ||
|
|
@@ -107,35 +108,45 @@ public default String getName() | |
| * @param inputs The structure to populate with updated sensor values. | ||
| */ | ||
| public default void updateInputs(MotorInputs inputs) | ||
| {} | ||
| { | ||
| throw new NotImplementedException("This method has not been implemented"); | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks replay |
||
|
|
||
| /** | ||
| * Sets the motor to coast mode. | ||
| */ | ||
| public default void runCoast() | ||
| {} | ||
| { | ||
| throw new NotImplementedException("This method has not been implemented"); | ||
| } | ||
|
Comment on lines
-116
to
+121
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks replay |
||
|
|
||
| /** | ||
| * Sets the motor to brake mode. | ||
| */ | ||
| public default void runBrake() | ||
| {} | ||
| { | ||
| throw new NotImplementedException("This method has not been implemented"); | ||
| } | ||
|
Comment on lines
-122
to
+129
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks replay |
||
|
|
||
| /** | ||
| * Runs the motor using direct voltage control. | ||
| * | ||
| * @param voltage Desired voltage output. | ||
| */ | ||
| public default void runVoltage(Voltage voltage) | ||
| {} | ||
| { | ||
| throw new NotImplementedException("This method has not been implemented"); | ||
| } | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks replay |
||
| /** | ||
| * Runs the motor with a specified current output. | ||
| * | ||
| * @param current Desired torque-producing current. | ||
| */ | ||
| public default void runCurrent(Current current) | ||
| {} | ||
| { | ||
| throw new NotImplementedException("This method has not been implemented"); | ||
| } | ||
|
Comment on lines
-138
to
+149
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks replay |
||
|
|
||
| /** | ||
| * Runs the motor with a specified current output and duty cycle. | ||
|
|
@@ -144,15 +155,19 @@ public default void runCurrent(Current current) | |
| * @param dutyCycle Desired dutycycle of current output, limiting top speed | ||
| */ | ||
| public default void runCurrent(Current current, double dutyCycle) | ||
| {} | ||
| { | ||
| throw new NotImplementedException("This method has not been implemented"); | ||
| } | ||
|
Comment on lines
-147
to
+160
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks replay |
||
|
|
||
| /** | ||
| * Runs the motor using duty cycle (percentage of available voltage). | ||
| * | ||
| * @param dutyCycle Fractional output between 0 and 1. | ||
| */ | ||
| public default void runDutyCycle(double dutyCycle) | ||
| {} | ||
| { | ||
| throw new NotImplementedException("This method has not been implemented"); | ||
| } | ||
|
Comment on lines
-155
to
+170
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks replay |
||
|
|
||
| /** | ||
| * Runs the motor to a specific position. | ||
|
|
@@ -166,7 +181,20 @@ public default void runDutyCycle(double dutyCycle) | |
| public default void runPosition(Angle position, AngularVelocity cruiseVelocity, | ||
| AngularAcceleration acceleration, | ||
| Velocity<AngularAccelerationUnit> maxJerk, PIDSlot slot) | ||
| {} | ||
| { | ||
| throw new NotImplementedException("This method has not been implemented"); | ||
| } | ||
|
|
||
| /** | ||
| * Runs the motor to a specific position. | ||
| * | ||
| * @param position Target position. | ||
| * @param slot PID slot index. | ||
| */ | ||
| public default void runPosition(Angle position, PIDSlot slot) | ||
| { | ||
| throw new NotImplementedException("This method has not been implemented"); | ||
| } | ||
|
Comment on lines
-169
to
+197
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks replay |
||
|
|
||
| /** | ||
| * Runs the motor at a target velocity. | ||
|
|
@@ -177,13 +205,37 @@ public default void runPosition(Angle position, AngularVelocity cruiseVelocity, | |
| */ | ||
| public default void runVelocity(AngularVelocity velocity, AngularAcceleration acceleration, | ||
| PIDSlot slot) | ||
| {} | ||
| { | ||
| throw new NotImplementedException("This method has not been implemented"); | ||
| } | ||
|
|
||
| /** | ||
| * Runs the motor at a target velocity. | ||
| * | ||
| * @param velocity Desired velocity. | ||
| * @param slot PID slot index. | ||
| */ | ||
| public default void runVelocity(AngularVelocity velocity, PIDSlot slot) | ||
| { | ||
| throw new NotImplementedException("This method has not been implemented"); | ||
| } | ||
|
Comment on lines
-180
to
+221
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks replay |
||
|
|
||
| /** | ||
| * Sets the position of the motor's internal encoder | ||
| * | ||
| * @param position Desired position to set encoder to | ||
| */ | ||
| public default void setEncoderPosition(Angle position) | ||
| {} | ||
| { | ||
| throw new NotImplementedException("This method has not been implemented"); | ||
| } | ||
|
Comment on lines
-188
to
+231
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks replay |
||
|
|
||
| /** | ||
| * Closes and cleans up motor controller resources. Called when the motor is no longer needed to | ||
| * properly release hardware. | ||
| */ | ||
| public default void close() | ||
| { | ||
| // Default implementation does nothing for interfaces that don't need cleanup | ||
| } | ||
|
Comment on lines
+237
to
+240
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make the interface extend |
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.