Java 类edu.wpi.first.wpilibj.interfaces.Gyro 实例源码

项目:snobot-2017    文件:Positioner.java   
/**
 * 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;
}
项目:snobot-2017    文件:SimplePositioner.java   
/**
 * 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;
}
项目:snobot-2017    文件:Positioner.java   
/**
 * 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;
}
项目:DriveStraightBot    文件:Drivetrain.java   
public GyroInput(Gyro gyro) {
    this.gyro = gyro;
    type = PIDSourceType.kDisplacement;
}
项目:2017-code    文件:PIDGyro.java   
public PIDGyro(Gyro gyro){
    this.gyro = gyro;
}
项目:snobot-2017    文件:IMUPositioner.java   
/**
 * 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();
}
项目:strongback-java    文件:Hardware.java   
/**
 * 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);
}