Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
63e476c64e | |||
9b86a0b975 | |||
77240d255e | |||
7ffeb78c35 | |||
5b80c53963 | |||
476df088ea | |||
cfc6ba9479 | |||
583413ec5f | |||
eb141ac2ba | |||
3669e079bd | |||
0f81dd39e9 | |||
a984625e17 | |||
a54ebb16e9 | |||
6437b9f152 | |||
7be1b69ece | |||
d44aea512d | |||
8a7f10ec64 | |||
345eb83d39 | |||
f01f327c81 | |||
0c7cfc9d4c | |||
831b9fec75 | |||
982db16833 | |||
12b5e6954e | |||
7e40328af4 | |||
9653ca7205 | |||
1583a95f52 |
@ -1 +0,0 @@
|
||||
{}
|
@ -1,9 +1,4 @@
|
||||
{
|
||||
"Joysticks": {
|
||||
"window": {
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
"System Joysticks": {
|
||||
"window": {
|
||||
"enabled": false
|
||||
|
@ -4,77 +4,42 @@
|
||||
|
||||
package frc.robot;
|
||||
|
||||
import com.pathplanner.lib.auto.NamedCommands;
|
||||
import edu.wpi.first.math.MathUtil;
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import edu.wpi.first.wpilibj2.command.Commands;
|
||||
import edu.wpi.first.wpilibj2.command.RunCommand;
|
||||
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
||||
import frc.robot.commands.Algue1Test;
|
||||
import frc.robot.commands.Algue2Test;
|
||||
import frc.robot.commands.AlgueExpire;
|
||||
import frc.robot.commands.CorailAspir;
|
||||
import frc.robot.commands.CorailTest;
|
||||
import frc.robot.commands.CoralAlgueInspire;
|
||||
import frc.robot.commands.CoralExpire;
|
||||
import frc.robot.commands.Depart;
|
||||
import frc.robot.commands.DepartPince;
|
||||
import frc.robot.commands.ElevateurManuel;
|
||||
import frc.robot.commands.L2;
|
||||
import frc.robot.commands.L3;
|
||||
import frc.robot.commands.L4;
|
||||
import frc.robot.commands.PinceManuel;
|
||||
import frc.robot.commands.PinceManuel2;
|
||||
import frc.robot.commands.StationPince;
|
||||
import frc.robot.commands.reset;
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
import frc.robot.subsystems.Pince;
|
||||
import frc.robot.commands.GrimperHaut;
|
||||
import frc.robot.commands.GrimpeurBas;
|
||||
import frc.robot.commands.GrimpeurManuel;
|
||||
import frc.robot.commands.ResetGrimpeur;
|
||||
import frc.robot.subsystems.Bougie;
|
||||
import frc.robot.subsystems.Grimpeur;
|
||||
|
||||
public class RobotContainer {
|
||||
|
||||
CommandXboxController manette1 = new CommandXboxController(0);
|
||||
CommandXboxController manette2 = new CommandXboxController(1);
|
||||
Grimpeur grimpeur = new Grimpeur();
|
||||
Bougie bougie = new Bougie();
|
||||
Pince pince = new Pince();
|
||||
Elevateur elevateur = new Elevateur();
|
||||
ElevateurManuel elevateurManuel = new ElevateurManuel(elevateur, manette2::getLeftY);
|
||||
PinceManuel pinceManuel = new PinceManuel(pince,manette2::getRightY);
|
||||
PinceManuel2 pinceManuel2 = new PinceManuel2(pince);
|
||||
GrimpeurManuel grimpeurManuel = new GrimpeurManuel(grimpeur, manette2::getLeftY);
|
||||
public RobotContainer() {
|
||||
grimpeur.setDefaultCommand(new RunCommand(()->{
|
||||
if(grimpeur.stop()){
|
||||
grimpeur.grimpe(0);
|
||||
}
|
||||
else{
|
||||
grimpeur.grimpe(MathUtil.applyDeadband(manette2.getLeftY(), 0.2));
|
||||
}}, grimpeur));
|
||||
configureBindings();
|
||||
elevateur.setDefaultCommand(new RunCommand(()->{
|
||||
elevateur.vitesse(MathUtil.applyDeadband(manette2.getLeftY(), 0.2));
|
||||
}, elevateur));
|
||||
pince.setDefaultCommand(new RunCommand(()->{
|
||||
pince.pivote(MathUtil.applyDeadband(manette2.getRightY()/5, 0.2));
|
||||
}, pince));
|
||||
NamedCommands.registerCommand("Station",new StationPince(pince, elevateur));
|
||||
NamedCommands.registerCommand("L4", new L4(elevateur, pince));
|
||||
NamedCommands.registerCommand("L3", new L3(elevateur, pince));
|
||||
NamedCommands.registerCommand("CoralExpire",new CoralExpire(pince,bougie));
|
||||
NamedCommands.registerCommand("CoraletAlgue", new CoralAlgueInspire(pince,bougie));
|
||||
|
||||
}
|
||||
|
||||
private void configureBindings() {
|
||||
// manette1
|
||||
manette1.a().whileTrue(new Depart(elevateur, pince));
|
||||
manette1.b().whileTrue(new L2(elevateur,pince));
|
||||
manette1.x().whileTrue(new L3(elevateur, pince));
|
||||
manette1.y().whileTrue(new L4(elevateur, pince));
|
||||
manette1.rightTrigger().whileTrue(new CoralAlgueInspire(pince, bougie));
|
||||
manette1.rightBumper().whileTrue(new StationPince(pince, elevateur));
|
||||
//manette2
|
||||
manette2.leftTrigger().whileTrue(new AlgueExpire(pince, bougie));
|
||||
manette2.a().whileTrue(new CorailAspir(pince));
|
||||
manette2.b().whileTrue(new CoralExpire(pince, bougie));
|
||||
manette2.povLeft().whileTrue(new Algue1Test(pince));
|
||||
manette2.povRight().whileTrue(new Algue2Test(pince));
|
||||
manette2.x().whileTrue(new CorailTest(pince));
|
||||
manette2.start().whileTrue(new reset(elevateur));
|
||||
}
|
||||
|
||||
private void configureBindings() {
|
||||
manette2.leftBumper().whileTrue(new GrimperHaut(grimpeur,bougie));
|
||||
manette2.rightBumper().whileTrue(new GrimpeurBas(grimpeur));
|
||||
manette2.a().whileTrue(new ResetGrimpeur(grimpeur));
|
||||
}
|
||||
|
||||
public Command getAutonomousCommand() {
|
||||
return Commands.print("No autonomous command configured");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class Algue2Test extends Command {
|
||||
private Pince pince;
|
||||
/** Creates a new AlgueTest. */
|
||||
public Algue2Test(Pince pince) {
|
||||
this.pince = pince;
|
||||
addRequirements(pince);
|
||||
// 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() {
|
||||
pince.algue2Test(0.2);
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
pince.algue2Test(0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class CorailAspir extends Command {
|
||||
/** Creates a new CorailAspir. */
|
||||
private Pince pince;
|
||||
public CorailAspir(Pince pince) {
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
this.pince = pince;
|
||||
addRequirements(pince);
|
||||
}
|
||||
|
||||
// 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() {
|
||||
|
||||
pince.aspirecoral(0.5);
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
pince.aspirecoral(0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class CorailTest extends Command {
|
||||
private Pince pince;
|
||||
/** Creates a new AlgueTest. */
|
||||
public CorailTest(Pince pince) {
|
||||
this.pince = pince;
|
||||
addRequirements(pince);
|
||||
// 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() {
|
||||
pince.aspirecoral(0.2);
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
pince.aspirecoral(0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Bougie;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class CoralAlgueInspire extends Command {
|
||||
private Pince pince;
|
||||
private Bougie bougie;
|
||||
/** Creates a new CoralAlgue. */
|
||||
public CoralAlgueInspire(Pince pince, Bougie bougie) {
|
||||
this.pince = pince;
|
||||
this.bougie = bougie;
|
||||
addRequirements(pince,bougie);
|
||||
// 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() {
|
||||
pince.aspirecoral(-.5);
|
||||
if(pince.emperagealgue()>60){
|
||||
pince.aspirealgue(0);
|
||||
bougie.Bleu();
|
||||
}
|
||||
else{
|
||||
pince.aspirealgue(0.5);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
pince.aspirecoral(0);
|
||||
pince.aspirealgue(0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Pince;
|
||||
import frc.robot.subsystems.Bougie;
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class CoralExpire extends Command {
|
||||
private Pince pince;
|
||||
Bougie bougie;
|
||||
/** Creates a new CoralAlgue. */
|
||||
public CoralExpire(Pince pince, Bougie bougie) {
|
||||
this.pince = pince;
|
||||
this.bougie = bougie;
|
||||
addRequirements(pince,bougie);
|
||||
// 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() {
|
||||
//if(pince.emperagecoral() > 60){
|
||||
// pince.aspirecoral(0);
|
||||
//}
|
||||
//else{
|
||||
pince.aspirecoral(-.5);
|
||||
//bougie.Jaune();
|
||||
// }
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
pince.aspirecoral(0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class Depart extends Command {
|
||||
private Elevateur elevateur;
|
||||
private Pince pince;
|
||||
/** Creates a new L2. */
|
||||
public Depart(Elevateur elevateur, Pince pince) {
|
||||
this.pince = pince;
|
||||
this.elevateur = elevateur;
|
||||
addRequirements(elevateur,pince);
|
||||
// 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() {
|
||||
if(elevateur.limit2()==true){
|
||||
elevateur.vitesse(0);
|
||||
elevateur.reset();
|
||||
}
|
||||
else{
|
||||
elevateur.vitesse(.5);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
elevateur.vitesse(0);
|
||||
pince.pivote(0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return elevateur.limit2()==true;
|
||||
}
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.commands;
|
||||
|
||||
import java.util.function.DoubleSupplier;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class ElevateurManuel extends Command {
|
||||
private DoubleSupplier doubleSupplier;
|
||||
private Elevateur elevateur;
|
||||
/** Creates a new ElevateurManuel. */
|
||||
public ElevateurManuel(Elevateur elevateur,DoubleSupplier doubleSupplier) {
|
||||
this.doubleSupplier = doubleSupplier;
|
||||
this.elevateur = elevateur;
|
||||
addRequirements(elevateur);
|
||||
// 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() {
|
||||
if(elevateur.limit2()==true){
|
||||
elevateur.vitesse(0);
|
||||
}
|
||||
elevateur.vitesse(doubleSupplier.getAsDouble()/7);
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
elevateur.vitesse(0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -6,17 +6,17 @@ package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Bougie;
|
||||
import frc.robot.subsystems.Pince;
|
||||
import frc.robot.subsystems.Grimpeur;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class AlgueExpire extends Command {
|
||||
private Pince pince;
|
||||
public class GrimperHaut extends Command {
|
||||
private Grimpeur grimpeur;
|
||||
private Bougie bougie;
|
||||
/** Creates a new CoralAlgue. */
|
||||
public AlgueExpire(Pince pince,Bougie bougie) {
|
||||
this.pince = pince;
|
||||
/** Creates a new Grimper. */
|
||||
public GrimperHaut(Grimpeur grimpeur, Bougie bougie) {
|
||||
this.grimpeur = grimpeur;
|
||||
this.bougie = bougie;
|
||||
addRequirements(pince,bougie);
|
||||
addRequirements(grimpeur,bougie);
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
}
|
||||
|
||||
@ -27,25 +27,30 @@ public class AlgueExpire extends Command {
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
if(pince.emperagealgue()>60){
|
||||
pince.aspirealgue(-0.5);
|
||||
if(grimpeur.stop()==true){
|
||||
grimpeur.grimpe(0);
|
||||
grimpeur.reset();
|
||||
bougie.RainBow();
|
||||
}
|
||||
else{
|
||||
pince.aspirealgue(-0.5);
|
||||
bougie.Jaune();
|
||||
grimpeur.grimpe(0.5);
|
||||
bougie.RainBowStop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
pince.aspirealgue(0);
|
||||
grimpeur.grimpe(0);
|
||||
if(grimpeur.stop()){
|
||||
bougie.RainBow();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
return grimpeur.stop()==true;
|
||||
}
|
||||
}
|
@ -5,15 +5,15 @@
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Pince;
|
||||
import frc.robot.subsystems.Grimpeur;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class DepartPince extends Command {
|
||||
private Pince pince;
|
||||
/** Creates a new DepartPince. */
|
||||
public DepartPince(Pince pince) {
|
||||
this.pince = pince;
|
||||
addRequirements(pince);
|
||||
public class GrimpeurBas extends Command {
|
||||
private Grimpeur grimpeur;
|
||||
/** Creates a new GrimpeurBas. */
|
||||
public GrimpeurBas(Grimpeur grimpeur) {
|
||||
this.grimpeur = grimpeur;
|
||||
addRequirements(grimpeur);
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
}
|
||||
|
||||
@ -24,19 +24,20 @@ public class DepartPince extends Command {
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
if(pince.position()==true){
|
||||
pince.pivote(0);
|
||||
pince.reset();
|
||||
if(grimpeur.encodeur()>=-38.5 && grimpeur.encodeur()<=-39.19){
|
||||
grimpeur.grimpe(0);
|
||||
}
|
||||
else{
|
||||
pince.pivote(.2);
|
||||
else if(grimpeur.encodeur()>=-38.5){
|
||||
grimpeur.grimpe(-0.5);
|
||||
}
|
||||
else{grimpeur.grimpe(0.5);
|
||||
}
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
pince.pivote(0);
|
||||
grimpeur.grimpe(0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
@ -3,21 +3,21 @@
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.commands;
|
||||
|
||||
import java.util.function.DoubleSupplier;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Pince;
|
||||
import frc.robot.subsystems.Grimpeur;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class PinceManuel extends Command {
|
||||
private Pince pince;
|
||||
public class GrimpeurManuel extends Command {
|
||||
private Grimpeur grimpeur;
|
||||
private DoubleSupplier x;
|
||||
/** Creates a new PinceManuel. */
|
||||
public PinceManuel(Pince pince, DoubleSupplier x) {
|
||||
this.pince = pince;
|
||||
/** Creates a new GrimpeurManuel. */
|
||||
public GrimpeurManuel(Grimpeur grimpeur,DoubleSupplier x) {
|
||||
this.grimpeur = grimpeur;
|
||||
this.x = x;
|
||||
//this.doubleSupplier = doubleSupplier;
|
||||
addRequirements(pince);
|
||||
addRequirements(grimpeur);
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
}
|
||||
|
||||
@ -28,18 +28,19 @@ public class PinceManuel extends Command {
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
if(pince.position()){
|
||||
pince.pivote(0);
|
||||
}
|
||||
else{
|
||||
pince.pivote(x.getAsDouble());
|
||||
}
|
||||
if(grimpeur.stop()){
|
||||
grimpeur.grimpe(0);
|
||||
}
|
||||
else{
|
||||
grimpeur.grimpe(x.getAsDouble());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
pince.pivote(0);
|
||||
grimpeur.grimpe(0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
@ -1,65 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class L2 extends Command {
|
||||
private Elevateur elevateur;
|
||||
private Pince pince;
|
||||
/** Creates a new L2. */
|
||||
public L2(Elevateur elevateur,Pince pince) {
|
||||
this.elevateur = elevateur;
|
||||
this.pince = pince;
|
||||
addRequirements(elevateur,pince);
|
||||
// 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() {
|
||||
if(elevateur.position()>=500 && elevateur.position()<=510){
|
||||
elevateur.vitesse(0);
|
||||
}
|
||||
else if(elevateur.position()>=510){
|
||||
elevateur.vitesse(0.3);
|
||||
}
|
||||
else{
|
||||
elevateur.vitesse(.3);
|
||||
}
|
||||
if(pince.encodeurpivot()>=500 && pince.encodeurpivot()<=510){
|
||||
pince.pivote(0);
|
||||
|
||||
}
|
||||
else if(pince.encodeurpivot()>=510){
|
||||
pince.pivote(0.2);
|
||||
}
|
||||
else{
|
||||
pince.pivote(-0.2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
elevateur.vitesse(0);
|
||||
pince.pivote(0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class L3 extends Command {
|
||||
private Elevateur elevateur;
|
||||
private Pince pince;
|
||||
/** Creates a new L2. */
|
||||
public L3(Elevateur elevateur,Pince pince) {
|
||||
this.elevateur = elevateur;
|
||||
this.pince = pince;
|
||||
addRequirements(elevateur,pince);
|
||||
// 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() {
|
||||
if(elevateur.position()>=700 && elevateur.position()<=710){
|
||||
elevateur.vitesse(0);
|
||||
}
|
||||
else if(elevateur.position()>=510){
|
||||
elevateur.vitesse(0.5);
|
||||
}
|
||||
else{
|
||||
elevateur.vitesse(-.5);
|
||||
}
|
||||
if(pince.encodeurpivot()>=700 && pince.encodeurpivot()<=710){
|
||||
pince.pivote(0);
|
||||
}
|
||||
else if(pince.encodeurpivot()>=710){
|
||||
pince.pivote(0.2);
|
||||
}
|
||||
else{
|
||||
pince.pivote(-0.2);
|
||||
}
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
elevateur.vitesse(0);
|
||||
pince.pivote(0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class L4 extends Command {
|
||||
private Elevateur elevateur;
|
||||
private Pince pince;
|
||||
/** Creates a new L2. */
|
||||
public L4(Elevateur elevateur,Pince pince) {
|
||||
this.elevateur = elevateur;
|
||||
this.pince = pince;
|
||||
addRequirements(elevateur,pince);
|
||||
// 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() {
|
||||
if(elevateur.position()>=800 && elevateur.position()<=809){
|
||||
elevateur.vitesse(0);
|
||||
}
|
||||
else if(elevateur.position()>=810){
|
||||
elevateur.vitesse(0.5);
|
||||
}
|
||||
else{
|
||||
elevateur.vitesse(.5);
|
||||
}
|
||||
if(pince.encodeurpivot()>=800 && pince.encodeurpivot()<=809){
|
||||
pince.pivote(0);
|
||||
}
|
||||
else if(pince.encodeurpivot()>=810){
|
||||
pince.pivote(0.2);
|
||||
}
|
||||
else{
|
||||
pince.pivote(-0.2);
|
||||
}
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
elevateur.vitesse(0);
|
||||
pince.pivote(0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.commands;
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class PinceManuel2 extends Command {
|
||||
private Pince pince;
|
||||
//private DoubleSupplier doubleSupplier;
|
||||
/** Creates a new PinceManuel. */
|
||||
public PinceManuel2(Pince pince
|
||||
|
||||
//,DoubleSupplier doubleSupplier
|
||||
) {
|
||||
this.pince = pince;
|
||||
// this.doubleSupplier = doubleSupplier;
|
||||
addRequirements(pince);
|
||||
// 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() {
|
||||
|
||||
pince.pivote(-0.2);
|
||||
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
pince.pivote(0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -5,15 +5,15 @@
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Pince;
|
||||
import frc.robot.subsystems.Bougie;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class Algue1Test extends Command {
|
||||
private Pince pince;
|
||||
/** Creates a new AlgueTest. */
|
||||
public Algue1Test(Pince pince) {
|
||||
this.pince = pince;
|
||||
addRequirements(pince);
|
||||
public class RainBow extends Command {
|
||||
/** Creates a new RainBow. */
|
||||
private Bougie bougie;
|
||||
public RainBow(Bougie bougie) {
|
||||
this.bougie = bougie;
|
||||
addRequirements(bougie);
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
}
|
||||
|
||||
@ -24,13 +24,13 @@ public class Algue1Test extends Command {
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
pince.algue1Test(0.2);
|
||||
bougie.RainBow();
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
pince.algue1Test(0);
|
||||
bougie.RainBowStop();
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
@ -5,18 +5,16 @@
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
|
||||
|
||||
import frc.robot.subsystems.Grimpeur;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class reset extends Command {
|
||||
/** Creates a new reset. */
|
||||
private Elevateur elevateur;
|
||||
public reset(Elevateur elevateur) {
|
||||
public class ResetGrimpeur extends Command {
|
||||
private Grimpeur grimpeur;
|
||||
/** Creates a new ResetGrimpeur. */
|
||||
public ResetGrimpeur(Grimpeur grimpeur) {
|
||||
this.grimpeur = grimpeur;
|
||||
addRequirements(grimpeur);
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
this.elevateur = elevateur;
|
||||
addRequirements(elevateur);
|
||||
}
|
||||
|
||||
// Called when the command is initially scheduled.
|
||||
@ -26,7 +24,7 @@ public class reset extends Command {
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
elevateur.reset();
|
||||
grimpeur.reset();
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
@ -1,64 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||
public class StationPince extends Command {
|
||||
|
||||
private Pince pince;
|
||||
private Elevateur elevateur;
|
||||
/** Creates a new L2Pince. */
|
||||
public StationPince(Pince pince,Elevateur elevateur) {
|
||||
this.elevateur = elevateur;
|
||||
this.pince = pince;
|
||||
addRequirements(pince,elevateur);
|
||||
// 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() {
|
||||
pince.aspirecoral(0.5);
|
||||
if(pince.encodeurpivot()>=900 && pince.encodeurpivot()<=910){
|
||||
pince.pivote(0);
|
||||
}
|
||||
else if(pince.encodeurpivot()>=910){
|
||||
pince.pivote(0.2);
|
||||
}
|
||||
else{
|
||||
pince.pivote(-0.2);
|
||||
}
|
||||
if(elevateur.position()>=400 && elevateur.position()<=410){
|
||||
elevateur.vitesse(0);
|
||||
}
|
||||
else if(elevateur.position()>=410){
|
||||
elevateur.vitesse(0.3);
|
||||
}
|
||||
else{
|
||||
elevateur.vitesse(-.3);
|
||||
}
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
pince.pivote(0);
|
||||
pince.aspirecoral(0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -11,7 +11,7 @@ import com.ctre.phoenix.led.RainbowAnimation;
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
|
||||
public class Bougie extends SubsystemBase {
|
||||
CANdle candle = new CANdle(23);
|
||||
CANdle candle = new CANdle(5);
|
||||
CANdleConfiguration config = new CANdleConfiguration();
|
||||
RainbowAnimation rainbowAnim = new RainbowAnimation(1, 0.5, 64);
|
||||
/** Creates a new Bougie. */
|
||||
@ -20,29 +20,14 @@ public class Bougie extends SubsystemBase {
|
||||
candle.configAllSettings(config);
|
||||
}
|
||||
public void Rouge() {
|
||||
candle.setLEDs(255, 0, 0,0,8,8);
|
||||
candle.setLEDs(255, 0, 0,0,24,8);
|
||||
candle.setLEDs(255, 0, 0,0,40,8);
|
||||
candle.setLEDs(255, 0, 0,0,56,8);
|
||||
candle.setLEDs(255, 0, 0);
|
||||
}
|
||||
public void Vert() {
|
||||
candle.setLEDs(0, 255, 0,0,8,8);
|
||||
candle.setLEDs(0, 255, 0,0,24,8);
|
||||
candle.setLEDs(0, 255, 0,0,40,8);
|
||||
candle.setLEDs(0, 255, 0,0,56,8);
|
||||
candle.setLEDs(0, 255, 0);
|
||||
}
|
||||
public void Bleu() {
|
||||
candle.setLEDs(0, 0, 255,0,16,8);
|
||||
candle.setLEDs(0, 0, 255,0,32,8);
|
||||
candle.setLEDs(0, 0, 255,0,48,8);
|
||||
candle.setLEDs(0, 0, 255,0,64,8);
|
||||
candle.setLEDs(0, 0, 255);
|
||||
}
|
||||
public void Jaune() {
|
||||
candle.setLEDs(255, 215, 0,0,16,8);
|
||||
candle.setLEDs(255, 215, 0,0,32,8);
|
||||
candle.setLEDs(255, 215, 0,0,48,8);
|
||||
candle.setLEDs(255, 215, 0,0,64,8);
|
||||
}
|
||||
public void RainBow(){candle.animate(rainbowAnim);}
|
||||
public void RainBowStop(){candle.animate(null);}
|
||||
@Override
|
||||
@ -50,3 +35,4 @@ public class Bougie extends SubsystemBase {
|
||||
// This method will be called once per scheduler run
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,37 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.subsystems;
|
||||
|
||||
import edu.wpi.first.networktables.GenericEntry;
|
||||
import edu.wpi.first.wpilibj.DigitalInput;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
import com.revrobotics.spark.SparkMax;
|
||||
import com.revrobotics.spark.SparkLowLevel.MotorType;
|
||||
public class Elevateur extends SubsystemBase {
|
||||
/** Creates a new Elevateur. */
|
||||
public Elevateur() {}
|
||||
final SparkMax monte = new SparkMax(22, MotorType.kBrushless);
|
||||
final DigitalInput limit2 = new DigitalInput(1);
|
||||
GenericEntry teb = Shuffleboard.getTab("teb")
|
||||
.add("elevateur encodeur",position())
|
||||
.getEntry();
|
||||
public double position(){
|
||||
return monte.getEncoder().getPosition();
|
||||
}
|
||||
public void vitesse(double vitesse){
|
||||
monte.set(vitesse);
|
||||
}
|
||||
public boolean limit2(){
|
||||
return limit2.get();
|
||||
}
|
||||
public void reset(){
|
||||
monte.getEncoder().setPosition(0);
|
||||
}
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
}
|
||||
}
|
40
src/main/java/frc/robot/subsystems/Grimpeur.java
Normal file
40
src/main/java/frc/robot/subsystems/Grimpeur.java
Normal file
@ -0,0 +1,40 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.subsystems;
|
||||
|
||||
import com.revrobotics.spark.SparkMax;
|
||||
import com.revrobotics.spark.SparkLowLevel.MotorType;
|
||||
|
||||
import edu.wpi.first.wpilibj.DigitalInput;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
|
||||
public class Grimpeur extends SubsystemBase {
|
||||
/** Creates a new Grimpeur. */
|
||||
ShuffleboardTab teb = Shuffleboard.getTab("teb");
|
||||
public Grimpeur() {
|
||||
teb.addBoolean("limit grimpeur", this::stop);
|
||||
teb.addDouble("encodeur grimpeur", this::encodeur);
|
||||
}
|
||||
final SparkMax grimpeur = new SparkMax(21,MotorType.kBrushless);
|
||||
final DigitalInput limit1 = new DigitalInput(2);
|
||||
public void grimpe(double vitesse){
|
||||
grimpeur.set(vitesse);
|
||||
}
|
||||
public boolean stop(){
|
||||
return limit1.get();
|
||||
}
|
||||
public double encodeur(){
|
||||
return grimpeur.getEncoder().getPosition();
|
||||
}
|
||||
public void reset(){
|
||||
grimpeur.getEncoder().setPosition(0);
|
||||
}
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.subsystems;
|
||||
|
||||
import com.revrobotics.spark.SparkLowLevel.MotorType;
|
||||
import com.revrobotics.spark.SparkMax;
|
||||
|
||||
import edu.wpi.first.networktables.GenericEntry;
|
||||
import edu.wpi.first.wpilibj.DigitalInput;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
|
||||
public class Pince extends SubsystemBase {
|
||||
/** Creates a new Pince. */
|
||||
public Pince() {}
|
||||
final SparkMax coral = new SparkMax(20, MotorType.kBrushless);
|
||||
final SparkMax pivoti = new SparkMax(14, MotorType.kBrushless);
|
||||
final SparkMax algue1 = new SparkMax(16, MotorType.kBrushless);
|
||||
final SparkMax algue2 = new SparkMax(19, MotorType.kBrushless);
|
||||
final DigitalInput limit6 = new DigitalInput(0);
|
||||
GenericEntry teb = Shuffleboard.getTab("teb")
|
||||
.add("pince encodeur",encodeurpivot())
|
||||
.getEntry();
|
||||
public void aspirecoral(double vitesse){
|
||||
coral.set(vitesse);
|
||||
}
|
||||
public void pivote(double vitesse){
|
||||
pivoti.set(vitesse);
|
||||
}
|
||||
public void aspirealgue(double vitesse){
|
||||
algue2.set(vitesse);
|
||||
algue1.set(-vitesse);
|
||||
}
|
||||
public double encodeurpivot(){
|
||||
return pivoti.getEncoder().getPosition();
|
||||
}
|
||||
public boolean position(){
|
||||
return limit6.get();
|
||||
}
|
||||
public void reset(){
|
||||
pivoti.getEncoder().setPosition(0);
|
||||
}
|
||||
public double emperagecoral(){
|
||||
return coral.getOutputCurrent();
|
||||
}
|
||||
public double emperagealgue(){
|
||||
return algue1.getOutputCurrent();
|
||||
}
|
||||
public void algue1Test(double vitesse){
|
||||
algue1.set(vitesse);
|
||||
}
|
||||
public void algue2Test(double vitesse){
|
||||
algue2.set(vitesse);
|
||||
}
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user