How to create a WPILIB FRC 2020 Autonomous commands with addSequentials(());?

How do you create a WPILIB FRC 2020 Autonomous commands with addSequentials(()); and addParrallels(()); ?

That depends whether you’re using the “new” command-based framework, or the “old” command-based framework. If using the new framework (my recommendation if you were starting fresh), then these docs should help: https://docs.wpilib.org/en/latest/docs/software/commandbased/command-groups.html. If using the old framework, you can refer to these docs instead: https://docs.wpilib.org/en/latest/docs/software/old-commandbased/commands/creating-groups-commands.html

Given the mention of addSequential() and addParallel(), I’m inclined to believe you’re familiar with the old framework, however given that it’s apparently not working, I’m inclined to believe you’re using the new framework. Having said that, without more information (link to code, etc), we can’t provide a concrete answer.

/----------------------------------------------------------------------------/

/* Copyright © 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.commands;

import edu.wpi.first.wpilibj2.command.CommandBase;

public class AutonomousCommand extends CommandBase {

/**

  • Creates a new AutonomousCommand.

*/

public AutonomousCommand() {

// Use addRequirements() here to declare subsystem dependencies.

}

// Called when the command is initially scheduled.

@Override

public void initialize() {

}

// Called every time the scheduler runs while the command is scheduled.

@Override

public void execute() {

}

// Called once the command ends or is interrupted.

@Override

public void end(boolean interrupted) {

}

// Returns true when the command should end.

@Override

public boolean isFinished() {

return false;

}

}

this is what I have as a starter

Im using the new framework

Definitely take a look through the docs (first link I gave you). In short, you don’t use the addSequential() method anymore, you use the SequentialCommandGroup class

thanks, I will look into it

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