当前位置: 首页>>代码示例>>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;未经允许,请勿转载。