Beispiel #1
0
        /**
         * Gets all PID set persistant settings (overloaded so timeoutMs is 50 ms
         * and pidIdx is 0).
         *
         * @param pid               Object with all of the PID set persistant settings
         */
        public void GetPIDConfigs(out TalonSRXPIDSetConfiguration pid, int pidIdx = 0, int timeoutMs = 50)
        {
            pid = new TalonSRXPIDSetConfiguration();

            BaseGetPIDConfigs(pid, pidIdx, timeoutMs);
            pid.selectedFeedbackSensor = (FeedbackDevice)ConfigGetParameter(ParamEnum.eFeedbackSensorType, pidIdx, timeoutMs);
        }
Beispiel #2
0
        /**
         * Gets all PID set persistant settings.
         *
         * @param pid               Object with all of the PID set persistant settings
         * @param pidIdx            0 for Primary closed-loop. 1 for auxiliary closed-loop.
         * @param timeoutMs
         *              Timeout value in ms. If nonzero, function will wait for
         *              config success and report an error if it times out.
         *              If zero, no blocking or checking is performed.
         */
        public ErrorCode ConfigurePID(TalonSRXPIDSetConfiguration pid, int pidIdx = 0, int timeoutMs = 50)
        {
            ErrorCollection errorCollection = new ErrorCollection();

            //------ sensor selection ----------//

            errorCollection.NewError(BaseConfigurePID(pid, pidIdx, timeoutMs));
            errorCollection.NewError(ConfigSelectedFeedbackSensor(pid.selectedFeedbackSensor, pidIdx, timeoutMs));

            return(errorCollection._worstError);
        }
Beispiel #3
0
        public TalonSRXConfiguration()
        {
            primaryPID  = new TalonSRXPIDSetConfiguration();
            auxilaryPID = new TalonSRXPIDSetConfiguration();

            forwardLimitSwitchSource = LimitSwitchSource.FeedbackConnector;
            reverseLimitSwitchSource = LimitSwitchSource.FeedbackConnector;
            sum_0                  = FeedbackDevice.QuadEncoder;
            sum_1                  = FeedbackDevice.QuadEncoder;
            diff_0                 = FeedbackDevice.QuadEncoder;
            diff_1                 = FeedbackDevice.QuadEncoder;
            peakCurrentLimit       = 1;
            peakCurrentDuration    = 1;
            continuousCurrentLimit = 1;
        }