• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PIDSourceParameter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中edu.wpi.first.wpilibj.PIDSource.PIDSourceParameter的典型用法代码示例。如果您正苦于以下问题:Java PIDSourceParameter类的具体用法?Java PIDSourceParameter怎么用?Java PIDSourceParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PIDSourceParameter类属于edu.wpi.first.wpilibj.PIDSource包,在下文中一共展示了PIDSourceParameter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

import edu.wpi.first.wpilibj.PIDSource.PIDSourceParameter; //导入依赖的package包/类
public static void init() {
    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    driveTrainleftFrontTalon0 = new TalonSRX(0);
    LiveWindow.addActuator("DriveTrain", "leftFrontTalon0", (TalonSRX) driveTrainleftFrontTalon0);
    
    driveTrainleftBackTalon1 = new TalonSRX(1);
    LiveWindow.addActuator("DriveTrain", "leftBackTalon1", (TalonSRX) driveTrainleftBackTalon1);
    
    driveTrainrightFrontTalon2 = new TalonSRX(2);
    LiveWindow.addActuator("DriveTrain", "rightFrontTalon2", (TalonSRX) driveTrainrightFrontTalon2);
    
    driveTrainrightBackTalon3 = new TalonSRX(3);
    LiveWindow.addActuator("DriveTrain", "rightBackTalon3", (TalonSRX) driveTrainrightBackTalon3);
    
    driveTrainRobotDrive = new RobotDrive(driveTrainleftFrontTalon0, driveTrainleftBackTalon1,
          driveTrainrightFrontTalon2, driveTrainrightBackTalon3);
    
    driveTrainRobotDrive.setSafetyEnabled(true);
    driveTrainRobotDrive.setExpiration(0.1);
    driveTrainRobotDrive.setSensitivity(0.5);
    driveTrainRobotDrive.setMaxOutput(1.0);

    driveTraingyro = new Gyro(0);
    LiveWindow.addSensor("DriveTrain", "gyro", driveTraingyro);
    driveTraingyro.setSensitivity(0.007);
    driveTrainleftFrontEncoder = new Encoder(17, 18, false, EncodingType.k4X);
    LiveWindow.addSensor("DriveTrain", "leftFrontEncoder", driveTrainleftFrontEncoder);
    driveTrainleftFrontEncoder.setDistancePerPulse(1.0);
    driveTrainleftFrontEncoder.setPIDSourceParameter(PIDSourceParameter.kRate);
    driveTrainleftBackEncoder = new Encoder(19, 20, false, EncodingType.k4X);
    LiveWindow.addSensor("DriveTrain", "leftBackEncoder", driveTrainleftBackEncoder);
    driveTrainleftBackEncoder.setDistancePerPulse(1.0);
    driveTrainleftBackEncoder.setPIDSourceParameter(PIDSourceParameter.kRate);
    driveTrainrightFrontEncoder = new Encoder(21, 22, false, EncodingType.k4X);
    LiveWindow.addSensor("DriveTrain", "rightFrontEncoder", driveTrainrightFrontEncoder);
    driveTrainrightFrontEncoder.setDistancePerPulse(1.0);
    driveTrainrightFrontEncoder.setPIDSourceParameter(PIDSourceParameter.kRate);
    driveTrainrightBackEncoder = new Encoder(23, 24, false, EncodingType.k4X);
    LiveWindow.addSensor("DriveTrain", "rightBackEncoder", driveTrainrightBackEncoder);
    driveTrainrightBackEncoder.setDistancePerPulse(1.0);
    driveTrainrightBackEncoder.setPIDSourceParameter(PIDSourceParameter.kRate);

// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
 
开发者ID:sfhsfembot,项目名称:RecycledRushDriveTrain,代码行数:45,代码来源:RobotMap.java


示例2: init

import edu.wpi.first.wpilibj.PIDSource.PIDSourceParameter; //导入依赖的package包/类
public static void init() {
    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    driveTrainleftMotor = new Talon(0);
    LiveWindow.addActuator("DriveTrain", "leftMotor", (Talon) driveTrainleftMotor);
    
    driveTrainrightMotor = new Talon(1);
    LiveWindow.addActuator("DriveTrain", "rightMotor", (Talon) driveTrainrightMotor);
    
    driveTrainMotors = new RobotDrive(driveTrainleftMotor, driveTrainrightMotor);
    
    driveTrainMotors.setSafetyEnabled(true);
    driveTrainMotors.setExpiration(0.1);
    driveTrainMotors.setSensitivity(0.5);
    driveTrainMotors.setMaxOutput(1.0);
    

    driveTrainwheelRotations = new Encoder(2, 3, false, EncodingType.k4X);
    LiveWindow.addSensor("DriveTrain", "wheelRotations", driveTrainwheelRotations);
    driveTrainwheelRotations.setDistancePerPulse(0.102);
    driveTrainwheelRotations.setPIDSourceParameter(PIDSourceParameter.kRate);
    driveTraingyro = new Gyro(0);
    LiveWindow.addSensor("DriveTrain", "gyro", driveTraingyro);
    driveTraingyro.setSensitivity(0.0015);
    driveTrainrangeFinder = new AnalogInput(1);
    LiveWindow.addSensor("DriveTrain", "rangeFinder", driveTrainrangeFinder);
    
    armSolenoid = new DoubleSolenoid(0, 0, 1);      
    LiveWindow.addActuator("Arms", "armSolenoid", armSolenoid);
    
    armWidthLimit = new DigitalInput(1);
    LiveWindow.addSensor("Arms", "armWidthLimit", armWidthLimit);
    
    elevatorlimitSwitch = new DigitalInput(0);
    LiveWindow.addSensor("Elevator", "limitSwitch", elevatorlimitSwitch);
    
    elevatorSolenoid = new DoubleSolenoid(0, 6, 7);      
    LiveWindow.addActuator("Elevator", "elevatorSolenoid", elevatorSolenoid);
    
    rcSolenoid = new DoubleSolenoid(0, 4, 5); 
    LiveWindow.addActuator("RC Picker Upper Sole", "rcSolenoid", rcSolenoid);

// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
 
开发者ID:FRC-5506,项目名称:RecycleRush,代码行数:44,代码来源:RobotMap.java


示例3: init

import edu.wpi.first.wpilibj.PIDSource.PIDSourceParameter; //导入依赖的package包/类
public static void init()
{
	// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
       driveTrainLeftFront = new Talon(0);
       LiveWindow.addActuator("DriveTrain", "Left Front", (Talon) driveTrainLeftFront);
       
       driveTrainLeftRear = new Talon(1);
       LiveWindow.addActuator("DriveTrain", "Left Rear", (Talon) driveTrainLeftRear);
       
       driveTrainRightFront = new Talon(2);
       LiveWindow.addActuator("DriveTrain", "Right Front", (Talon) driveTrainRightFront);
       
       driveTrainRightRear = new Talon(3);
       LiveWindow.addActuator("DriveTrain", "Right Rear", (Talon) driveTrainRightRear);
       
       driveTrainHolonomicDrive = new RobotDrive(driveTrainLeftFront, driveTrainLeftRear,
             driveTrainRightFront, driveTrainRightRear);
       
       driveTrainHolonomicDrive.setSafetyEnabled(false);
       driveTrainHolonomicDrive.setExpiration(0.1);
       driveTrainHolonomicDrive.setSensitivity(0.5);
       driveTrainHolonomicDrive.setMaxOutput(1.0);

       driveTrainHolonomicDrive.setInvertedMotor(RobotDrive.MotorType.kFrontRight, true);
       driveTrainHolonomicDrive.setInvertedMotor(RobotDrive.MotorType.kRearRight, true);
       forkliftMotor = new Talon(4);
       LiveWindow.addActuator("Forklift", "Motor", (Talon) forkliftMotor);
       
       forkliftEncoder = new Encoder(0, 1, false, EncodingType.k4X);
       LiveWindow.addSensor("Forklift", "Encoder", forkliftEncoder);
       forkliftEncoder.setDistancePerPulse(0.012);
       forkliftEncoder.setPIDSourceParameter(PIDSourceParameter.kDistance);
       rollerMotor = new Talon(5);
       LiveWindow.addActuator("Roller", "Motor", (Talon) rollerMotor);
       
       stabilizerBackLeft = new Servo(6);
       LiveWindow.addActuator("Stabilizer", "Back Left", stabilizerBackLeft);
       
       stabilizerBackRight = new Servo(8);
       LiveWindow.addActuator("Stabilizer", "Back Right", stabilizerBackRight);
       
       stabilizerFrontLeft = new Servo(7);
       LiveWindow.addActuator("Stabilizer", "Front Left", stabilizerFrontLeft);
       
       stabilizerFrontRight = new Servo(9);
       LiveWindow.addActuator("Stabilizer", "Front Right", stabilizerFrontRight);
       

   // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS

       driveTrainGyro = new HVAGyro(0);
       LiveWindow.addSensor("DriveTrain", "Gyro", driveTrainGyro);
       driveTrainGyro.setSensitivity(0.007);
  
	powerDistributionPanel = new PowerDistributionPanel();
}
 
开发者ID:HVA-FRC-3824,项目名称:HolonomicDrive,代码行数:57,代码来源:RobotMap.java


示例4: init

import edu.wpi.first.wpilibj.PIDSource.PIDSourceParameter; //导入依赖的package包/类
public static void init() {
    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    driveSubsystemFrontLeftJaguar = new Jaguar(1, 1);
    LiveWindow.addActuator("Drive Subsystem", "Front Left Jaguar", (Jaguar) driveSubsystemFrontLeftJaguar);

    driveSubsystemFrontRightJaguar = new Jaguar(1, 2);
    LiveWindow.addActuator("Drive Subsystem", "Front Right Jaguar", (Jaguar) driveSubsystemFrontRightJaguar);

    driveSubsystemRearLeftJaguar = new Jaguar(1, 3);
    LiveWindow.addActuator("Drive Subsystem", "Rear Left Jaguar", (Jaguar) driveSubsystemRearLeftJaguar);

    driveSubsystemRearRightJaguar = new Jaguar(1, 4);
    LiveWindow.addActuator("Drive Subsystem", "Rear Right Jaguar", (Jaguar) driveSubsystemRearRightJaguar);

    driveSubsystemRearRightEncoder = new Encoder(1, 2, 1, 3, false, EncodingType.k2X);
    LiveWindow.addSensor("Drive Subsystem", "Rear Right Encoder", driveSubsystemRearRightEncoder);
    driveSubsystemRearRightEncoder.setDistancePerPulse(0.002908882);
    driveSubsystemRearRightEncoder.setPIDSourceParameter(PIDSourceParameter.kDistance);
    driveSubsystemRearRightEncoder.start();
    compressorSubsystemCompressor = new Compressor(1, 1, 1, 1);

    sweeperSubsystemSolenoid = new Solenoid(1, 2);
    LiveWindow.addActuator("Sweeper Subsystem", "Solenoid", sweeperSubsystemSolenoid);

    sweeperSubsystemJaguar = new Jaguar(1, 5);
    LiveWindow.addActuator("Sweeper Subsystem", "Jaguar", (Jaguar) sweeperSubsystemJaguar);

    catcherSubsytemSolenoid = new Solenoid(1, 1);
    LiveWindow.addActuator("Catcher Subsytem", "Solenoid", catcherSubsytemSolenoid);

    ledSubsystemPin0 = new DigitalOutput(1, 4);

    ledSubsystemPin1 = new DigitalOutput(1, 5);

    ledSubsystemPin2 = new DigitalOutput(1, 6);

    ledSubsystemPin3 = new DigitalOutput(1, 7);

    ledSubsystemPin4 = new DigitalOutput(1, 8);

    ledSubsystemPin5 = new DigitalOutput(1, 9);

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    driveSubsystemSteeringGyro = new BetterGyro(1, 1);
    driveSubsystemSteeringGyroTemp = new TempSensor(2);
    driveSubsystemAccelerometer = new ADXL345_I2C(1, ADXL345_I2C.DataFormat_Range.k4G);
}
 
开发者ID:RobotsByTheC,项目名称:CMonster2014,代码行数:48,代码来源:RobotMap.java



注:本文中的edu.wpi.first.wpilibj.PIDSource.PIDSourceParameter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HashMap类代码示例发布时间:2022-05-22
下一篇:
Java UClass类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap