-
Notifications
You must be signed in to change notification settings - Fork 1
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
Servo controller #85
base: master
Are you sure you want to change the base?
Servo controller #85
Conversation
@@ -94,4 +94,12 @@ public static ControllerEvent setOutputVoltage(double min, double max) { | |||
public static ControllerEvent resetPosition(double position) { | |||
return new ResetPositionEvent(position); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a new class called ServoInstr
@@ -0,0 +1,26 @@ | |||
package com.nutrons.framework.controllers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JavaDoc
@@ -0,0 +1,10 @@ | |||
package com.nutrons.framework.controllers; | |||
|
|||
public interface ServoEvent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change name to ServoInstr
private final double angle; | ||
|
||
/** | ||
* An event which sets the servo to turn to a certain angle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this true for all servos, or just the ones we currently have?
@Override | ||
public void actOn(RevServo servo) { | ||
if (Math.abs(value) > 1.0) { | ||
throw new EventUnimplementedException( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throw IllegalArgumentException
Before Merging