We are trying to get the chooser on the smart dashboard using the putdata() but it will not appear on the dashboard here is our code does anyone know what we’re doing wrong
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package frc.robot;
import edu.wpi.first.wpilibj.GenericHID;
import edu.wpi.first.wpilibj.XboxController;
import frc.robot.commands.*;
import frc.robot.subsystems.*;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
import edu.wpi.first.wpilibj.smartdashboard.*;
/**
* This class is where the bulk of the robot should be declared. Since
* Command-based is a "declarative" paradigm, very little robot logic should
* actually be handled in the {@link Robot} periodic methods (other than the
* scheduler calls). Instead, the structure of the robot (including subsystems,
* commands, and button mappings) should be declared here.
*/
public class RobotContainer {
// The robot's subsystems and commands are defined here...
public static ShooterSubsystem shooter = new ShooterSubsystem();
public static ConvayerIntakeSubsystem convayerIntake = new ConvayerIntakeSubsystem();
public static RotaterSubsystem rotater = new RotaterSubsystem();
public static ClimberSubsystem climber = new ClimberSubsystem();
// public static DriveSubsystem drive = new DriveSubsystem();
private final TestAuto1 test1 = new TestAuto1();
private final TestAuto2 test2 = new TestAuto2();
SendableChooser<Command> chooser = new SendableChooser<>();
public static int shooterRPM = 4000;
// joysticks
Joystick _joy = new Joystick(0);
Joystick _joy2 = new Joystick(0);
// joystick buttons
/**
* The container for the robot. Contains subsystems, OI devices, and commands.
*/
public RobotContainer() {
chooser.addOption("test1", test1);
chooser.addOption("test2", test2);
SmartDashboard.putData("autos",chooser);
// Configure the button bindings
configureButtonBindings();
}
/**
* Use this method to define your button->command mappings. Buttons can be
* created by instantiating a {@link GenericHID} or one of its subclasses
* ({@link edu.wpi.first.wpilibj.Joystick} or {@link XboxController}), and then
* passing it to a {@link edu.wpi.first.wpilibj2.command.button.JoystickButton}.
*/
private void configureButtonBindings() {
// button presses
// toggle to rev up shooter
new JoystickButton(_joy, 2).toggleWhenPressed(new SpinShooter(shooterRPM));
// hold to drive convayer and shooter to shoot balls when done will drop the
// adjuster back to 0
new JoystickButton(_joy, 8).whileHeld(new ShootBalls());
// will adjust the shooter
new JoystickButton(_joy, 6).toggleWhenPressed(new AdjustShooter(300));
//puts the shooter adjuster to controll panell position
new JoystickButton(_joy, 5).toggleWhenPressed(new AdjustShooter(500));
//spins rotater to rotation control position
new JoystickButton(_joy, 4).whileHeld(new SpinRotaterToPosition(500));
//unwinds winch
new JoystickButton(_joy2, 2).whileHeld(new DriveClimberWinch(1));
//winds up winch
new JoystickButton(_joy2, 4).whileHeld(new DriveClimberWinch(-1));
//drive climber left
new JoystickButton(_joy2, 1).whileHeld(new DriveClimberDrive(1));
//drive climber right
new JoystickButton(_joy2, 3).whileHeld(new DriveClimberDrive(-1));
//bring winch to bottom
new JoystickButton(_joy2, 8).whileHeld(new DriveClimberWinchToPosition(100));
}
/**
* Use this to pass the autonomous command to the main {@link Robot} class.
*
* @return the command to run in autonomous
*/
public Command getAutonomousCommand() {
// An ExampleCommand will run in autonomous
return null;
}
}