|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.wpi.first.wpilibj.SensorBase edu.wpi.first.wpilibj.Gyro edu.wpi.first.wpilibj.smartdashboard.SendableGyro
public class SendableGyro
The SendableGyro
class behaves exactly the same as a Gyro
except that it
also implements SmartDashboardData
so that it can be sent over to the SmartDashboard
.
Field Summary |
---|
Fields inherited from class edu.wpi.first.wpilibj.SensorBase |
---|
kAnalogChannels, kAnalogModules, kDigitalChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond, n_simProperties |
Constructor Summary | |
---|---|
SendableGyro(AnalogChannel channel)
Gyro constructor with a precreated analog channel object. |
|
SendableGyro(int channel)
Gyro constructor with only a channel. |
|
SendableGyro(int moduleNumber,
int channel)
Gyro constructor given a module and a channel. |
Method Summary | |
---|---|
double |
getAngle()
Return the actual angle in degrees that the robot is currently facing. |
NetworkTable |
getTable()
Returns the NetworkTable associated with the data. |
java.lang.String |
getType()
Returns the type of the data. |
double |
getUpdatePeriod()
Returns the period (in seconds) between updates to the SmartDashboard . |
void |
reset()
Reset the gyro. |
void |
resetToAngle(double angle)
Reset the gyro. |
void |
setUpdatePeriod(double period)
Sets the time (in seconds) between updates to the SmartDashboard . |
Methods inherited from class edu.wpi.first.wpilibj.Gyro |
---|
free, pidGet, setSensitivity |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SendableGyro(int moduleNumber, int channel)
moduleNumber
- The cRIO module number for the analog module the gyro is connected to.channel
- The analog channel the gyro is connected to.public SendableGyro(int channel)
channel
- The analog channel the gyro is connected to.public SendableGyro(AnalogChannel channel)
channel
- The AnalogChannel object that the gyro is connected to.Method Detail |
---|
public double getAngle()
Gyro
getAngle
in class Gyro
public void reset()
Gyro
reset
in class Gyro
public void setUpdatePeriod(double period)
SmartDashboard
.
The default is 0.2 seconds.
period
- the new time between updates
java.lang.IllegalArgumentException
- if given a period that is less than or equal to 0public double getUpdatePeriod()
SmartDashboard
.
This value is independent of whether or not this SendableGyro
is connected
to the SmartDashboard
. The default value is 0.2 seconds.
public void resetToAngle(double angle)
angle
- the angle the gyro should believe it is pointingpublic java.lang.String getType()
SmartDashboardData
getTable()
.
For instance, if the type was "Button", then the SmartDashboard would show the data
as a button on the desktop and would know to look at and modify the "pressed" field in the
NetworkTable
returned by getTable()
.
getType
in interface SmartDashboardData
public NetworkTable getTable()
SmartDashboardData
NetworkTable
associated with the data.
The table should contain all the information the desktop version of SmartDashboard needs
to interact with the object. The data should both keep the table up-to-date and also react
to changes that the SmartDashboard might make.
For instance, the SendablePIDController
will put its p, i and d values into its table
and will change them if the table receives new values.
This method should return the same table between calls
getTable
in interface SmartDashboardData
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |