当前位置: 首页>>代码示例>>Java>>正文


Java Gyro类代码示例

本文整理汇总了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;
}
 
开发者ID:ArcticWarriors,项目名称:snobot-2017,代码行数:26,代码来源:Positioner.java

示例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;
}
 
开发者ID:ArcticWarriors,项目名称:snobot-2017,代码行数:26,代码来源:SimplePositioner.java

示例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;
}
 
开发者ID:ArcticWarriors,项目名称:snobot-2017,代码行数:52,代码来源:Positioner.java

示例4: GyroInput

import edu.wpi.first.wpilibj.interfaces.Gyro; //导入依赖的package包/类
public GyroInput(Gyro gyro) {
	this.gyro = gyro;
	type = PIDSourceType.kDisplacement;
}
 
开发者ID:Team694,项目名称:DriveStraightBot,代码行数:5,代码来源:Drivetrain.java

示例5: PIDGyro

import edu.wpi.first.wpilibj.interfaces.Gyro; //导入依赖的package包/类
public PIDGyro(Gyro gyro){
	this.gyro = gyro;
}
 
开发者ID:FIRST-Team-1699,项目名称:2017-code,代码行数:4,代码来源:PIDGyro.java

示例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();
}
 
开发者ID:ArcticWarriors,项目名称:snobot-2017,代码行数:21,代码来源:IMUPositioner.java

示例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);
}
 
开发者ID:strongback,项目名称:strongback-java,代码行数:11,代码来源:Hardware.java


注:本文中的edu.wpi.first.wpilibj.interfaces.Gyro类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。