@@ -105,22 +105,23 @@ void Robot::RobotInit()
105105 );
106106
107107 m_chooser.SetDefaultOption (kAutoNameDefault , kAutoNameDefault );
108- m_chooser.AddOption (kAutoShootAndDrive , kAutoShootAndDrive );
108+ m_chooser.AddOption (kAutoDriveAndShoot , kAutoDriveAndShoot );
109109 frc::SmartDashboard::PutData (" Auto Modes" , &m_chooser);
110110
111- mShootAndDrive = new frc2::SequentialCommandGroup {
112- ShootCommand {mShooter }.WithTimeout (1_s),
113- frc2::FunctionalCommand { // drive backwards
114- [](){},
115- [&](){
116- mSwerveDrive ->setMotion (0 , -0.5 , 0 );
117- },
118- [&](bool _interrupted){
119- mSwerveDrive ->setMotion (0 , 0 , 0 ); // stop swerve
120- },
121- [](){ return false ; },
122- {mSwerveDrive }
123- }.WithTimeout (2_s)
111+ mDriveAndShoot = new frc2::SequentialCommandGroup {
112+ frc2::FunctionalCommand { // drive backwards
113+ [](){},
114+ [&](){
115+ // Turn slightly right to compensate for drift/drag.
116+ mSwerveDrive ->setMotion (0 , -0.5 , -0.03 );
117+ },
118+ [&](bool _interrupted){
119+ mSwerveDrive ->setMotion (0 , 0 , 0 ); // stop swerve
120+ },
121+ [](){ return false ; },
122+ {mSwerveDrive }
123+ }.WithTimeout (1 .2_s),
124+ frc2::StartEndCommand (*mShootNear ).WithTimeout (3_s)
124125 };
125126}
126127
@@ -154,8 +155,8 @@ void Robot::AutonomousInit()
154155 // kAutoNameDefault);
155156 std::cout << " Auto selected: " << m_autoSelected << std::endl;
156157
157- if (m_autoSelected == kAutoShootAndDrive ) {
158- mShootAndDrive ->Schedule ();
158+ if (m_autoSelected == kAutoDriveAndShoot ) {
159+ mDriveAndShoot ->Schedule ();
159160 } else {
160161 // Default Auto goes here
161162 }
0 commit comments