public class Igneous
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static EventInput |
constantPeriodic
Constant time periodic.
|
static EventInput |
duringAuto
Produced during autonomous mode.
|
static EventInput |
duringDisabled
Produced while the robot is disabled.
|
static EventInput |
duringTele
Produced during teleop mode.
|
static EventInput |
duringTest
Produced during testing mode.
|
static EventInput |
globalPeriodic
Produced during every mode if the driver station is attached.
|
static IJoystickWithPOV |
joystick1
Joystick 1 on the Driver Station.
|
static IJoystickWithPOV |
joystick2
Joystick 2 on the Driver Station.
|
static IJoystickWithPOV |
joystick3
Joystick 3 on the Driver Station.
|
static IJoystickWithPOV |
joystick4
Joystick 4 on the Driver Station.
|
static IJoystickWithPOV |
joystick5
Joystick 5 on the Driver Station.
|
static IJoystickWithPOV |
joystick6
Joystick 6 on the Driver Station.
|
static IgneousLauncher |
launcher
The IgneousLauncher providing access to the robot.
|
static boolean |
MOTOR_FORWARD
Signifies that the motor should be directly outputted without negation.
|
static boolean |
MOTOR_REVERSE
Signifies that the motor should be outputted after negating the value.
|
static float |
NO_RAMPING
Signifies that no ramping should be applied to this motor.
|
static int |
POWER_CHANNEL_3V3
The 3.3V rail power channel.
|
static int |
POWER_CHANNEL_5V
The 5V rail power channel.
|
static int |
POWER_CHANNEL_6V
The 6V rail power channel.
|
static int |
POWER_CHANNEL_BATTERY
The battery power channel.
|
static EventInput |
startAuto
Produced when the robot enters autonomous mode.
|
static EventInput |
startDisabled
Produced when the robot enters disabled mode.
|
static EventInput |
startTele
Produced when the robot enters teleop mode.
|
static EventInput |
startTest
Produced when the robot enters testing mode.
|
| Modifier and Type | Method and Description |
|---|---|
static FloatInputPoll |
getBatteryVoltage()
Get a reference to the analog input that reads the current battery
voltage, scaled to represent the real battery voltage.
|
static FloatInputPoll |
getChannelCurrent(int powerChannel)
Reads the current from a specified power reading channel.
|
static BooleanInputPoll |
getChannelEnabled(int powerChannel)
Checks if the specified power reading channel is enabled.
|
static FloatInputPoll |
getChannelVoltage(int powerChannel)
Reads the voltage from a specified power reading channel.
|
static ControlBindingDataSource |
getControlBindingDataSource()
Get a ControlBindingDataSource for the six Joysticks.
|
static ControlBindingDataSource |
getControlBindingDataSource(java.lang.String... names)
This is similar to
getControlBindingDataSource() but lets you
give better names to your Joysticks. |
static BooleanInputPoll |
getIsAutonomous()
Get a boolean input that checks if the robot is currently in autonomous,
as opposed to teleop and testing.
|
static BooleanInputPoll |
getIsDisabled()
Get a boolean input that checks if the robot is currently disabled.
|
static BooleanInputPoll |
getIsFMS()
Get a boolean input that checks if the robot is currently connected to
the FMS, as opposed to being off the playing field.
|
static BooleanInputPoll |
getIsTeleop()
Get a boolean input that checks if the robot is currently in teleop mode,
as opposed to testing and autonomous.
|
static BooleanInputPoll |
getIsTest()
Get a boolean input that checks if the robot is currently in testing
mode, as opposed to teleop and autonomous.
|
static IJoystick |
getKinectJoystick(boolean isRightArm)
Get an IJoystick for the specified Kinect virtual joystick.
|
static FloatInputPoll |
getPCMCompressorCurrent()
Reads the current draw of the PCM compressor.
|
static BooleanInputPoll |
getPCMCompressorRunning()
Reads the current status of the PCM compressor enable output.
|
static BooleanInputPoll |
getPCMPressureSwitch()
Reads the current status of the PCM pressure switch.
|
static FloatInputPoll |
getPDPChannelCurrent(int channel)
Reads the current draw of the specified PDP channel.
|
static FloatInputPoll |
getPDPVoltage()
Reads the voltage of the PDP.
|
static boolean |
isRoboRIO()
Checks if this platform is a roboRIO.
|
static FloatInputPoll |
makeAccelerometerAxis(int port,
double sensitivity,
double zeropoint)
Deprecated.
This is literally a subtraction and a division.
|
static FloatInputPoll |
makeAnalogInput_ValueBased(int id,
int averageBits)
Deprecated.
makeAnalogInput should be used directly because it gives more
useful volts instead of a raw value.
|
static FloatInputPoll |
makeAnalogInput(int id)
Create a reference to an analog input on the specified port.
|
static FloatInputPoll |
makeAnalogInput(int id,
int averageBits)
Create a reference to an analog input on the specified port with the
specified number of average bits.
|
static ExtendedMotor |
makeCANJaguar(int deviceNumber)
**** WARNING ****: THIS API IS NOT YET FINALIZED.
|
static ExtendedMotor |
makeCANTalon(int deviceNumber)
**** WARNING ****: THIS API IS NOT YET FINALIZED.
|
static ControlBindingCreator |
makeControlBindingCreator(java.lang.String name)
Get a ControlBindingCreator that the user can bind, over Cluck, to any
Joystick inputs.
|
static ControlBindingCreator |
makeControlBindingCreator(java.lang.String name,
boolean bypassEmulation)
Get a ControlBindingCreator that the user can bind, over Cluck, to any
Joystick inputs.
|
static BooleanInputPoll |
makeDigitalInput(int id)
Create a reference to a digital input on the specified port.
|
static BooleanInput |
makeDigitalInputByInterrupt(int id)
Create a reference to a digital input on the specified port, as a
BooleanInput (not a BooleanInputPoll) that updates by using FPGA
interrupts or an equivalent.
|
static BooleanOutput |
makeDigitalOutput(int id)
Create a reference to a digital output on the specified port.
|
static BooleanOutput |
makeDSBooleanReadout(java.lang.String prefix,
int line)
Create an output that will display the current value on the driver
station's LCD.
|
static void |
makeDSBooleanReadout(java.lang.String prefix,
int line,
BooleanInputPoll value,
EventInput when)
Display the current value of the specified BooleanInputPoll on the driver
station's LCD, whenever the specified event is triggered.
|
static FloatOutput |
makeDSFloatReadout(java.lang.String prefix,
int line)
Create an output that will display the current value on the driver
station's LCD.
|
static void |
makeDSFloatReadout(java.lang.String prefix,
int line,
FloatInputPoll value,
EventInput when)
Display the current value of the specified FloatInputPoll on the driver
station's LCD, whenever the specified event is triggered.
|
static FloatInputPoll |
makeEncoder(int aChannel,
int bChannel,
boolean reverse)
Create a reference to an Encoder on the specified ports with the
specified number of average bits.
|
static FloatInputPoll |
makeEncoder(int aChannel,
int bChannel,
boolean reverse,
EventInput resetWhen)
Create a reference to an Encoder on the specified ports with the
specified number of average bits.
|
static BooleanOutput |
makeForwardRelay(int channel)
Create a reference to the Forward side of the relay on the specified
channel - this side can be turned on and off.
|
static FloatInputPoll |
makeGyro(int port,
double sensitivity)
Create a reference to a Gyro on the specified port with the specified
sensitivity.
|
static FloatInputPoll |
makeGyro(int port,
double sensitivity,
EventInput evt)
Create a reference to a Gyro on the specified port with the specified
sensitivity.
|
static FloatOutput |
makeJaguarMotor(int id,
boolean negate,
float ramping)
Create a reference to a Jaguar speed controller on the specified PWM port
and motor reversal, with a specified ramping rate.
|
static BooleanOutput |
makeReverseRelay(int channel)
Create a reference to the Reverse side of the relay on the specified
channel - this side can be turned on and off.
|
static SerialIO |
makeRS232_MXP(int baudRate,
java.lang.String deviceName)
Open the roboRIO's MXP-based serial port.
|
static SerialIO |
makeRS232_Onboard(int baudRate,
java.lang.String deviceName)
Open the onboard serial port of the robot.
|
static SerialIO |
makeRS232_USB(int baudRate,
java.lang.String deviceName)
Open a USB-attached serial port on the roboRIO.
|
static FloatOutput |
makeServo(int id,
float minInput,
float maxInput)
Create a reference to a servo controller for the specified port and
minimum and maximum values.
|
static BooleanOutput |
makeSolenoid(int id)
Create a reference to a solenoid on the specified port and the default
module.
|
static BooleanOutput |
makeSolenoid(int module,
int id)
Create a reference to a solenoid on the specified port and module.
|
static FloatOutput |
makeTalonMotor(int id,
boolean negate,
float ramping)
Create a reference to a Talon speed controller on the specified PWM port
and motor reversal, with a specified ramping rate.
|
static FloatOutput |
makeVictorMotor(int id,
boolean negate,
float ramping)
Create a reference to a Victor speed controller on the specified PWM port
and motor reversal, with a specified ramping rate.
|
static void |
registerAutonomous(InstinctModule module)
Register the specified InstinctModule as an autonomous mode.
|
static void |
sendDSUpdate(java.lang.String value,
int line)
Send the specified string to the specified line of the driver station.
|
static void |
useCompressor(int pressureSwitchChannel,
int compressorRelayChannel)
Activate the compressor on the given pressure switch channel and
compressor relay channel.
|
static void |
useCustomCompressor(BooleanInputPoll shouldDisable,
int compressorRelayChannel)
Activate the compressor on the given pressure switch input and compressor
relay channel.
|
static BooleanOutput |
usePCMCompressor()
Get control of the PCM-attached compressor.
|
public static final boolean MOTOR_FORWARD
public static final boolean MOTOR_REVERSE
public static final float NO_RAMPING
public static final int POWER_CHANNEL_BATTERY
public static final int POWER_CHANNEL_3V3
public static final int POWER_CHANNEL_5V
public static final int POWER_CHANNEL_6V
public static final IgneousLauncher launcher
public static final IJoystickWithPOV joystick1
public static final IJoystickWithPOV joystick2
public static final IJoystickWithPOV joystick3
public static final IJoystickWithPOV joystick4
public static final IJoystickWithPOV joystick5
public static final IJoystickWithPOV joystick6
public static final EventInput globalPeriodic
public static final EventInput constantPeriodic
public static final EventInput startAuto
public static final EventInput duringAuto
public static final EventInput startTele
public static final EventInput duringTele
public static final EventInput startTest
public static final EventInput duringTest
public static final EventInput startDisabled
public static final EventInput duringDisabled
public static final IJoystick getKinectJoystick(boolean isRightArm)
isRightArm - If the right arm joystick should be used instead of the
left. (6 instead of 5 if you're used to the old system.)public static FloatOutput makeJaguarMotor(int id, boolean negate, float ramping)
id - the motor port ID, from 1 to 10, inclusive.negate - MOTOR_FORWARD if the motor direction should be unmodified,
MOTOR_REVERSE if the motor direction should be reversed.ramping - the ramping rate.MOTOR_FORWARD,
MOTOR_REVERSEpublic static FloatOutput makeVictorMotor(int id, boolean negate, float ramping)
id - the motor port ID, from 1 to 10, inclusive.negate - MOTOR_FORWARD if the motor direction should be unmodified,
MOTOR_REVERSE if the motor direction should be reversed.ramping - the ramping rate.MOTOR_FORWARD,
MOTOR_REVERSEpublic static FloatOutput makeTalonMotor(int id, boolean negate, float ramping)
id - the motor port ID, from 1 to 10, inclusive.negate - MOTOR_FORWARD if the motor direction should be unmodified,
MOTOR_REVERSE if the motor direction should be reversed.ramping - the ramping rate.MOTOR_FORWARD,
MOTOR_REVERSEpublic static ExtendedMotor makeCANJaguar(int deviceNumber)
deviceNumber - the device number to connect to.public static ExtendedMotor makeCANTalon(int deviceNumber)
deviceNumber - the device number to connect to.public static BooleanOutput makeSolenoid(int id)
id - the port of the solenoid.public static BooleanOutput makeSolenoid(int module, int id)
module - the module of the solenoid (PCM on roboRIO)id - the port of the solenoid.public static BooleanOutput makeDigitalOutput(int id)
id - the port of the digital output.public static FloatInputPoll getBatteryVoltage()
public static FloatInputPoll makeAnalogInput(int id)
id - the port number.public static FloatInputPoll makeAnalogInput(int id, int averageBits)
id - the port number.averageBits - the number of averaging bits.@Deprecated public static FloatInputPoll makeAnalogInput_ValueBased(int id, int averageBits)
id - the port number.averageBits - the number of averaging bits.public static BooleanInputPoll makeDigitalInput(int id)
id - the port number.public static BooleanInput makeDigitalInputByInterrupt(int id)
id - the port number.public static FloatOutput makeServo(int id, float minInput, float maxInput)
id - the port number.minInput - the value on the output that should correspond to the
servo's minimum position.maxInput - the value on the output that should correspond to the
servo's maximum position.public static FloatOutput makeDSFloatReadout(java.lang.String prefix, int line)
prefix - the prefix, or label, of the output. this is prepended to
the value.line - the line to display the value on, from 1 to 6.public static BooleanOutput makeDSBooleanReadout(java.lang.String prefix, int line)
prefix - the prefix, or label, of the output. this is prepended to
the value.line - the line to display the value on, from 1 to 6.public static void makeDSFloatReadout(java.lang.String prefix,
int line,
FloatInputPoll value,
EventInput when)
prefix - the prefix, or label, of the output. this is prepended to
the value.line - the line to display the value on, from 1 to 6.value - the value to display.when - when to update the output.public static void makeDSBooleanReadout(java.lang.String prefix,
int line,
BooleanInputPoll value,
EventInput when)
prefix - the prefix, or label, of the output. this is prepended to
the value.line - the line to display the value on, from 1 to 6.value - the value to display.when - when to update the output.public static void sendDSUpdate(java.lang.String value,
int line)
value - The string to display.line - The line number (1-6).public static BooleanInputPoll getIsDisabled()
public static BooleanInputPoll getIsAutonomous()
public static BooleanInputPoll getIsTest()
public static BooleanInputPoll getIsTeleop()
public static BooleanInputPoll getIsFMS()
public static void useCompressor(int pressureSwitchChannel,
int compressorRelayChannel)
pressureSwitchChannel - the channel of the pressure switch digital
input.compressorRelayChannel - the channel of the compressor's relay.public static BooleanOutput usePCMCompressor()
public static BooleanInputPoll getPCMPressureSwitch()
public static BooleanInputPoll getPCMCompressorRunning()
public static FloatInputPoll getPCMCompressorCurrent()
public static FloatInputPoll getPDPChannelCurrent(int channel)
channel - the channel to monitorpublic static FloatInputPoll getPDPVoltage()
public static FloatInputPoll getChannelVoltage(int powerChannel)
powerChannel - the power channel to read from.public static FloatInputPoll getChannelCurrent(int powerChannel)
powerChannel - the power channel to read from.public static BooleanInputPoll getChannelEnabled(int powerChannel)
powerChannel - the power channel to read from.public static boolean isRoboRIO()
public static void useCustomCompressor(BooleanInputPoll shouldDisable, int compressorRelayChannel)
shouldDisable - should the compressor be turned off.compressorRelayChannel - the channel of the compressor's relay.public static FloatInputPoll makeEncoder(int aChannel, int bChannel, boolean reverse, EventInput resetWhen)
aChannel - The alpha-channel for the encoder.bChannel - The beta-channel for the encoder.reverse - Should the result of the encoder be negated?resetWhen - If provided, the Encoder's value will be reset when this
event is produced.public static FloatInputPoll makeEncoder(int aChannel, int bChannel, boolean reverse)
aChannel - The alpha-channel for the encoder.bChannel - The beta-channel for the encoder.reverse - Should the result of the encoder be negated?public static BooleanOutput makeForwardRelay(int channel)
channel - The relay channel.public static BooleanOutput makeReverseRelay(int channel)
channel - The relay channel.public static FloatInputPoll makeGyro(int port, double sensitivity, EventInput evt)
port - The Gyro port number.sensitivity - The sensitivity of the Gyro. This is the number of
volts/degree/second sensitivity of the gyro and is used in calculations
to allow the code to work with multiple gyros. 0.007 is a good default
value.evt - When to reset the Gyro.public static FloatInputPoll makeGyro(int port, double sensitivity)
port - The Gyro port number.sensitivity - The sensitivity of the Gyro. This is the number of
volts/degree/second sensitivity of the gyro and is used in calculations
to allow the code to work with multiple gyros. 0.007 is a good default
value.@Deprecated public static FloatInputPoll makeAccelerometerAxis(int port, double sensitivity, double zeropoint)
port - The port number to attach to.sensitivity - The sensitivity of the accelerometer. This varies per
model.zeropoint - The voltage that corresponds to 0 G. This also varies by
model.public static void registerAutonomous(InstinctModule module)
module - the InstinctModule to register.public static SerialIO makeRS232_Onboard(int baudRate, java.lang.String deviceName)
baudRate - the baud rate of the port.deviceName - the name of the device the serial port is connected to
(used for debugging and the emulator.)public static SerialIO makeRS232_MXP(int baudRate, java.lang.String deviceName)
baudRate - the baud rate of the port.deviceName - the name of the device the serial port is connected to
(used for debugging and the emulator.)public static SerialIO makeRS232_USB(int baudRate, java.lang.String deviceName)
baudRate - the baud rate of the port.deviceName - the name of the device the serial port is connected to
(used for debugging and the emulator.)public static ControlBindingDataSource getControlBindingDataSource()
if you want to provide your
own names, or use a different number of Joysticks.,
if you just want to bind
controls.public static ControlBindingCreator makeControlBindingCreator(java.lang.String name, boolean bypassEmulation)
name - the name of the module that this creator is for. For example,
"Drive Code".bypassEmulation - if the emulator shouldn't try to emulate control
bindings directly.public static ControlBindingCreator makeControlBindingCreator(java.lang.String name)
name - the name of the module that this creator is for. For example,
"Drive Code".if you want to choose
whether or not the emulator emulates control bindings directly.public static ControlBindingDataSource getControlBindingDataSource(java.lang.String... names)
getControlBindingDataSource() but lets you
give better names to your Joysticks. For example, you could say
Igneous.getControlBindingDataSource("Drive Joystick", "Copilot Joystick");names - the names of the Joysticks to attach to, in order.