Skip to main content

PARTs Command Utilities

Explanation & History

PARTs Command Utilities are used for commands in the robot project. Commands are actions that tell the robot what to do with its subsystems. Currently the only feature this class provides is naming our commands for logging and debugging reasons. We do it this way because it allows us to easily chain other actions or configurations with the command.

Code Example

package;

import org.parts3492.partslib.command.PARTsCommandUtils;
import org.parts3492.partslib.command.PARTsSubsystem;

import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;

public class MySubsystem extends PARTsSubsystem {
    
    public MySubsystem() {
        super();
    }

    public Command commandDoNothing() {
        // Return our command.                   Our command name.   The command.
        return PARTsCommandUtils.setCommandName("MySubsystem.print", Commands.idle(this));
    }

    @Override
    public void outputTelemetry() {}

    @Override
    public void stop() {}

    @Override
    public void reset() {}

    @Override
    public void log() {}
}