Class WsMotorController
java.lang.Object
org.wildstang.framework.io.outputs.Output
org.wildstang.framework.io.outputs.AnalogOutput
org.wildstang.hardware.roborio.outputs.WsMotorController
Abstract class decribing those that control some kind of motor controller.
-
Constructor Summary
ConstructorsConstructorDescriptionWsMotorController(String p_name) Generic motor controller constructor, cannot be called.WsMotorController(String p_name, double p_default) Generic motor controller constructor, cannot be called. -
Method Summary
Modifier and TypeMethodDescriptionabstract doubleReturns the current motor output percent.abstract doubleReturns the quadrature position from an encoder.abstract doubleReturn the motor controller or motor temperatureabstract doubleReturns the quadrature velocity from an encoder.abstract voidSets motor speed to current value, from -1.0 to 1.0.abstract voidsetBrake()Sets the motor to brake mode, will not freely spin.abstract voidsetCoast()Sets the motor to coast mode, will freely spin.voidsetSpeed(double value) Wraps setValue().voidstop()Sets the motors to 0 speed.Methods inherited from class org.wildstang.framework.io.outputs.AnalogOutput
getValue, setValue
-
Constructor Details
-
WsMotorController
Generic motor controller constructor, cannot be called.- Parameters:
p_name- Descriptive name of the controller.
-
WsMotorController
Generic motor controller constructor, cannot be called.- Parameters:
p_name- Descriptive name of the controller.p_default- Default output value.
-
-
Method Details
-
setBrake
public abstract void setBrake()Sets the motor to brake mode, will not freely spin. -
setCoast
public abstract void setCoast()Sets the motor to coast mode, will freely spin. -
getVelocity
public abstract double getVelocity()Returns the quadrature velocity from an encoder.- Returns:
- Current velocity.
-
getPosition
public abstract double getPosition()Returns the quadrature position from an encoder.- Returns:
- Current position.
-
getOutput
public abstract double getOutput()Returns the current motor output percent.- Returns:
- Current motor output as a percent.
-
getTemperature
public abstract double getTemperature()Return the motor controller or motor temperature- Returns:
- Current temperature.
-
sendDataToOutput
public abstract void sendDataToOutput()Sets motor speed to current value, from -1.0 to 1.0.- Specified by:
sendDataToOutputin classOutput
-
setSpeed
public void setSpeed(double value) Wraps setValue().- Parameters:
value- New motor percent speed, from -1.0 to 1.0.
-
stop
public void stop()Sets the motors to 0 speed.
-