Пример #1
0
        public ArrayList GetTalonInfo()
        {
            ArrayList talonInfoList = new ArrayList();

            TalonSRX  t;
            TalonInfo info = new TalonInfo();

            t                    = leftActuator;
            info.CAN_ID          = (short)t.GetDeviceID();
            info.percentOutput   = TalonInfo.ConvertPercentOutputToByte((int)(100 * t.GetMotorOutputPercent()));
            info.currentDraw     = TalonInfo.ConvertCurrentToShort(t.GetOutputCurrent());
            info.encoderPosition = TalonInfo.ConvertEncoderPositionToShort(t.GetSelectedSensorPosition());
            info.encoderVelocity = (short)t.GetSelectedSensorVelocity();
            talonInfoList.Add(new TalonInfo(info));


            t                    = rightActuator;
            info.CAN_ID          = (short)t.GetDeviceID();
            info.percentOutput   = TalonInfo.ConvertPercentOutputToByte((int)(100 * t.GetMotorOutputPercent()));
            info.currentDraw     = TalonInfo.ConvertCurrentToShort(t.GetOutputCurrent());
            info.encoderPosition = TalonInfo.ConvertEncoderPositionToShort(t.GetSelectedSensorPosition());
            info.encoderVelocity = (short)t.GetSelectedSensorVelocity();
            talonInfoList.Add(new TalonInfo(info));


            t                    = augerRotator;
            info.CAN_ID          = (short)t.GetDeviceID();
            info.percentOutput   = TalonInfo.ConvertPercentOutputToByte((int)(100 * t.GetMotorOutputPercent()));
            info.currentDraw     = TalonInfo.ConvertCurrentToShort(t.GetOutputCurrent());
            info.encoderPosition = TalonInfo.ConvertEncoderPositionToShort(t.GetSelectedSensorPosition());
            info.encoderVelocity = (short)t.GetSelectedSensorVelocity();
            talonInfoList.Add(new TalonInfo(info));

            info.CAN_ID        = (short)CAN_IDs.EXCAVATION.AUGER_EXTENDER;
            info.percentOutput = TalonInfo.ConvertPercentOutputToByte((int)(100 * augerExtender.GetDirectionAsVBUS()));
            info.currentDraw   = -1;
            int encoderPos = 0;

            if (reverseLimitSwitch.IsPressed())
            {
                encoderPos = -1;
            }
            else if (forwardLimitSwitch.IsPressed())
            {
                encoderPos = 1;
            }
            info.encoderPosition = encoderPos * 100;
            info.encoderVelocity = info.percentOutput;
            talonInfoList.Add(new TalonInfo(info));


            return(talonInfoList);
        }
Пример #2
0
        public ArrayList GetTalonInfo()
        {
            ArrayList talonInfoList = new ArrayList();

            TalonSRX  t;
            TalonInfo info = new TalonInfo();

            t                    = FrontLeft;
            info.CAN_ID          = (short)t.GetDeviceID();
            info.percentOutput   = TalonInfo.ConvertPercentOutputToByte((int)(100 * t.GetMotorOutputPercent()));
            info.currentDraw     = TalonInfo.ConvertCurrentToShort(t.GetOutputCurrent());
            info.encoderPosition = TalonInfo.ConvertEncoderPositionToShort(t.GetSelectedSensorPosition());
            info.encoderVelocity = (short)t.GetSelectedSensorVelocity();

            talonInfoList.Add(new TalonInfo(info));

            t                    = FrontRight;
            info.CAN_ID          = (short)t.GetDeviceID();
            info.percentOutput   = TalonInfo.ConvertPercentOutputToByte((int)(100 * t.GetMotorOutputPercent()));
            info.currentDraw     = TalonInfo.ConvertCurrentToShort(t.GetOutputCurrent());
            info.encoderPosition = TalonInfo.ConvertEncoderPositionToShort(t.GetSelectedSensorPosition());
            info.encoderVelocity = (short)t.GetSelectedSensorVelocity();
            talonInfoList.Add(new TalonInfo(info));

            t                    = BackLeft;
            info.CAN_ID          = (short)t.GetDeviceID();
            info.percentOutput   = TalonInfo.ConvertPercentOutputToByte((int)(100 * t.GetMotorOutputPercent()));
            info.currentDraw     = TalonInfo.ConvertCurrentToShort(t.GetOutputCurrent());
            info.encoderPosition = TalonInfo.ConvertEncoderPositionToShort(t.GetSelectedSensorPosition());
            info.encoderVelocity = (short)t.GetSelectedSensorVelocity();
            talonInfoList.Add(new TalonInfo(info));

            t                    = BackRight;
            info.CAN_ID          = (short)t.GetDeviceID();
            info.percentOutput   = TalonInfo.ConvertPercentOutputToByte((int)(100 * t.GetMotorOutputPercent()));
            info.currentDraw     = TalonInfo.ConvertCurrentToShort(t.GetOutputCurrent());
            info.encoderPosition = TalonInfo.ConvertEncoderPositionToShort(t.GetSelectedSensorPosition());
            info.encoderVelocity = (short)t.GetSelectedSensorVelocity();
            talonInfoList.Add(new TalonInfo(info));

            return(talonInfoList);
        }