示例#1
0
  private void initSmartDashboard() {

    SmartDashboard.putNumber(m_name + " P", m_talon.getP());
    SmartDashboard.putNumber(m_name + " I", m_talon.getI());
    SmartDashboard.putNumber(m_name + " D", m_talon.getD());
    SmartDashboard.putNumber(m_name + " F", m_talon.getF());
    SmartDashboard.putNumber(m_name + " I*100", (m_talon.getI()) * 100);

    SmartDashboard.putNumber(m_name + " Talon Setpoint", m_setpoint);
    SmartDashboard.putNumber(m_name + " Position", m_talon.getPosition());
    SmartDashboard.putNumber(m_name + " Tolerance", m_tolerance);
    SmartDashboard.putNumber(m_name + " Error", m_talon.getClosedLoopError());
    SmartDashboard.putNumber(m_name + " Output", m_talon.get());
    SmartDashboard.putBoolean(m_name + " Enabled", m_talon.isControlEnabled());
  }
示例#2
0
  /**
   * Set the PID Controller gain parameters. Set the proportional, integral, and differential
   * coefficients.
   *
   * @param p Proportional coefficient
   * @param i Integral coefficient
   * @param d Differential coefficient
   */
  public synchronized void setPID(double p, double i, double d) {
    m_P = p;
    m_I = i;
    m_D = d;

    m_talon.setProfile(0);
    m_talon.setP(p);
    m_talon.setI(i);
    m_talon.setD(d);

    if (m_debugging) {
      SmartDashboard.putNumber(m_name + " P", m_talon.getP());
      SmartDashboard.putNumber(m_name + " I", m_talon.getI());
      SmartDashboard.putNumber(m_name + " D", m_talon.getD());
    }
  }