All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.flash3388.flashlib.robot.systems.actions.DriveHolonomic Maven / Gradle / Ivy

There is a newer version: 3.2.7
Show newest version
package com.flash3388.flashlib.robot.systems.actions;

import com.flash3388.flashlib.robot.motion.HolonomicDrive;
import com.flash3388.flashlib.robot.motion.HolonomicDriveSpeed;
import com.flash3388.flashlib.scheduling.ActionControl;
import com.flash3388.flashlib.scheduling.FinishReason;
import com.flash3388.flashlib.scheduling.actions.ActionBase;

import java.util.function.Supplier;

public class DriveHolonomic extends ActionBase {

    private final HolonomicDrive mDrive;
    private final Supplier mSpeed;

    public DriveHolonomic(HolonomicDrive drive, Supplier speed) {
        mDrive = drive;
        mSpeed = speed;
    }

    @Override
    public void initialize(ActionControl control) {

    }

    @Override
    public void execute(ActionControl control) {
        mDrive.holonomicDrive(mSpeed.get());
    }

    @Override
    public void end(FinishReason reason) {
        mDrive.stop();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy