예제 #1
0
    public void DriveDistance(double distance)
    {
        //double position = (distance * 12) / (4 * Math.PI);

        //RightPrimary.SetPosition(position);
        //RightSecondary.SetPosition(position);

        //LeftPrimary.SetPosition(position);
        //LeftSecondary.SetPosition(position);



        WPILib.Timer timer = new WPILib.Timer();
        timer.Reset();
        timer.Start();

        while (timer.Get() < distance)
        {
            RightPrimary.Set(.5);
            RightSecondary.Set(.5);

            LeftPrimary.Set(-.5);
            LeftSecondary.Set(-.5);
        }

        timer.Stop();


        RightPrimary.Set(0);
        RightSecondary.Set(0);

        LeftPrimary.Set(0);
        LeftSecondary.Set(0);
    }
예제 #2
0
 /// <summary>
 /// Retunrs the change in setpoing over time of the PIDController.
 /// </summary>
 /// <returns>The change in setpoint over time.</returns>
 public double GetDeltaSetpoint()
 {
     return((m_setpoint - m_prevSetpoint) / m_setpointTimer.Get());
 }