/** * 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); }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { RobotMap.init(); // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS driveBase = new DriveBase(); arm = new Arm(); winch = new Winch(); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS // OI must be constructed after subsystems. If the OI creates Commands //(which it very likely will), subsystems are not guaranteed to be // constructed yet. Thus, their requires() statements may grab null // pointers. Bad news. Don't move it. oi = new OI(); autonomousChooser = new SendableChooser(); autonomousChooser.addDefault("Drive Forward", new AutonomousCommand()); autonomousChooser.addObject("Center Peg", new CenterPeg()); SmartDashboard.putData("Autonomous Mode", autonomousChooser); }
public AutonomousFactory(Snobot2017 aSnobot, IDriverJoystick aDriverJoystick) { mPositionChooser = new SendableChooser<StartingPositions>(); mCommandParser = new CommandParser(aSnobot, mPositionChooser); mAutoModeTable = NetworkTable.getTable(SmartDashBoardNames.sAUTON_TABLE_NAME); mPositioner = aSnobot.getPositioner(); mAutonModeChooser = new SnobotAutonCrawler(Properties2017.sAUTON_FILE_FILTER.getValue()) .loadAutonFiles(Properties2017.sAUTON_DIRECTORY.getValue() + "/", Properties2017.sAUTON_DEFAULT_FILE.getValue()); SmartDashboard.putData(SmartDashBoardNames.sAUTON_CHOOSER, mAutonModeChooser); for (StartingPositions pos : StartingPositions.values()) { mPositionChooser.addObject(pos.toString(), pos); } SmartDashboard.putData(SmartDashBoardNames.sPOSITION_CHOOSER, mPositionChooser); addListeners(); }
/** * * @param aXboxJoystick * Xbax Joystick * @param aFlightstickJoytick * FlightStick Joystick * @param aHaloJoystick * Halo Joystick * @param aLogger * Logger for the Factory */ public SnobotDriveJoystickFactory(IDriverJoystick aXboxJoystick,IDriverJoystick aFlightstickJoytick, IDriverJoystick aHaloJoystick, Logger aLogger) { mXboxJoystick = aXboxJoystick; mFlightstickJoytick = aFlightstickJoytick; mHaloJoytick = aHaloJoystick; mLogger = aLogger; mDriveMode = DriveMode.Xbox; mDriveModeSelector = new SendableChooser(); mDriveModeSelector.addDefault("Xbox", DriveMode.Xbox); mDriveModeSelector.addObject("Fligthstick", DriveMode.Flightsticks); mDriveModeSelector.addObject("Arcade", DriveMode.Arcade); SmartDashboard.putData(SmartDashBoardNames.sDRIVER_JOSTICK_MODE, mDriveModeSelector); }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { harvester = new Harvester(); drive = new Drive(); climber = new Climber(); harvesterRollers = new HarvesterRollers(); flashlight = new Flashlight(); SmartDashboard.putData(harvester); SmartDashboard.putData(drive); SmartDashboard.putData(climber); SmartDashboard.putData(harvesterRollers); oi = new OI(); //ppim.pm.ip.mip.mi.p.miipmmip.ip.m.pimmmpim.m.ipm..ipmmpimipmipm.mmipipm.pipmi.pmipmmpimipmpi..lmmmplip.mimp.im..p.ppn.p.pp.p.ppp.p chooser = new SendableChooser(); chooser.addDefault("Do nothing", new AutoDoNothing()); chooser.addObject("Spy Bot", new CG_SpyBot()); chooser.addObject("Spy Bot and Turn", new CG_SpyBotTurn()); chooser.addObject("Drive straight 2.5 seconds", new DriveTime(2.5, 1)); chooser.addObject("Low bar", new CG_LowBarAndShoot()); chooser.addObject("Shoot", new CG_DefenseAndShoot()); // chooser.addObject("Middle to Low Bar", new MyAutoCommand()); SmartDashboard.putData("AutoSelect", chooser); }
public void robotInit() { CMap.initialize(); autoDefenseChooser = new SendableChooser(); autoDefenseChooser.addDefault("Low Bar", "Low Bar"); autoDefenseChooser.addObject("Cheval", "Cheval"); //Only Category B Defense autoDefenseChooser.addObject("Log Roll", "Log Roll"); //Other Category B autoDefenseChooser.addObject("Ramparts", "Ramparts"); //One of Two Category C autoDefenseChooser.addObject("Moat", "Moat"); //One of Two Category C autoDefenseChooser.addObject("Rock Wall", "Rock Wall"); // One of Two Category D autoDefenseChooser.addObject("Rough Terrain", "Rough Terrain"); //One of Two Category D autoDefenseChooser.addObject("Score from Spy Box?", "Spy Box"); SmartDashboard.putData("Which Defense?", autoDefenseChooser); }
public Test(Robot robot) { super(robot); // Call TeleOp constructor. sm = new TrcStateMachine(moduleName); event = new TrcEvent(moduleName); timer = new TrcTimer(moduleName); testChooser = new SendableChooser(); testChooser.addDefault("Sensors test", TestMode.SENSORS_TEST); testChooser.addObject("Drive motors test", TestMode.DRIVEMOTORS_TEST); testChooser.addObject("Drive for 8 sec", TestMode.TIMED_DRIVE); testChooser.addObject("Move X 20 ft", TestMode.X_DRIVE); testChooser.addObject("Move Y 20 ft", TestMode.Y_DRIVE); testChooser.addObject("Turn 360", TestMode.TURN); testChooser.addObject("Sonar drive 7 in", TestMode.SONAR_DRIVE); HalDashboard.putData("Robot tune modes", testChooser); }
public AutoChooser() { chooser = new SendableChooser(); chooser.addDefault("DO_NOTHING", DO_NOTHING); chooser.addObject("DRIVE_FORWARD", DRIVE_FORWARD); chooser.addObject("DEPOSIT_GEAR_LEFT", DEPOSIT_GEAR_LEFT); chooser.addObject("DEPOSIT_GEAR_CENTER", DEPOSIT_GEAR_CENTER); chooser.addObject("DEPOSIT_GEAR_RIGHT", DEPOSIT_GEAR_RIGHT); chooser.addObject("DRIVE_AND_SHOOT_BLUE_LEFT", DRIVE_AND_SHOOT_BLUE_LEFT); chooser.addObject("DRIVE_AND_SHOOT_BLUE_CENTER", DRIVE_AND_SHOOT_BLUE_CENTER); chooser.addObject("DRIVE_AND_SHOOT_BLUE_RIGHT", DRIVE_AND_SHOOT_BLUE_RIGHT); chooser.addObject("DRIVE_AND_SHOOT_RED_LEFT", DRIVE_AND_SHOOT_RED_LEFT); chooser.addObject("DRIVE_AND_SHOOT_RED_CENTER", DRIVE_AND_SHOOT_RED_CENTER); chooser.addObject("DRIVE_AND_SHOOT_RED_RIGHT", DRIVE_AND_SHOOT_RED_RIGHT); SmartDashboard.putData("Auto_Mode_Chooser", chooser); }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { cc = new CameraController(50); dt = Drivetrain.getInstance(); sh = Shooter.getInstance(); tr = Turret.getInstance(); lt = LeftTomahawk.getInstance(); rt = RightTomahawk.getInstance(); pn = Pneumatics.getInstance(); //lt = Lifter.getInstance(); //bb = Beaglebone.getInstance(); //comp = new Compressor(); //comp.start(); //comp.setClosedLoopControl(true); oi = new OI(); mode = SmartDashboard.getBoolean("Two Drivers?", false); chooser = new SendableChooser(); chooser.addDefault("Default Auto", new Drive()); // chooser.addObject("My Auto", new MyAutoCommand()); SmartDashboard.putData("Auto mode", chooser); }
/** * Constructor: Creates an instance of the object. * * @param menuTitle specifies the title of the menu. */ public FrcChoiceMenu(final String menuTitle) { if (debugEnabled) { dbgTrace = new TrcDbgTrace(moduleName + "." + menuTitle, tracingEnabled, traceLevel, msgLevel); } if (menuTitle == null) { throw new NullPointerException("menuTitle cannot be null."); } this.menuTitle = menuTitle; chooser = new SendableChooser<>(); hashMap = new HashMap<>(); }
/** *Contains a variety of debugging functions. *Mostly affects the SmartDashboard. */ public DebugHardware() { motorSelector = new SendableChooser(); motorSelector.addDefault("None", 0); motorSelector.addObject("Left Front", 1); motorSelector.addObject("Right Front", 2); motorSelector.addObject("Right Rear", 3); motorSelector.addObject("Left Rear", 4); motorSelector.addObject("Winch", 5); motorSelector.addObject("Left Roller", 6); motorSelector.addObject("Right Roller", 7); SmartDashboard.putData("Debug Motor", motorSelector); Preferences.getInstance().putDouble("setWinch",RobotMap.forkliftMotor.getPosition()); Preferences.getInstance().putDouble("WheelSpeed", speed); RobotMap.forkliftMotor.enableControl(); }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { RobotMap.init(); autoChooser = new SendableChooser(); autoChooser.addDefault("Simple Autonomous", new SimpleAutonomous()); //autoChooser.addObject("name", ); //autoChooser.addObject("name", ); SmartDashboard.putData("Autonomous Chooser", autoChooser); shooterFan = new ShooterFan(); eightBallGrabber = new EightBallGrabber(); prefs = Preferences.getInstance(); // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS // This MUST be here. If the OI creates Commands (which it very likely // will), constructing it during the construction of CommandBase (from // which commands extend), subsystems are not guaranteed to be // yet. Thus, their requires() statements may grab null pointers. Bad // news. Don't move it. oi = new OI(); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS // Setup compass to stream data }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { System.out.println("Robot Init Started"); // Initialize all subsystems CommandBase.init(); // instantiate the command used for the autonomous period autonomousModeChooser = new SendableChooser(); autonomousModeChooser.addDefault("1 Ball Front Short", new Shoot1BallShortAutonomous()); autonomousModeChooser.addObject("1 Ball Front Short Hot", new Shoot1BallShortAutonomousHot()); autonomousModeChooser.addObject("1 Ball Front Long", new Shoot1BallAutonomous()); autonomousModeChooser.addObject("1 Ball Front Long Hot", new Shoot1BallAutonomousHot()); autonomousModeChooser.addObject("1 Ball Back Long", new Shoot1BallBackAutonomous()); autonomousModeChooser.addObject("1 Ball Back Long Hot", new Shoot1BallBackAutonomousHot()); autonomousModeChooser.addObject("2 Ball Front", new Shoot2BallAutonomous()); autonomousModeChooser.addObject("2 Ball Back", new Shoot2BallBackAutonomous()); autonomousModeChooser.addObject("Move Forward 150", new Shoot0BallAutonomous(0, 150)); SmartDashboard.putData("Autonomous Mode", autonomousModeChooser); updateStatus(); System.out.println("Robot Init Completed"); }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { // instantiate the command used for the autonomous period // autonomousCommand = new DriveSetDistanceCommand(); SmartDashboard.putNumber("waitTime", 1000); // Initialize all subsystems CommandBase.init(); autonomousModeChooser = new SendableChooser(); autonomousModeChooser.addObject("Do Nothing Autonomous", DO_NOTHING_AUTO_NAME); autonomousModeChooser.addObject("Wait and Drive Autonomous", WAIT_AND_DRIVE_AUTO_NAME); autonomousModeChooser.addDefault("One Ball Short Drive Autonomous", ONE_BALL_SHORT_DRIVE_AUTO_NAME); // autonomousModeChooser.addDefault("One Ball Driving Shot Autonomous", ONE_BALL_RUNNING_SHOT_AUTO_NAME); autonomousModeChooser.addDefault("Two Ball Short Drive Autonomous", TWO_BALL_SHORT_DRIVE_AUTO_NAME); // autonomousModeChooser.addObject("Two Ball Running Autonomous", TWO_BALL_RUNNING_SHOT_AUTO_NAME); SmartDashboard.putData("Autonomous", autonomousModeChooser); SmartDashboard.putData(new HotVisionWaitCommand()); }
/** * Creates Autonomous mode chooser. */ private void autoSelectInit() { //NOTE: ONLY ADD AutoCommandGroup objects to this chooser! autoChooser = new SendableChooser(); autoChooser.addDefault(ShootStraight_2Ball_DrvFwd.name, new ShootStraight_2Ball_DrvFwd()); autoChooser.addObject(Center_RotHotGoal_2Ball.name, new Center_RotHotGoal_2Ball()); autoChooser.addObject(Center_RotHotGoal_1Ball.name, new Center_RotHotGoal_1Ball()); autoChooser.addObject(Left_LeftHotGoal_1Ball.name, new Left_LeftHotGoal_1Ball()); autoChooser.addObject(Right_RightHotGoal_1Ball.name, new Right_RightHotGoal_1Ball()); autoChooser.addObject(Left_2ball_left2right.name, new Left_2ball_left2right()); autoChooser.addObject(NoBall_DrvFwd.name, new NoBall_DrvFwd()); autoChooser.addObject(No_Auto.name, new No_Auto()); //autoChooser.addObject("Center_RotDrvFwdHotGoal_1Ball", new Center_RotDrvFwdHotGoal_1Ball(RobotMap.VisionTimeOutSecs.getDouble())); //autoChooser.addObject("ShootStraight_2BallDrvFwd", new ShootStraight_2Ball_DrvFwd()); SmartDashboard.putData("Autonomous Mode Chooser", autoChooser); }
public static void initDashboard() { omniForward = new SendableChooser(); omniForward.addDefault("Omni Forward", new SwitchDriveToOmniForward()); omniForward.addObject("Omni Backward", new SwitchDriveToOmniBackward()); competitionVersion = new SendableChooser(); competitionVersion.addDefault("Competition Version", new SetCompetitionVersion()); competitionVersion.addObject("Normal Version", new SetNormalVersion()); driverDevice = new SendableChooser(); driverDevice.addDefault("Joystics", new SwitchDriveToJoysticks()); driverDevice.addObject("Xbox Controller", new SwitchDriveToXbox()); autoDance = new SendableChooser(); autoDance.addDefault("Disabled", new DisableAutoDance()); autoDance.addObject("Enabled", new EnableAutoDance()); SmartDashboard.putData("Competition/Normal Version", competitionVersion); SmartDashboard.putData("Omni Direction", omniForward); SmartDashboard.putData("Xbox Controller", driverDevice); SmartDashboard.putData("Autonomous Dance", autoDance); }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { BadRobotMap.isPrototype = true; // Initialize all subsystems CommandBase.init(); autoChooser = new SendableChooser(); //autoChooser.addDefault("Drive Forward + Auto Fire", new DriveForwardAutoAimShoot()); autoChooser.addObject("Drive Straight Forward", new DriveStraightForward(5)); autoChooser.addObject("Auto Aim", new AimWithCamera()); autoChooser.addObject("Auto Aim And Shoot", new AutoAimAndShoot()); autoChooser.addDefault("Drive Forward And Shoot (variable time, 3 frisbees)", new DriveForwardAndShoot()); autoChooser.addObject("Shoot three frisbees", new SafeShoot(3)); autoChooser.addObject("Drive Forward to 109 inches, turn and Shoot", new DriveForwardToWallTurnAndShoot()); autoChooser.addObject("Shoot and Drive Backwards", new ShootAndDriveBack()); autoChooser.addObject("Shootanddoalotofotherstuff", new DriveForwardTurnShootDriveBack()); SmartDashboard.putData("Autonomous Mode Chooser", autoChooser); if (CommandBase.lightSystem != null) { new RunLights(ILights.kYellow).start(); } }
@Override public void robotInit() { logger = LoggerFactory.getLogger(Robot.class); logger.info("Initializing Robot"); drivetrain = new DriveTrain(); driveEncoders = new DriveEncoders(RobotMap.leftEncoderA,RobotMap.leftEncoderB,RobotMap.rightEncoderA, RobotMap.rightEncoderB, RobotMap.encoderMaxPeriod, RobotMap.encoderMinRate, RobotMap.encoderDPP,RobotMap.encoderReverseDirection,RobotMap.encoderSamplesToAvg); ultrasonic = new Ultrasonic(RobotMap.valueToInches,RobotMap.ultrasonicPort); gyro = new Gyro(); vision = new Vision(); gds = new GDS(); pickup = new Pickup(); flywheel = new Flywheel(); meter = new Meter(); winch = new Winch(); winchPush = new WinchPush(); fieldTimer = new FieldTimer(); oi = new OI(); chooser = new SendableChooser<>(); endTimer = new StartEndTimer(); stopTimers = new StopEndTimer(); vision.setUpCamera(); SmartDashboard.putData(drivetrain); chooser.addDefault("None", noAuto); chooser.addObject("Forward Drive", forwardAuto); chooser.addObject("Center Gear Blue", centerGearAuto); chooser.addObject("Left Gear", leftGearAuto); chooser.addObject("Right Gear", rightGearAuto); chooser.addObject("Boiler Red", boilerAuto); chooser.addObject("Center Gear Only",centerGearOnlyAuto); chooser.addObject("Boiler Blue", boilerAutoBlue); chooser.addObject("Center Gear Red", centerGearRed); SmartDashboard.putData("Auto choices", chooser); Compressor c = new Compressor(10); c.setClosedLoopControl(true); gyro.calibrate(); winchPush.setLock(false); }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { RobotMap.init(); // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS driveTrain = new DriveTrain(); shooter = new Shooter(); lift = new Lift(); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS // OI must be constructed after subsystems. If the OI creates Commands //(which it very likely will), subsystems are not guaranteed to be // constructed yet. Thus, their requires() statements may grab null // pointers. Bad news. Don't move it. oi = new OI(); // instantiate the command used for the autonomous period // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS autonomousCommand = new AutonomousCommand(); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS CameraServer cameraServer = CameraServer.getInstance(); System.out.println("Camera sources:" + VideoSource.enumerateSources().length); for (VideoSource videoSource : VideoSource.enumerateSources()) { System.out.println("Camera: " + videoSource.getName()); } UsbCamera camera= cameraServer.startAutomaticCapture(); System.out.println("Started camera capture."); // Hard coded camera address cameraServer.addAxisCamera("AxisCam ye", "10.26.67.42"); // visionThread = new VisionThread(camera,new GripPipeline()); driveTrainChooser = new SendableChooser(); driveTrainChooser.addDefault("default PWM", DriveTrain.DriveMode.PWM); for (DriveTrain.DriveMode driveMode : DriveTrain.DriveMode.values()) { driveTrainChooser.addObject(driveMode.name(), driveMode); } }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ @Override public void robotInit() { oi = new OI(); autoChooser = new SendableChooser<Command>(); autoChooser.addDefault("My Auto 1", new MyAutoCommand1()); //autoChooser.addObject("My Auto 2", new MyAutoCommand2()); //autoChooser.addObject("My Auto 3", new GyroDriveCommand(0.6, 0.6)); SmartDashboard.putData("Auto mode", autoChooser); }
private <T extends Enum<?>> void populateSelect(SendableChooser<T> chooser, Class<T> options) { boolean first = true; for (T value : options.getEnumConstants()) { if (first) { first = false; chooser.addDefault(value.toString(), value); } else { chooser.addObject(value.toString(), value); } } }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { RobotMap.init(); // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS driveTrain = new DriveTrain(); pDP = new PDP(); intake = new Intake(); climber = new Climber(); shooter = new Shooter(); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS // OI must be constructed after subsystems. If the OI creates Commands //(which it very likely will), subsystems are not guaranteed to be // constructed yet. Thus, their requires() statements may grab null // pointers. Bad news. Don't move it. oi = new OI(); // initializes networktable table = NetworkTable.getTable("HookContoursReport"); // sets up camera switcher server = CameraServer.getInstance(); server.startAutomaticCapture(0); // cameraInit(); // set up sendable chooser for autonomous autoChooser = new SendableChooser(); autoChooser.addDefault("Middle Hook", new AUTOMiddleHook()); autoChooser.addObject("Left Hook", new AUTOLeftHook()); autoChooser.addObject("RightHook", new AUTORightHook()); SmartDashboard.putData("Auto Chooser", autoChooser); // instantiate the command used for the autonomous period // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ // @Override public void robotInit() { System.out.println("1"); RobotMap.init(); drivetrain = new Drivetrain(); climber = new Climber(); // fuel = new Fuel(); gear = new Gear(); oi = new OI(); // initializes camera server server = CameraServer.getInstance(); cameraInit(); // initializes auto chooser autoChooser = new SendableChooser(); autoChooser.addDefault("Middle Hook", new AutoMiddleHook()); autoChooser.addObject("Loading Station Hook", new AutoLeftHook()); autoChooser.addObject("Boiler Side Hook", new AutoRightHook()); SmartDashboard.putData("Auto mode", autoChooser); // auto delay SmartDashboard.putNumber("Auto delay", 0); // resets all sensors resetAllSensors(); }
/** runs when robot is turned on */ public void robotInit() { /// instantiate operator interface OI.ye(); /// instantiate subsystems SUB_DRIVE = new SubsystemDrive(); /// instantiate autonomous chooser autoChooser = new SendableChooser<>(); autoChooser.addDefault(Autonomous.NOTHING.toString(), Autonomous.NOTHING); // set default to nothing for(int i = 1; i < Autonomous.values().length; i++) { autoChooser.addObject(Autonomous.values()[i].toString(), Autonomous.values()[i]); } // add each autonomous enum value to chooser SmartDashboard.putData("Auto Mode", autoChooser); //display the chooser on the dash }
static void putToSmartDashboard() { autoChooser = new SendableChooser<AutoMode>(); for(int i = 0; i < AutoMode.values().length; i++) { AutoMode mode = AutoMode.values()[i]; if(i == 0) { autoChooser.addDefault(mode.name, mode); } else { autoChooser.addObject(mode.name, mode); } } SmartDashboard.putData("auto_modes", autoChooser); }
@Override public void robotInit() { compressor.start(); CameraServer.getInstance().startAutomaticCapture(0); autoSelector = new SendableChooser<>(); autoSelector.addDefault("Drive Forward", new DriveForward()); autoSelector.addObject("Place Middle Gear", new MidGearAuto()); autoSelector.addObject("Place Right Gear <<< Feeling lucky?", new RightGearAuto()); autoSelector.addObject("Shoot on Blue Alliance", new BlueShootAuto()); autoSelector.addObject("Shoot on Red Alliance", new RedShootAuto()); SmartDashboard.putData("Autonomous Command", autoSelector); visiontracking = new VisionTracking(); //created this last for ordering issues oi = new OperatorInterface(); }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ @Override public void robotInit() { // Initialize hardware RobotMap.init(); // Initialize subsystems and default ManualDrive driveTrain = new DriveTrain(); vision = new Vision(); vision.init(); shooter = new Shooter(); indexer = new Indexer(); ballCollector = new BallCollector(); gearLoader = new GearLoader(); lifter = new Lifter(); // Initialize OI oi = new OI(); getStatus = new GetStatus(); getStatus.setRunWhenDisabled(true); chooser = new SendableChooser<>(); chooser.addDefault("Cross Line (L/R)", new CGAutoCrossLine()); chooser.addObject("Right", new CGAutoRight()); chooser.addObject("Middle", new CGAutoMiddle()); chooser.addObject("Left", new CGAutoLeft()); SmartDashboard.putData("Auto mode", chooser); }
public void robotInit() { // Create subsystems drive = new Drive(); intake = new Intake(); arm = new Arm(); shooter = new Shooter(); hanger = new Hanger(); oi = new OI(); // Create motion profiles crossLowBar = new Profile(AutoMap.crossLowBar); reach = new Profile(AutoMap.reach); toShoot = new Profile(AutoMap.toShoot); toLowGoal = new Profile(AutoMap.toLowGoal); // Pick an auto chooser = new SendableChooser(); chooser.addDefault("Do Nothing", new DoNothing()); chooser.addObject("Low Bar", new LowBarRawtonomous()); chooser.addObject("Low Bar (profile)", new CrossLowBar(crossLowBar)); chooser.addObject("Reach", new Reach(reach)); chooser.addObject("Forward Rawto", new ForwardRawtonomous()); chooser.addObject("Backward Rawto", new BackwardRawtonomous()); chooser.addObject("Shoot", new AutoShoot()); SmartDashboard.putData("Auto mode", chooser); // Start camera stream camera = new USBCamera(); server = CameraServer.getInstance(); server.setQuality(40); server.startAutomaticCapture(camera); // Start compressor compressor = new Compressor(); compressor.start(); navx = new AHRS(SPI.Port.kMXP); }
public void sendAutoModes() { chooser=new SendableChooser(); for(AutoMode mode:autoModes) { chooser.addObject(mode+"", mode); } }
public SendableChooser<File> loadAutonFiles(String aDir, String aDefaultName) { SendableChooser<File> output = new SendableChooser<>(); File autonDr = new File(aDir); if (autonDr.exists()) { System.out.println("Reading auton files from directory " + autonDr.getAbsolutePath()); System.out.println(" Using filter : \"" + mIgnoreString + "\""); try { Files.walkFileTree(Paths.get(autonDr.toURI()), this); boolean isFirst = true; for (Path p : mPaths) { if ((isFirst && aDefaultName == null) || p.getFileName().toString().equals(aDefaultName)) { output.addDefault(p.getFileName().toString(), p.toFile()); isFirst = false; } else { output.addObject(p.getFileName().toString(), p.toFile()); } } } catch (IOException e) { e.printStackTrace(); } } else { System.err.println("Auton directory " + aDir + " does not exist!"); } return output; }
/** * Creates a CommandParser object. * * @param aSnobot * The robot using the CommandParser. * @param aPositionChooser * @param aStartPosition */ public CommandParser(Snobot2017 aSnobot, SendableChooser<StartingPositions> aPositionChooser) { super(NetworkTable.getTable(SmartDashBoardNames.sAUTON_TABLE_NAME), SmartDashBoardNames.sROBOT_COMMAND_TEXT, SmartDashBoardNames.sSUCCESFULLY_PARSED_AUTON, " ", "#"); mSnobot = aSnobot; mPositionChooser = aPositionChooser; }
/** * Constructor: news up and adds objects to the sendable chooser. */ public SelectStartPosition(IPositioner aPositioner) { mPickPoint = new SendableChooser(); mPickPoint.addDefault("Position 1", StartPositions.FIRST_POSITION); mPickPoint.addObject("Position 2", StartPositions.SECOND_POSITION); mPickPoint.addObject("Position 3", StartPositions.THIRD_POSITION); mPickPoint.addObject("Position 4", StartPositions.FOURTH_POSITION); mPickPoint.addObject("Position 5", StartPositions.FIFTH_POSITION); mPickPoint.addObject("Spy Bot", StartPositions.SPY_POSITION); mPickPoint.addObject("TEST (0, 0, 0)", StartPositions.ZERO_ZERO_ZERO_POSITION); mPositioner = aPositioner; }
/** * In the constructor, we new up the chooser and add all of the enum * options. */ public DefenseInFront() { mDefenseInFront = new SendableChooser(); mDefenseInFront.addDefault("Low Bar", Defenses.LOW_BAR); mDefenseInFront.addObject("Portcullis", Defenses.PORTCULLIS); mDefenseInFront.addObject("Chival de Frise", Defenses.CHIVAL_DE_FRISE); mDefenseInFront.addObject("Moat", Defenses.MOAT); mDefenseInFront.addObject("Ramparts", Defenses.RAMPARTS); mDefenseInFront.addObject("Drawbridge", Defenses.DRAWBRIDGE); mDefenseInFront.addObject("Sally Port", Defenses.SALLY_PORT); mDefenseInFront.addObject("Rock Wall", Defenses.ROCK_WALL); mDefenseInFront.addObject("Rough Terrain", Defenses.ROUGH_TERRAIN); mDefenseInFront.addObject("Do Nothing", Defenses.DO_NOTHING); }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { oi = new OI(); chooser = new SendableChooser(); chooser.addDefault("Default Auto", new AutoDefault()); // chooser.addObject("My Auto", new MyAutoCommand()); SmartDashboard.putData("Auto mode", chooser); belowLowBar = new DriveForward(5, -1); }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { oi = new OI(); chooser = new SendableChooser(); chooser.addDefault("Default Auto", new ExampleCommand()); // chooser.addObject("My Auto", new MyAutoCommand()); SmartDashboard.putData("Auto mode", chooser); SmartDashboard.putData(lDrive); SmartDashboard.putData(rDrive); }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { RobotMap.init(); // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS drive = new Drive(); arm = new Arm(); intake = new Intake(); shooter = new Shooter(); aim = new Aim(); timer = new Timer(); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS // OI must be constructed after subsystems. If the OI creates Commands //(which it very likely will), subsystems are not guaranteed to be // constructed yet. Thus, their requires() statements may grab null // pointers. Bad news. Don't move it. //oi = new OI(); oi = new OI(this); // instantiate the command used for the autonomous period // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS //autonomousCommand = new AutonomousCommand(); autoChooser = new SendableChooser(); autoChooser.addDefault("LowBarAuto (default)", new LowBarAuto()); autoChooser.addObject("SesawAuto", new SesawAuto()); SmartDashboard.putData("Autonomous Mode Choose",autoChooser); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { oi = new OI(); chooser = new SendableChooser(); chooser.addDefault("Default Auto", new ExampleCommand()); // chooser.addObject("My Auto", new MyAutoCommand()); SmartDashboard.putData("Auto mode", chooser); }
public Autonomous(Robot robot) { this.robot = robot; autoChooser = new SendableChooser(); autoChooser.addDefault("No autonomous", AutoMode.AUTOMODE_NONE); autoChooser.addObject("Low bar", AutoMode.AUTOMODE_LOW_BAR); autoChooser.addObject("Rough terrain", AutoMode.AUTOMODE_ROUGH_TERRAIN); autoChooser.addObject("Moat", AutoMode.AUTOMODE_MOAT); autoChooser.addObject("Ramparts", AutoMode.AUTOMODE_RAMPARTS); autoChooser.addObject("Rock wall", AutoMode.AUTOMODE_ROCK_WALL); autoChooser.addObject("Teeter totter", AutoMode.AUTOMODE_TEETER_TOTTER); autoChooser.addObject("Portcullis", AutoMode.AUTOMODE_PORTCULLIS); HalDashboard.putData("Autonomous Strategies", autoChooser); }