當前位置: 首頁>>代碼示例>>Java>>正文


Java SpeedController.get方法代碼示例

本文整理匯總了Java中edu.wpi.first.wpilibj.SpeedController.get方法的典型用法代碼示例。如果您正苦於以下問題:Java SpeedController.get方法的具體用法?Java SpeedController.get怎麽用?Java SpeedController.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在edu.wpi.first.wpilibj.SpeedController的用法示例。


在下文中一共展示了SpeedController.get方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: get

import edu.wpi.first.wpilibj.SpeedController; //導入方法依賴的package包/類
/**
 * The current speed of this Drivetrain
 * @return the current PWM value of the SpeedController collection (-1.0 to 1.0)
 */
public double get() {
    // All of the SpeedControllers will always be set to the same value,
    // so simply get the value of the first one.
    final SpeedController controller = (SpeedController) motorControllers.firstElement();
    return inversion * controller.get();
}
 
開發者ID:FRC3161,項目名稱:Iapetus2014,代碼行數:11,代碼來源:Drivetrain.java

示例2: getAll

import edu.wpi.first.wpilibj.SpeedController; //導入方法依賴的package包/類
/**
 * The speeds of all SpeedControllers within this Drivetrain.
 * They should all be nearly identical, other than error due to floating point
 * precision.
 * @return an array enumerating all the current PWM values of the SpeedController collection (-1.0 to 1.0)
 */
public double[] getAll() {
    final double[] result = new double[motorControllers.size()];
    for (int i = 0; i < motorControllers.size(); ++i) {
        final SpeedController controller = (SpeedController) motorControllers.elementAt(i);
        result[i] = controller.get();
    }
    return result;
}
 
開發者ID:FRC3161,項目名稱:Iapetus2014,代碼行數:15,代碼來源:Drivetrain.java

示例3: PIDVelocityController

import edu.wpi.first.wpilibj.SpeedController; //導入方法依賴的package包/類
/**
 * Initializes the PID controller, the output motor, and the input
 * encoder without a feedforward coefficient (Kf).
 *
 * @param motor
 *            motor to use as PID output
 * @param encoder
 *            encoder to use as the PID rate input
 * @param Kp
 *            Proportional coefficient
 * @param Ki
 *            Integral coefficient
 * @param Kd
 *            Derivative coefficient
 * @author Noah Golmant
 * @written 11 Feb 2014
 */
PIDVelocityController (final SpeedController motor,
        final Encoder encoder,
        double Kp, double Ki, double Kd)
{
    // Initialize the PIDController using the base PIDSubsystem constructor
    super(Kp, Ki, Kd);

    // Set the PID input, output, and initial speed.
    this.motor = motor;
    this.encoder = encoder;
    this.setSpeed = motor.get();
}
 
開發者ID:FIRST-Team-339,項目名稱:2017,代碼行數:30,代碼來源:PIDVelocityController.java


注:本文中的edu.wpi.first.wpilibj.SpeedController.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。