Running autonomous in java

My team is fairly new to java, and aren’t getting any commands or command groups to run in autonomous mode. we wrote this command group and tried running it with a button while held, but couldn’t get anything to run. we attempted to run it in autonomous mode, but nothing would run then either. Can anybody point us in the right direction? Any help would be appreciated.

This is what we have in our SequentialCommandGroup:

package frc.robot.commands;

import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandGroupBase;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.robot.commands.Auto_Rotate;
import frc.robot.commands.Autodrive_forward;

public class ComplexAuto extends SequentialCommandGroup {

public void ComplexAuto() {
addCommands(new Auto_Rotate(5, 45));
addCommands(new Autodrive_forward(5, 5));

}
}

Our entire code is here: https://github.com/DJthefirst/TigerTrons222-2020/tree/master/Tigertrons222-TestCode

Looks like you accidentally defined your constructor as a method, so no commands are actually being added to the group. What happens if you remove the “void” keyword from it?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.