本文整理汇总了Java中edu.wpi.first.wpilibj.interfaces.Gyro类的典型用法代码示例。如果您正苦于以下问题:Java Gyro类的具体用法?Java Gyro怎么用?Java Gyro使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Gyro类属于edu.wpi.first.wpilibj.interfaces包,在下文中一共展示了Gyro类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Positioner
import edu.wpi.first.wpilibj.interfaces.Gyro; //导入依赖的package包/类
/**
* Creates a new Positioner object.
*
* @param aGyro
* The Gyro to use.
* @param aDriveTrain
* The DriveTrain to use.
* @param aLogger
* The robot's Logger.
*/
public Positioner(Gyro aGyro, IDriveTrain aDriveTrain, ILogger aLogger)
{
mXPosition = 0;
mYPosition = 0;
mOrientation = 0;
mTotalDistance = 0;
mLastDistance = 0;
mLastTime = 0;
mSpeed = 0;
mGyro = aGyro;
mDriveTrain = aDriveTrain;
mTimer = new Timer();
mLogger = aLogger;
mStartAngle = 0;
}
示例2: SimplePositioner
import edu.wpi.first.wpilibj.interfaces.Gyro; //导入依赖的package包/类
/**
* Creates a new Positioner object.
*
* @param aGyro
* The Gyro to use.
* @param aDriveTrain
* The DriveTrain to use.
* @param aLogger
* The robot's Logger.
*/
public SimplePositioner(Gyro aGyro, IDriveTrain aDriveTrain, Logger aLogger)
{
mXPosition = 0;
mYPosition = 0;
mOrientation = 0;
mTotalDistance = 0;
mLastDistance = 0;
mLastTime = 0;
mSpeed = 0;
mGyro = aGyro;
mDriveTrain = aDriveTrain;
mTimer = new Timer();
mLogger = aLogger;
mStartAngle = 0;
}
示例3: Positioner
import edu.wpi.first.wpilibj.interfaces.Gyro; //导入依赖的package包/类
/**
* Creates a new Positioner object.
*
* @param aGyro
* The Gyro to use.
* @param aDriveTrain
* The DriveTrain to use.
* @param aLogger
* The robot's Logger.
* @param aAccelerometer
* The robot's accelerometer
*/
public Positioner(Gyro aGyro, IDriveTrain aDriveTrain, Logger aLogger, Accelerometer aAccelerometer)
{
mXPosition = 0;
mYPosition = 0;
mOrientation = 0;
mTotalDistance = 0;
mLastDistance = 0;
mLastTime = 0;
mSpeed = 0;
mGyro = aGyro;
mDriveTrain = aDriveTrain;
mTimer = new Timer();
mLogger = aLogger;
mStartAngle = 0;
mVelocityX = 0;
mVelocityY = 0;
mAccelerometer = aAccelerometer;
mErrorX = 0;
mErrorY = 0;
mErrorZ = 0;
// TODO Get rid of these when done testing
encoderXVelocity = 0;
encoderYVelocity = 0;
accelXVelocity = 0;
accelYVelocity = 0;
avgFiltXVelocity = 0;
avgFiltYVelocity = 0;
compFiltXVelocity = 0;
compFiltYVelocity = 0;
mAvgFiltXPos = 0;
mAvgFiltYPos = 0;
mCompFiltXPos = 0;
mCompFiltYPos = 0;
isFirstTime = true;
}
示例4: GyroInput
import edu.wpi.first.wpilibj.interfaces.Gyro; //导入依赖的package包/类
public GyroInput(Gyro gyro) {
this.gyro = gyro;
type = PIDSourceType.kDisplacement;
}
示例5: PIDGyro
import edu.wpi.first.wpilibj.interfaces.Gyro; //导入依赖的package包/类
public PIDGyro(Gyro gyro){
this.gyro = gyro;
}
示例6: IMUPositioner
import edu.wpi.first.wpilibj.interfaces.Gyro; //导入依赖的package包/类
/**
* Creates a new Positioner object.
*
* @param aGyro
* The Gyro to use.
* @param aAccelerometer
* The accelerometer to use.
* @param aDriveTrain
* The DriveTrain to use.
* @param aLogger
* The robot's Logger.
*/
public IMUPositioner(Gyro aGyro, Accelerometer aAccelerometer, IDriveTrain aDriveTrain, Logger aLogger)
{
mGyro = aGyro;
mAccelerometer = aAccelerometer;
mDriveTrain = aDriveTrain;
mLogger = aLogger;
mTimer = new Timer();
}
示例7: gyroscope
import edu.wpi.first.wpilibj.interfaces.Gyro; //导入依赖的package包/类
/**
* Create a {@link Gyroscope} that uses the provided WPILib {@link Gyro}. Use this method if you need to
* {@link Gyro#calibrate() calibrate} before using it.
*
* @param gyro the low-level WPILib gyroscope
* @return the gyroscope; never null
*/
public static Gyroscope gyroscope(Gyro gyro) {
return Gyroscope.create(gyro::getAngle, gyro::getRate);
}