public class NidecBrushless extends SendableBase implements SpeedController, MotorSafety, Sendable
DEFAULT_SAFETY_EXPIRATION| Constructor and Description |
|---|
NidecBrushless(int pwmChannel,
int dioChannel)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
disable()
Disable the motor.
|
void |
enable()
Re-enable the motor after disable() has been called.
|
void |
free()
Free the resources used by this object.
|
double |
get()
Get the recently set value of the PWM.
|
int |
getChannel()
Gets the channel number associated with the object.
|
java.lang.String |
getDescription() |
double |
getExpiration()
Return the safety expiration time.
|
boolean |
getInverted()
Common interface for returning if a speed controller is in the inverted state or not.
|
void |
initSendable(SendableBuilder builder)
Initializes this
Sendable object. |
boolean |
isAlive()
Check if the motor is currently alive or stopped due to a timeout.
|
boolean |
isSafetyEnabled()
Check if motor safety is enabled.
|
void |
pidWrite(double output)
Write out the PID value as seen in the PIDOutput base object.
|
void |
set(double speed)
Set the PWM value.
|
void |
setExpiration(double timeout)
Set the safety expiration time.
|
void |
setInverted(boolean isInverted)
Common interface for inverting direction of a speed controller.
|
void |
setSafetyEnabled(boolean enabled) |
void |
stopMotor()
Stop the motor.
|
addChild, getName, getSubsystem, setName, setName, setName, setSubsystemclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetName, getSubsystem, setName, setName, setSubsystempublic NidecBrushless(int pwmChannel, int dioChannel)
pwmChannel - The PWM channel that the Nidec Brushless controller is attached to.
0-9 are on-board, 10-19 are on the MXP portdioChannel - The DIO channel that the Nidec Brushless controller is attached to.
0-9 are on-board, 10-25 are on the MXP portpublic void free()
free in class SendableBasepublic void set(double speed)
The PWM value is set using a range of -1.0 to 1.0, appropriately scaling the value for the FPGA.
set in interface SpeedControllerspeed - The speed value between -1.0 and 1.0 to set.public double get()
get in interface SpeedControllerpublic void setInverted(boolean isInverted)
SpeedControllersetInverted in interface SpeedControllerisInverted - The state of inversion true is inverted.public boolean getInverted()
SpeedControllergetInverted in interface SpeedControllerpublic void pidWrite(double output)
public void setExpiration(double timeout)
setExpiration in interface MotorSafetytimeout - The timeout (in seconds) for this motor objectpublic double getExpiration()
getExpiration in interface MotorSafetypublic boolean isAlive()
isAlive in interface MotorSafetypublic void stopMotor()
stopMotor in interface MotorSafetystopMotor in interface SpeedControllerpublic boolean isSafetyEnabled()
isSafetyEnabled in interface MotorSafetypublic void setSafetyEnabled(boolean enabled)
setSafetyEnabled in interface MotorSafetypublic java.lang.String getDescription()
getDescription in interface MotorSafetypublic void disable()
disable in interface SpeedControllerpublic void enable()
public int getChannel()
public void initSendable(SendableBuilder builder)
SendableSendable object.initSendable in interface Sendablebuilder - sendable builder