/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { chooser = new SendableChooser<Command>(); chassis = new Chassis(); intake = new Intake(); winch = new Winch(); // shooter = new Shooter(); oi = new OI(); imu = new ADIS16448_IMU(ADIS16448_IMU.Axis.kX); pdp = new PowerDistributionPanel(); chooser.addDefault("Drive Straight", new DriveStraight(73, 0.5)); //chooser.addObject("Left Gear Curve", new LeftGearCurve()); chooser.addObject("Left Gear Turn", new LeftGearTurn()); //chooser.addObject("Right Gear Curve", new RightGearCurve()); chooser.addObject("Right Gear Turn", new RightGearTurn()); chooser.addObject("Middle Gear", new StraightGear()); chooser.addObject("Turn in place", new TurnDegrees(60, .2)); SmartDashboard.putData("Autonomous Chooser", chooser); }
public static void init() { driveTrainCIMRearLeft = new CANTalon(2); // rear left motor driveTrainCIMFrontLeft = new CANTalon(12); // driveTrainCIMRearRight = new CANTalon(1); driveTrainCIMFrontRight = new CANTalon(11); driveTrainRobotDrive41 = new RobotDrive(driveTrainCIMRearLeft, driveTrainCIMFrontLeft, driveTrainCIMRearRight, driveTrainCIMFrontRight); climberClimber = new CANTalon(3); c1 = new Talon(5); pDPPowerDistributionPanel1 = new PowerDistributionPanel(0); gyro = new ADXRS450_Gyro(Port.kOnboardCS0); c2 = new Talon(6); ultra = new AnalogInput(0); LiveWindow.addSensor("PDP", "PowerDistributionPanel 1", pDPPowerDistributionPanel1); LiveWindow.addSensor("Ultra", "Ultra", ultra); // LiveWindow.addActuator("Intake", "Intake", intakeIntake); LiveWindow.addActuator("Climber", "Climber", climberClimber); LiveWindow.addActuator("RearLeft (2)", "Drivetrain", driveTrainCIMRearLeft); LiveWindow.addActuator("FrontLeft (12)", "Drivetrain", driveTrainCIMFrontLeft); LiveWindow.addActuator("RearRight (1)", "Drivetrain", driveTrainCIMRearRight); LiveWindow.addActuator("FrontRight (11)", "Drivetrain", driveTrainCIMFrontRight); LiveWindow.addActuator("Drive Train", "Gyro", gyro); // LiveWindow.addActuator("Shooter", "Shooter", shooter1); }
private HardwareAdaptor(){ pdp = new PowerDistributionPanel(); comp = new Compressor(); shifter = new DoubleSolenoid(SolenoidMap.SHIFTER_FORWARD, SolenoidMap.SHIFTER_REVERSE); navx = new AHRS(CoprocessorMap.NAVX_PORT); dtLeftEncoder = new Encoder(EncoderMap.DT_LEFT_A, EncoderMap.DT_LEFT_B, EncoderMap.DT_LEFT_INVERTED); S_DTLeft.linkEncoder(dtLeftEncoder); dtRightEncoder = new Encoder(EncoderMap.DT_RIGHT_A, EncoderMap.DT_RIGHT_B, EncoderMap.DT_RIGHT_INVERTED); S_DTRight.linkEncoder(dtRightEncoder); dtLeft = S_DTLeft.getInstance(); dtRight = S_DTRight.getInstance(); S_DTWhole.linkDTSides(dtLeft, dtRight); dtWhole = S_DTWhole.getInstance(); arduino = S_Arduino.getInstance(); }
@Override public void robotInit() { driveSys = new DriveSubsystem(); driveSys.initDefaultCommand(); climberSys = new ClimberSubsystem(); climberSys.registerButtons(); cameras = new Cameras(); cameras.start(); piSys = new PISubsystem(); piSys.initDefaultCommand(); pdp = new PowerDistributionPanel(); autoChooser = new AutoChooser(); SmartDashboard.putData("Auto Choices", autoChooser); SmartDashboard.putData("Reclibrate RPi", new RPiCalibration()); SmartDashboard.putNumber("RPi Target Duty Cycle", VisionRotate.TARGET_DUTY_CYCLE); }
/** * Runs the motors with arcade steering. */ @Override public void operatorControl() { PowerDistributionPanel panel = new PowerDistributionPanel(); while (isOperatorControl() && isEnabled()) { talon1.set(-j.getAxis(AxisType.kZ)); talon2.set(j.getAxis(AxisType.kZ)); SmartDashboard.putNumber("JoystickValue", j.getAxis(AxisType.kZ)); SmartDashboard.putNumber("Talon1", talon1.getOutputCurrent()); SmartDashboard.putNumber("Talon2", talon2.getOutputCurrent()); SmartDashboard.putNumber("Talon1 PDP", panel.getCurrent(11)); SmartDashboard.putNumber("Talon2 PDP", panel.getCurrent(4)); agitator.set(j1.getAxis(AxisType.kZ)); SmartDashboard.putNumber("Joystick2Value", j1.getAxis(AxisType.kZ)); } }
public Robot() { // initialize variables in constructor stick = new Joystick(RobotMap.JOYSTICK_PORT); // set the stick to refer to joystick #0 button = new JoystickButton(stick, RobotMap.BTN_TRIGGER); myRobot = new RobotDrive(RobotMap.FRONT_LEFT_MOTOR, RobotMap.REAR_LEFT_MOTOR, RobotMap.FRONT_RIGHT_MOTOR, RobotMap.REAR_RIGHT_MOTOR); myRobot.setExpiration(RobotDrive.kDefaultExpirationTime); // set expiration time for motor movement if error occurs pdp = new PowerDistributionPanel(); // instantiate class to get PDP values compressor = new Compressor(); // Compressor is controlled automatically by PCM solenoid = new DoubleSolenoid(RobotMap.SOLENOID_PCM_PORT1, RobotMap.SOLENOID_PCM_PORT2); // solenoid on PCM port #0 & #1 /*camera = CameraServer.getInstance(); camera.setQuality(50); camera.setSize(200);*/ frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0); // create the image frame for cam session = NIVision.IMAQdxOpenCamera("cam0", NIVision.IMAQdxCameraControlMode.CameraControlModeController); // get reference to camera NIVision.IMAQdxConfigureGrab(session); // grab current streaming session }
/** * Instantiates the Sensor Input module to read all sensors connected to the roboRIO. */ private SensorInput() { limit_left = new DigitalInput(ChiliConstants.left_limit); limit_right = new DigitalInput(ChiliConstants.right_limit); accel = new BuiltInAccelerometer(Accelerometer.Range.k2G); gyro = new Gyro(ChiliConstants.gyro_channel); pdp = new PowerDistributionPanel(); left_encoder = new Encoder(ChiliConstants.left_encoder_channelA, ChiliConstants.left_encoder_channelB, false); right_encoder = new Encoder(ChiliConstants.right_encoder_channelA, ChiliConstants.right_encoder_channelB, true); gyro_i2c = new GyroITG3200(I2C.Port.kOnboard); gyro_i2c.initialize(); gyro_i2c.reset(); gyro.initGyro(); left_encoder.setDistancePerPulse(ChiliConstants.kDistancePerPulse); right_encoder.setDistancePerPulse(ChiliConstants.kDistancePerPulse); }
/** * Creates Power Distribution Board Object * * @param newPdp * the CAN Power Distribution Board associated with this object * @param newCanId * the ID of the CAN object */ public CANObject (final PowerDistributionPanel newPdp, int newCanId) { pdp = newPdp; canId = newCanId; typeId = 4; // if(useDebug == true) // { // System.out.println("The pdp is " + talon); // System.out.println("The canId of the CANJaguar is " + canId); // System.out.println("The type Id of the CANJaguar is " + typeId); // } }
/** * // * Checks if the CAN Device is the Power Distribution Panel * // * * * @return Returns Power Distribution Panel if the type ID is 3, if not returns * null */ public PowerDistributionPanel getPDP () { if (typeId == 4) { return pdp; } return null; }
/** * Initializes the wrapper for a PDP at the given module. * @param module the module */ public PDP(int module){ super("PDP"+module, FlashboardSendableType.PDP); pdp = new PowerDistributionPanel(module); voltage = pdp.getVoltage(); }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { // PWM's mTestMotor1 = new Talon(0); mTestMotor2 = new Jaguar(1); mServo = new Servo(2); // Digital IO mDigitalOutput = new DigitalOutput(0); mRightEncoder = new Encoder(4, 5); mLeftEncoder = new Encoder(1, 2); mUltrasonic = new Ultrasonic(7, 6); // Analog IO mAnalogGryo = new AnalogGyro(0); mPotentiometer = new AnalogPotentiometer(1); // Solenoid mSolenoid = new Solenoid(0); // Relay mRelay = new Relay(0); // Joysticks mJoystick1 = new Joystick(0); mJoystick2 = new XboxController(1); // SPI mSpiGryo = new ADXRS450_Gyro(); // Utilities mTimer = new Timer(); mPDP = new PowerDistributionPanel(); Preferences.getInstance().putDouble("Motor One Speed", .5); }
public HarvesterRollers() { shooterWheelA = new CANTalon(RobotMap.HARVESTER_SHOOTER_WHEEL_A);//Construct shooter A as CANTalon, this should have encoder into it shooterWheelB = new CANTalon(RobotMap.HARVESTER_SHOOTER_WHEEL_B);//Construct shooter B as CANTalon // shooterWheelB.changeControlMode(CANTalon.TalonControlMode.Follower);//turn shooter motor B to a slave // shooterWheelB.set(shooterWheelA.get());//slave shooter motor B to shooter motor A harvesterBallControl = new CANTalon(RobotMap.HARVESTER_BALL_CONTROL); ballSensorLeft = new DigitalInput(RobotMap.BALL_SENSOR_LEFT); ballSensorRight = new DigitalInput(RobotMap.BALL_SENSOR_RIGHT); pdp = new PowerDistributionPanel(); }
public VoltageCompensatedShooter(CANTalon shooter, double voltageLevelToMaintain) { m_shooter = shooter; m_panel = new PowerDistributionPanel(); m_voltageLevelToMaintain = voltageLevelToMaintain; turnOff(); }
/** * Get the current on any channel on the Power Distribution Panel. * @param channel - the channel number on the Power Distribution Panel. * @return double - the current on the channel or 0 if the channel number is invalid. */ public double getCurrent(int channel) { if (channel >= 0 && channel < PowerDistributionPanel.kPDPChannels) { return powerDistributionPanel.getCurrent(channel); } System.out.println("Invalid channel number (" + channel + ") requested for PowerSubsystem.getCurrent()"); return 0; }
private void setupSensors() { navX = new TurtleNavX(I2C.Port.kOnboard); try { lidar = new LIDARLite(I2C.Port.kMXP); // new LIDARSerial(SerialPort.Port.kUSB1); } catch (Exception e) { e.printStackTrace(); lidar = new TurtleFakeDistanceEncoder(); } pdp = new PowerDistributionPanel(); }
public PDP() { try { powerDistributionPanel = new PowerDistributionPanel(); } catch (Exception e) { powerDistributionPanel = null; } }
public PDP(int module) { try { powerDistributionPanel = new PowerDistributionPanel(module); } catch (Exception e) { powerDistributionPanel = null; } }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { // initialize all subsystems and important classes oi = new OI(); //autoSys = new AutonomousSys(); driveSys = new DrivingSys(); // instantiate the command used for the autonomous period //autonomousCommand = new AutonomousCmd(); // instantiate cmd used for teleop period arcadeDriveCmd = new ArcadeDriveJoystick(); // Show what cmd the susbsystem is running on SmartDashboard SmartDashboard.putData(driveSys); // Initialize Power Distribution Panel pdp = new PowerDistributionPanel(); // Compressor is controlled automatically by PCM compressor = new Compressor(); solenoid = new DoubleSolenoid(0, 1); solenoid.set(DoubleSolenoid.Value.kReverse); /*camera = CameraServer.getInstance(); camera.setQuality(50); camera.startAutomaticCapture("cam0");*/ }
/** * Called when the robot is first started up and should be used for any * initialization code. */ @Override public void robotInit() { // Initialize the robot map RobotMap.init(); // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS driveSubsystem = new DriveSubsystem(); toteLifterSubsystem = new ToteLifterSubsystem(); containerHookSubsystem = new ContainerHookSubsystem(); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS oi = new OI(); pdp = new PowerDistributionPanel(); // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS // Start sending data to SmartDashboard loggingCommand = new LoggingCommand(); loggingCommand.start(); // Add autonomous modes to the chooser autonomousChooser.addDefault("Grab RC and drive to auto zone", new ContainerAutoZoneAutonomousCommand()); autonomousChooser.addObject("Grab RC and drive to left feeder", new ContainerFeederStationAutonomousCommand(true)); autonomousChooser.addObject("Grab RC and drive to right feeder", new ContainerFeederStationAutonomousCommand(false)); autonomousChooser.addObject("Grab RC", new ContainerAutonomousCommand()); autonomousChooser.addObject("Do nothing", null); SmartDashboard.putData("Autonomous Mode", autonomousChooser); }
@Override public void robotInit() { chooser = new SendableChooser<Integer>(); chooser.addDefault("center red", 1); chooser.addObject("center blue", 2); chooser.addObject("boiler red", 3); chooser.addObject("boiler blue", 4); chooser.addObject("ret red", 5); chooser.addObject("ret blue", 6); chooser.addObject("current test", 7); SmartDashboard.putData("Auto choices", chooser); //NETWORK TABLE VARIABLES table = NetworkTable.getTable("dataTable"); //POWER DIST PANEL pdp = new PowerDistributionPanel(); //NAVX navx = new AHRS(SPI.Port.kMXP); // CONTROLLER jsLeft = new Joystick(0); jsRight = new Joystick(1); xbox = new XboxController(5); // MOTORS leftFront = new Talon(pwm5); leftMid = new Talon(pwm3); leftBack = new Talon(pwm1); rightFront = new Talon(pwm4); rightMid = new Talon(pwm2); rightBack = new Talon(pwm0); // ENCODERS encLeftDrive = new Encoder(0,1); encRightDrive = new Encoder(2,3); // COMPRESSOR compressor = new Compressor(); compressor.start(); //SOLENOIDs driveChain = new DoubleSolenoid(0,1); driveChain.set(Value.kReverse); presser = new DoubleSolenoid(2,3); presser.set(Value.kReverse); gearpiston = new DoubleSolenoid(4,5); gearpiston.set(Value.kReverse); //CANTALONS climber = new CANTalon(2); shooter = new CANTalon(4); intake = new CANTalon(9); feeder = new CANTalon(13); // CAMERA //DON'T DELETE THE COMMENTED THREAD-IT IS USED FOR CALIBRATION /* UsbCamera usbCam = new UsbCamera("mscam", 0); usbCam.setVideoMode(VideoMode.PixelFormat.kMJPEG, 160, 120, 20); MjpegServer server1 = new MjpegServer("cam1", 1181); server1.setSource(usbCam); */ UsbCamera camera = CameraServer.getInstance().startAutomaticCapture(); camera.setVideoMode(VideoMode.PixelFormat.kMJPEG, 160, 120, 20); //SMARTDASBOARD driveSetting = "LOW START"; gearSetting = "GEAR CLOSE START"; }
/** * Creates the PdpSubsystem. */ public PdpSubsystem() { if (Robot.deviceFinder.isPdpAvailable()) { pdp = new PowerDistributionPanel(); } }
public static void init() { // DRIVETRAIN MOTORS \\ drivetrainCIMRearLeft = new CANTalon(2); drivetrainCIMFrontLeft = new CANTalon(12); drivetrainCIMRearRight = new CANTalon(1); drivetrainCIMFrontRight = new CANTalon(11); LiveWindow.addActuator("Drivetrain", "RearLeft(2)", drivetrainCIMRearLeft); LiveWindow.addActuator("Drivetrain", "FrontLeft(12)", drivetrainCIMFrontLeft); LiveWindow.addActuator("Drivetrain", "RearRight(1)", drivetrainCIMRearRight); LiveWindow.addActuator("Drivetrain", "FrontRight(11)", drivetrainCIMFrontRight); // DRIVE \\ drivetrainRobotDrive41 = new RobotDrive(drivetrainCIMRearLeft, drivetrainCIMFrontLeft, drivetrainCIMRearRight, drivetrainCIMFrontRight); // DRIVE SENSORS \\ gyro = new ADXRS450_Gyro(Port.kOnboardCS0); // accel = new BuiltInAccelerometer(); enc = new Encoder(9, 8); LiveWindow.addSensor("Drive Sensors", "Gyro", gyro); // LiveWindow.addSensor("Drive Sensors", "Accelerometer", accel); LiveWindow.addSensor("Drive Sensors", "Encoder", enc); // CLIMB \\ climber = new Talon(5); climber2 = new Talon(6); LiveWindow.addActuator("Climber", "Climber", climber); LiveWindow.addActuator("Climber", "Climber2", climber2); // GEAR \\ claw = new CANTalon(3); LiveWindow.addActuator("Gear", "Claw", claw); // FUEL \\ // shooter = new Talon(6); // LiveWindow.addActuator("Fuel", "Shooter", shooter); // DIAGNOSTIC \\ pdp = new PowerDistributionPanel(0); LiveWindow.addSensor("PDP", "Power Distribution Panel", pdp); }
public static void init() { // DRIVETRAIN MOTORS \\ drivetrainCIMRearLeft = new CANTalon(2); drivetrainCIMFrontLeft = new CANTalon(12); drivetrainCIMRearRight = new CANTalon(1); drivetrainCIMFrontRight = new CANTalon(11); LiveWindow.addActuator("Drivetrain", "RearLeft(2)", drivetrainCIMRearLeft); LiveWindow.addActuator("Drivetrain", "FrontLeft(12)", drivetrainCIMFrontLeft); LiveWindow.addActuator("Drivetrain", "RearRight(1)", drivetrainCIMRearRight); LiveWindow.addActuator("Drivetrain", "FrontRight(11)", drivetrainCIMFrontRight); // DRIVE \\ drivetrainRobotDrive41 = new RobotDrive(drivetrainCIMRearLeft, drivetrainCIMFrontLeft, drivetrainCIMRearRight, drivetrainCIMFrontRight); // DRIVE SENSORS \\ gyro = new ADXRS450_Gyro(Port.kOnboardCS0); // accel = new BuiltInAccelerometer(); enc = new Encoder(0, 1); LiveWindow.addSensor("Drive Sensors", "Gyro", gyro); // LiveWindow.addSensor("Drive Sensors", "Accelerometer", accel); LiveWindow.addSensor("Drive Sensors", "Encoder", enc); // CLIMB \\ climber = new Talon(5); climber2 = new Talon(6); LiveWindow.addActuator("Climber", "Climber", climber); LiveWindow.addActuator("Climber", "Climber2", climber2); // GEAR \\ claw = new CANTalon(3); LiveWindow.addActuator("Gear", "Claw", claw); // FUEL \\ shooter = new Talon(6); LiveWindow.addActuator("Fuel", "Shooter", shooter); // DIAGNOSTIC \\ pdp = new PowerDistributionPanel(0); LiveWindow.addSensor("PDP", "Power Distribution Panel", pdp); }
public static void init() { // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS motorsVictor0 = new VictorSP(0); LiveWindow.addActuator("Motors", "Victor0", (VictorSP) motorsVictor0); motorsVictor1 = new VictorSP(1); LiveWindow.addActuator("Motors", "Victor1", (VictorSP) motorsVictor1); LiveWindow.addActuator("Motors", "TalonSRX", (CANTalon) motorsCANTalon); electricalPowerDistributionPanel1 = new PowerDistributionPanel(0); LiveWindow.addSensor("Electrical", "PowerDistributionPanel 1", electricalPowerDistributionPanel1); sensorsAnalogGyro1 = new AnalogGyro(0); LiveWindow.addSensor("Sensors", "AnalogGyro 1", sensorsAnalogGyro1); sensorsAnalogGyro1.setSensitivity(0.007); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ @Override public void robotInit() { // Instantiate subsystems and add to subsystem list (e.g., for logging to dashboard) pdp = new PowerDistributionPanel(); compressor = new Compressor(); subsystemsList.add(compressor); driveTrain = new DriveTrain(); subsystemsList.add(driveTrain); //visionTest = null; visionTest = new VisionTest(); subsystemsList.add(visionTest); gate = new Gate(); subsystemsList.add(gate); flapper = new Flapper(); subsystemsList.add(flapper); ballShifter = new BallShifter(); subsystemsList.add(ballShifter); ballShooter = new BallShooter(); subsystemsList.add(ballShooter); intake = new Intake(); subsystemsList.add(intake); climber = new Climber(); subsystemsList.add(climber); ultrasonics = new DoubleUltrasonic(); subsystemsList.add(ultrasonics); navx = new NavX(); subsystemsList.add(navx); // Autonomous chooser.addObject("AutoDriveToPeg", new AutoDriveToPeg(108)); chooser.addObject("Auto Place Gear Turn Right", new AutoPlaceGear(108, 60)); chooser.addObject("Auto Place Gear Straight", new AutoPlaceGear(108, 0)); chooser.addObject("Auto Place Gear Turn Left", new AutoPlaceGear(108, -60)); chooser.addObject("Auto Turn using Vision", new AutoTurnByVision(0)); chooser.addObject("Auto Turn To Peg", new AutoTurnToPeg()); chooser.addObject("Auto Drive Distance", new AutoDriveDistance(108, 10000)); chooser.addDefault("None", new AutoNone()); SmartDashboard.putData("Auto Mode", chooser); // Preferences Preferences prefs = Preferences.getInstance(); boolean driveMode = prefs.getBoolean("Drive Mode", RobotPreferences.DRIVE_MODE_DEFAULT); SmartDashboard.putBoolean("Prefs: Drive Mode", driveMode); SmartDashboard.putNumber("Prefs: Drive Kp", prefs.getDouble("Drive Kp", RobotPreferences.DRIVE_KP_DEFAULT)); SmartDashboard.putNumber("Prefs: Drive Ki", prefs.getDouble("Drive Ki", RobotPreferences.DRIVE_KI_DEFAULT)); SmartDashboard.putNumber("Prefs: Drive Kd", prefs.getDouble("Drive Kd", RobotPreferences.DRIVE_KD_DEFAULT)); SmartDashboard.putNumber("Prefs: Vision Kp", prefs.getDouble("Vision Kp", RobotPreferences.VISION_KP_DEFAULT)); SmartDashboard.putNumber("Prefs: Vision Ki", prefs.getDouble("Vision Ki", RobotPreferences.VISION_KI_DEFAULT)); SmartDashboard.putNumber("Prefs: Vision Kd", prefs.getDouble("Vision Kd", RobotPreferences.VISION_KD_DEFAULT)); SmartDashboard.putNumber("Prefs: Vision Update Delay", prefs.getLong("Vision Update Delay", RobotPreferences.VISION_UPDATE_DELAY_DEFAULT)); SmartDashboard.putNumber("Prefs: Turn To Peg Angle", prefs.getDouble("Turn To Peg Angle", RobotPreferences.TURN_TO_PEG_ANGLE_DEFAULT)); SmartDashboard.putNumber("Prefs: Vision Time Limit", prefs.getDouble("Auto Vision Time Limit", RobotPreferences.VISION_TIME_DEFAULT)); //Instantiate after all subsystems and preferences - or the world will die //We don't want that, do we? oi = new OI(driveMode); //TODO uncomment to see subsystems on dashboard //addSubsystemsToDashboard(subsystemsList); ArrayList<LoggableSubsystem> tempList = new ArrayList<LoggableSubsystem>(); tempList.add(driveTrain); addSubsystemsToDashboard(tempList); }
/** * Constructor: Creates an instance of the object. * * @param module specifies the CAN ID of the PDP. */ public FrcRobotBattery(int module) { super(); pdp = new PowerDistributionPanel(module); }
public TalonSRX246(final int channel, int pdpPort, PowerDistributionPanel pdp) { super(channel); this.pdpPort = pdpPort; this.pdp = pdp; }
public Talon246(final int channel, int pdpPort, PowerDistributionPanel pdp) { super(channel); this.pdpPort = pdpPort; this.pdp = pdp; }
public Victor246(final int channel, int pdpPort, PowerDistributionPanel pdp) { super(channel); this.pdpPort = pdpPort; this.pdp = pdp; }
public ArmMotor(int channel, int pdpPort, PowerDistributionPanel pdp, ArmJoint joint) { super(channel, pdpPort, pdp); this.joint = joint; }
public Jaguar246(final int channel, int pdpPort, PowerDistributionPanel pdp) { super(channel); this.pdpPort = pdpPort; this.pdp = pdp; }
public VictorSP246(final int channel, int pdpPort, PowerDistributionPanel pdp) { super(channel); this.pdpPort = pdpPort; this.pdp = pdp; }
public Robot() { motorLeft = new Talon(1); motorRight = new Talon(2); motorCenter = new Talon(0); motorLift = new Talon(4); motorArm = new Talon(3); pistonArmTilt1 = new DoubleSolenoid(1, 0); pistonArmTilt2 = new DoubleSolenoid(2, 3); pistonLiftWidth = new DoubleSolenoid(4, 5); pistonCenterSuspension = new Solenoid(6); analogLift = new AnalogInput(0); digitalInLiftTop = new DigitalInput(0); digitalInLiftBottom = new DigitalInput(1); digitalInArmUp = new DigitalInput(3); digitalInArmDown = new DigitalInput(2); //schuyler 480 526 1606 pdp = new PowerDistributionPanel(); frontDistanceSensor = new AnalogInput(1); //sonicVex = new Ultrasonic(5, 6); //sonicVex.setAutomaticMode(true); /* * PIDControllerLift = new PIDController(0, 0, 0, analogLift, * motorLift); PIDControllerLift.setInputRange(0, 1); * PIDControllerLift.setOutputRange(0, .5); PIDControllerLift.disable(); */ stickLeft = new Joystick(0); stickRight = new Joystick(1); stickAux = new Joystick(2); stickAuxLastButton = new boolean[stickAux.getButtonCount()]; autoModes.put(autoModeNone, "None"); autoModes.put(autoModeToZone, "Move to Zone"); autoModes.put(autoModeToZoneOver, "Move over platform to Zone"); autoModes.put(autoModeGrabToZone, "Grab and move to zone"); autoModes.put(autoModeGrabToZoneOver, "Grab and move over platform to zone"); /*autoModes.put(autoModeDriveToAutoZone, "(Tested) Drive to Auto Zone"); autoModes.put(autoModeDriveToAutoZoneOverPlatform, "(Untested) Drive to Auto Zone Over Platform"); autoModes.put(autoModeGrabCanAndDriveToAutoZone, "(Tested) Grab Can and drive to Auto Zone"); autoModes.put(autoModeGrabCanAndDriveToAutoZoneOverScoringPlatform, "(Untested) Grab Can to and drive Auto Zone over Scoring Platform"); autoModes.put(autoModeDriveIntoAutoZoneFromLandfill, "(Untested) Drive into Auto Zone from Landfill"); autoModes.put(autoModeGrabCanOffStep, "(Untested) Grab Can off step"); autoModes.put(autoModeGrabToteOrCanMoveBack, "(Untested) Grab Tote or can and move to auto zone"); autoModes.put(autoModeGrabToteOrCanMoveBackOverScoringPlatform, "(Untested) Grab Tote or can and move to auto zone (driving over scoring platform)"); */ autoChooser = new SendableChooser(); autoChooser.addDefault("No Auto", 0); int i = 0; int counter = 0; while(counter < autoModes.size()){ if(autoModes.containsKey(i)){ autoChooser.addObject(autoModes.get(i), i); counter++; } i++; } SmartDashboard.putData("Auto Mode", autoChooser); }
/** * Sets the object to a Power Distribution Panel * * @param pdp * power distribution panel object to change to */ public void setCAN (final PowerDistributionPanel pdp) { CANObject.pdp = pdp; typeId = 4; }
/** * * @param pdp * The power distribution panel in the network. */ public CANNetwork (PowerDistributionPanel pdp) { this.pdp = pdp; }
/** * Gets the wrapped {@link PowerDistributionPanel} object. * @return the wrapped object */ public PowerDistributionPanel getPanel(){ return pdp; }
/** * Sets up the current estimator with the system parameters. * * @param numMotors Integer number of motors in the gearbox system. Usually 2 or 3 for a side of * a drivetrain, or 1 for a single motor. * @param controllerVDrop_V voltage drop induced by the motor controller, in V. * @param pdp Instance of the PDP class from the top level (needed for voltage measurements) */ public CIMCurrentEstimator(int numMotors, double controllerVDrop_V, PowerDistributionPanel pdp) { this.numMotorsInSystem = numMotors; this.contVDrop = controllerVDrop_V; this.pdp = pdp; }
/** * Gets the {@link PowerPanel} of the robot. * * @return the {@link PowerPanel} of the robot */ public static PowerPanel powerPanel() { PowerDistributionPanel pdp = new PowerDistributionPanel(); return PowerPanel.create(pdp::getCurrent, pdp::getTotalCurrent, pdp::getVoltage, pdp::getTemperature); }