I Need Help

I am trying to get controls set up but my addRequirments keeps erroring out. Can some one help?

Here is my code:

package frc.robot.commands.corecommands.intake;

import java.util.function.DoubleSupplier;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.intake.IntakeSubsystem;

public class IntakeMove extends Command{

IntakeSubsystem intakeSubsystem;
DoubleSupplier lift;

public IntakeMove(IntakeSubsystem intakeSubsystem, DoubleSupplier lift){

    this.intakeSubsystem = intakeSubsystem;
    this.lift = lift;

    addRequirements(intakeSubsystem);
    
}

@Override
public void initialize(){}

@Override
public void execute(){
    intakeSubsystem.intakeLift(lift.getAsDouble());
}

@Override
public void end(boolean interrupted){}

@Override
public boolean isFinished() {
    return false;
}

}

It works in other places just not here

Whats the error you’re getting?

Do you have a log or error message? I suspect that your IntakeSubsystem class doesn’t extend subsystem, but it is impossible to tell without additional information.

2 Likes

you should extend CommandBase instead of Command

I think CommandBase is now deprecated, no?

1 Like

oh you’re right it is, I didn’t notice that

1 Like

Does IntakeSubsystem extend SubsystemBase? What error are you getting?

@Max_Morehead and @hheroux24 I found it and you guys were right, thanks anyways!

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