微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

edu.wpi.first.wpilibj.interfaces.Accelerometer.Range的实例源码

项目:FRC2549-2016    文件DrivetrainSubsystem.java   
public DrivetrainSubsystem(){
    leftMotor = RobotMap.leftDriveMotor.getController();
    rightMotor = RobotMap.rightDriveMotor.getController();
    drive = new RobotDrive(leftMotor,rightMotor);

    accelerometer = new IntegratedBuiltinAccelerometer(Range.k2G);

    leftEncoder = new Encoder(RobotMap.leftEncoder[0],RobotMap.leftEncoder[1]);
    rightEncoder = new Encoder(RobotMap.rightEncoder[0],RobotMap.rightEncoder[1]);
    leftEncoder.setReverseDirection(true);
    rightEncoder.setReverseDirection(true);

    driveGyro = new AnalogGyro(RobotMap.driveGyroPort);
    driveGyro.reset();
    driveGyro.setSensitivity(0.007);


}
项目:Recyclerush2015    文件Robot.java   
public Robot() {
    super("Sailors",0x612);
    this.sdTable = NetworkTable.getTable("SmartDashboard");

    Talon winchMotor = new Talon(Channels.WINCH_MOTOR);

    Console.debug("Creating and Initializing Controls/Motor Scheme/Senses...");
    this.control = new DualJoystickControl(JOYSTICK_LEFT,JOYSTICK_RIGHT);
    this.control.setMagnitudeThreshold(MAG_STICK_DEADBAND);
    this.control.setTwistThreshold(TWIST_STICK_DEADBAND);
    this.motors = MotorScheme.Builder.newFourMotorDrive(FL_DMOTOR,RL_DMOTOR,FR_DMOTOR,RR_DMOTOR).setInverted(false,true).setDriveManager(DriveManager.MECANUM_POLAR).addMotor(winchMotor).build();
    this.motors.getRobotDrive().setMaxOutput(DRIVE_SCALE_FACTOR);
    this.senses = BasicSense.makeBuiltInSense(Range.k4G);
    this.pneumatics = new PneumaticControl();
    this.winch = new WinchControl(winchMotor,this.upWinchValue,this.downWinchValue);

    Console.debug("Initializing Button Actions...");
    this.control.putButtonAction(ID_SWAP_JOYSTICKS,"Swap Joysticks",this.control::swapJoysticks,Hand.BOTH);
    this.control.putButtonAction(ID_disABLE_TWIST,"Toggle Left Twist",() -> this.control.toggledisableTwistAxis(Hand.LEFT),Hand.LEFT);
    this.control.putButtonAction(ID_disABLE_TWIST,"Toggle Right Twist",() -> this.control.toggledisableTwistAxis(Hand.RIGHT),Hand.RIGHT);

    Console.debug("Starting Camera Capture...");
    this.camera = new USBCamera();
    this.camera.setSize(CameraSize.MEDIUM);
    CameraStream.INSTANCE.startAutomaticCapture(this.camera);
    Console.debug(String.format("Resolution: %dx%d | Quality: %s | FPS: %s",this.camera.getSize().WIDTH,this.camera.getSize().HEIGHT,this.camera.getQuality().name(),this.camera.getFPS().kFPS));
}
项目:strongback-java    文件Hardware.java   
/**
 * Create a new {@link ThreeAxisAccelerometer} for the ADXL345 with the desired range using the specified I2C port.
 *
 * @param port the I2C port used by the accelerometer
 * @param range the desired range of the accelerometer
 * @return the accelerometer; never null
 */
public static ThreeAxisAccelerometer accelerometer(I2C.Port port,Range range) {
    if (port == null) throw new IllegalArgumentException("The I2C port must be specified");
    if (range == null) throw new IllegalArgumentException("The accelerometer range must be specified");
    ADXL345_I2C accel = new ADXL345_I2C(port,range);
    return ThreeAxisAccelerometer.create(accel::getX,accel::getY,accel::getZ);
}
项目:strongback-java    文件Hardware.java   
/**
 * Create a new {@link ThreeAxisAccelerometer} for the ADXL345 with the desired range using the specified SPI port.
 *
 * @param port the SPI port used by the accelerometer
 * @param range the desired range of the accelerometer
 * @return the accelerometer; never null
 */
public static ThreeAxisAccelerometer accelerometer(SPI.Port port,Range range) {
    if (port == null) throw new IllegalArgumentException("The I2C port must be specified");
    if (range == null) throw new IllegalArgumentException("The accelerometer range must be specified");
    ADXL345_SPI accel = new ADXL345_SPI(port,accel::getZ);
}
项目:atalibj    文件acceleration.java   
/**
 * Sets the measuring range of an accelerometer.
 *
 * @param range the maximum acceleration,positive or negative,that the
 * accelerometer will measure
 */
public static void setRange(Range range) {
    accelerometer.setRange(range);
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。