jgghdfn
This commit is contained in:
37
src/main/java/frc/robot/commands/bras/BrasManuel.java
Normal file
37
src/main/java/frc/robot/commands/bras/BrasManuel.java
Normal file
@ -0,0 +1,37 @@
|
||||
// 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.bras;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.CommandBase;
|
||||
import frc.robot.subsystems.bras.BrasTelescopique;
|
||||
|
||||
public class BrasManuel extends CommandBase {
|
||||
private BrasTelescopique brasTelescopique;
|
||||
/** Creates a new BrasManuel. */
|
||||
public BrasManuel(BrasTelescopique brasTelescopique) {
|
||||
this.brasTelescopique = brasTelescopique;
|
||||
// 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() {
|
||||
brasTelescopique.AvanceRecule(0.3);
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
@ -22,38 +22,37 @@ public class PivotBrasRentre extends CommandBase {
|
||||
|
||||
// Called when the command is initially scheduled.
|
||||
@Override
|
||||
public void initialize() {}
|
||||
public void initialize() {
|
||||
brasTelescopique.fermer();
|
||||
}
|
||||
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
if(brasTelescopique.distance()>1){
|
||||
brasTelescopique.AvanceRecule(0.5);
|
||||
brasTelescopique.fermer();
|
||||
}
|
||||
if (pivot.distance()>1){
|
||||
pivot.monteDescendre(0.5);
|
||||
}
|
||||
else if(brasTelescopique.photocell()){
|
||||
if(brasTelescopique.photocell()){
|
||||
brasTelescopique.ouvrir();
|
||||
brasTelescopique.Reset();
|
||||
brasTelescopique.AvanceRecule(0);
|
||||
brasTelescopique.ouvrir();
|
||||
}
|
||||
else{
|
||||
brasTelescopique.AvanceRecule(0.5);
|
||||
}
|
||||
if(pivot.limitpivot()){
|
||||
if(pivot.limitpivot()){
|
||||
pivot.Reset();
|
||||
pivot.monteDescendre(0);
|
||||
}
|
||||
else{
|
||||
pivot.monteDescendre(0.5);
|
||||
pivot.monteDescendre(-0.3);
|
||||
}
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {}
|
||||
public void end(boolean interrupted) {
|
||||
brasTelescopique.AvanceRecule(0);
|
||||
pivot.monteDescendre(0);
|
||||
brasTelescopique.ouvrir();
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
|
@ -22,27 +22,29 @@ public class PivotChercheBas extends CommandBase {
|
||||
|
||||
// Called when the command is initially scheduled.
|
||||
@Override
|
||||
public void initialize() {}
|
||||
public void initialize() {
|
||||
brasTelescopique.fermer();
|
||||
}
|
||||
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
if(brasTelescopique.distance()<10){
|
||||
brasTelescopique.AvanceRecule(0.5);
|
||||
if(brasTelescopique.distance()>-17.5){
|
||||
brasTelescopique.AvanceRecule(-0.2);
|
||||
brasTelescopique.fermer();
|
||||
}
|
||||
else if(brasTelescopique.distance()>11) {
|
||||
brasTelescopique.AvanceRecule(-0.5);
|
||||
else if(brasTelescopique.distance()<-19.5) {
|
||||
brasTelescopique.AvanceRecule(0.2);
|
||||
}
|
||||
else {
|
||||
brasTelescopique.AvanceRecule(0);
|
||||
brasTelescopique.ouvrir();
|
||||
}
|
||||
if (pivot.distance()<10){
|
||||
pivot.monteDescendre(0.5);
|
||||
if (pivot.distance()<8.5){
|
||||
pivot.monteDescendre(0.3);
|
||||
}
|
||||
else if(pivot.distance()>11) {
|
||||
pivot.monteDescendre(-0.5);
|
||||
else if(pivot.distance()>10.5) {
|
||||
pivot.monteDescendre(-0.3);
|
||||
}
|
||||
else{
|
||||
pivot.monteDescendre(0);
|
||||
@ -51,7 +53,11 @@ public class PivotChercheBas extends CommandBase {
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {}
|
||||
public void end(boolean interrupted) {
|
||||
brasTelescopique.AvanceRecule(0);
|
||||
pivot.monteDescendre(0);
|
||||
brasTelescopique.fermer();
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
|
@ -22,27 +22,26 @@ public class PivotChercheHaut extends CommandBase {
|
||||
|
||||
// Called when the command is initially scheduled.
|
||||
@Override
|
||||
public void initialize() {}
|
||||
public void initialize() {
|
||||
brasTelescopique.fermer();
|
||||
}
|
||||
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
if(brasTelescopique.distance()<10){
|
||||
brasTelescopique.AvanceRecule(0.5);
|
||||
brasTelescopique.fermer();
|
||||
}
|
||||
else if(brasTelescopique.distance()>11) {
|
||||
brasTelescopique.AvanceRecule(-0.5);
|
||||
}
|
||||
else {
|
||||
brasTelescopique.AvanceRecule(0);
|
||||
if(brasTelescopique.photocell()){
|
||||
brasTelescopique.ouvrir();
|
||||
brasTelescopique.Reset();
|
||||
brasTelescopique.AvanceRecule(0);
|
||||
}
|
||||
else{
|
||||
brasTelescopique.AvanceRecule(0.3);
|
||||
}
|
||||
if (pivot.distance()<10){
|
||||
pivot.monteDescendre(0.5);
|
||||
if (pivot.distance()<43.5){
|
||||
pivot.monteDescendre(0.4);
|
||||
}
|
||||
else if(pivot.distance()>11) {
|
||||
pivot.monteDescendre(-0.5);
|
||||
else if(pivot.distance()>44.5) {
|
||||
pivot.monteDescendre(-0.4);
|
||||
}
|
||||
else{
|
||||
pivot.monteDescendre(0);
|
||||
@ -51,7 +50,11 @@ public class PivotChercheHaut extends CommandBase {
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {}
|
||||
public void end(boolean interrupted) {
|
||||
brasTelescopique.AvanceRecule(0);
|
||||
pivot.monteDescendre(0);
|
||||
brasTelescopique.ouvrir();
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
|
38
src/main/java/frc/robot/commands/bras/PivotManuel.java
Normal file
38
src/main/java/frc/robot/commands/bras/PivotManuel.java
Normal file
@ -0,0 +1,38 @@
|
||||
// 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.bras;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.CommandBase;
|
||||
import frc.robot.subsystems.bras.Pivot;
|
||||
|
||||
public class PivotManuel extends CommandBase {
|
||||
private Pivot pivot;
|
||||
/** Creates a new PivotManuel. */
|
||||
public PivotManuel(Pivot pivot) {
|
||||
this.pivot = pivot;
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
addRequirements(pivot);
|
||||
}
|
||||
|
||||
// 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() {
|
||||
pivot.monteDescendre(0.3);
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
@ -24,27 +24,29 @@ public class PivoteBrasBas extends CommandBase {
|
||||
|
||||
// Called when the command is initially scheduled.
|
||||
@Override
|
||||
public void initialize() {}
|
||||
public void initialize() {
|
||||
brasTelescopique.fermer();
|
||||
}
|
||||
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
if(brasTelescopique.distance()<10){
|
||||
brasTelescopique.AvanceRecule(0.5);
|
||||
if(brasTelescopique.distance()>-13.5){
|
||||
brasTelescopique.AvanceRecule(-0.2);
|
||||
brasTelescopique.fermer();
|
||||
}
|
||||
else if(brasTelescopique.distance()>11) {
|
||||
brasTelescopique.AvanceRecule(-0.5);
|
||||
else if(brasTelescopique.distance()<-15.5) {
|
||||
brasTelescopique.AvanceRecule(0.2);
|
||||
}
|
||||
else {
|
||||
brasTelescopique.AvanceRecule(0);
|
||||
brasTelescopique.ouvrir();
|
||||
}
|
||||
if (pivot.distance()<10){
|
||||
pivot.monteDescendre(0.5);
|
||||
if (pivot.distance()<8.5){
|
||||
pivot.monteDescendre(0.3);
|
||||
}
|
||||
else if(pivot.distance()>11) {
|
||||
pivot.monteDescendre(-0.5);
|
||||
else if(pivot.distance()>10.5) {
|
||||
pivot.monteDescendre(-0.3);
|
||||
}
|
||||
else{
|
||||
pivot.monteDescendre(0);
|
||||
@ -55,7 +57,11 @@ public class PivoteBrasBas extends CommandBase {
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {}
|
||||
public void end(boolean interrupted) {
|
||||
brasTelescopique.AvanceRecule(0);
|
||||
pivot.monteDescendre(0);
|
||||
brasTelescopique.ouvrir();
|
||||
}
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
|
@ -22,27 +22,29 @@ public class PivoteBrasHaut extends CommandBase {
|
||||
|
||||
// Called when the command is initially scheduled.
|
||||
@Override
|
||||
public void initialize() {}
|
||||
public void initialize() {
|
||||
brasTelescopique.fermer();
|
||||
}
|
||||
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
if(brasTelescopique.distance()<10){
|
||||
brasTelescopique.AvanceRecule(0.5);
|
||||
if(brasTelescopique.distance()>-39.5){
|
||||
brasTelescopique.AvanceRecule(-0.15);
|
||||
brasTelescopique.fermer();
|
||||
}
|
||||
else if(brasTelescopique.distance()>11) {
|
||||
brasTelescopique.AvanceRecule(-0.5);
|
||||
else if(brasTelescopique.distance()<41.5) {
|
||||
brasTelescopique.AvanceRecule(-0.15);
|
||||
}
|
||||
else {
|
||||
brasTelescopique.AvanceRecule(0);
|
||||
brasTelescopique.ouvrir();
|
||||
}
|
||||
if (pivot.distance()<10){
|
||||
pivot.monteDescendre(0.5);
|
||||
if (pivot.distance()<50.5){
|
||||
pivot.monteDescendre(0.4);
|
||||
}
|
||||
else if(pivot.distance()>11) {
|
||||
pivot.monteDescendre(-0.5);
|
||||
else if(pivot.distance()>52.5) {
|
||||
pivot.monteDescendre(-0.4);
|
||||
}
|
||||
else{
|
||||
pivot.monteDescendre(0);
|
||||
@ -51,7 +53,11 @@ public class PivoteBrasHaut extends CommandBase {
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {}
|
||||
public void end(boolean interrupted) {
|
||||
brasTelescopique.AvanceRecule(0);
|
||||
pivot.monteDescendre(0);
|
||||
brasTelescopique.ouvrir();
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
|
@ -22,27 +22,29 @@ public class PivoteBrasMilieux extends CommandBase {
|
||||
|
||||
// Called when the command is initially scheduled.
|
||||
@Override
|
||||
public void initialize() {}
|
||||
public void initialize() {
|
||||
brasTelescopique.fermer();
|
||||
}
|
||||
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
if(brasTelescopique.distance()<10){
|
||||
brasTelescopique.AvanceRecule(0.5);
|
||||
if(brasTelescopique.distance()>-16.5){
|
||||
brasTelescopique.AvanceRecule(-0.2);
|
||||
brasTelescopique.fermer();
|
||||
}
|
||||
else if(brasTelescopique.distance()>11) {
|
||||
brasTelescopique.AvanceRecule(-0.5);
|
||||
else if(brasTelescopique.distance()<-17.5) {
|
||||
brasTelescopique.AvanceRecule(0.2);
|
||||
}
|
||||
else {
|
||||
brasTelescopique.AvanceRecule(0);
|
||||
brasTelescopique.ouvrir();
|
||||
}
|
||||
if (pivot.distance()<10){
|
||||
pivot.monteDescendre(0.5);
|
||||
if (pivot.distance()<43.5){
|
||||
pivot.monteDescendre(0.4);
|
||||
}
|
||||
else if(pivot.distance()>11) {
|
||||
pivot.monteDescendre(-0.5);
|
||||
else if(pivot.distance()>44.5) {
|
||||
pivot.monteDescendre(-0.4);
|
||||
}
|
||||
else{
|
||||
pivot.monteDescendre(0);
|
||||
@ -52,7 +54,11 @@ public class PivoteBrasMilieux extends CommandBase {
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {}
|
||||
public void end(boolean interrupted) {
|
||||
brasTelescopique.AvanceRecule(0);
|
||||
pivot.monteDescendre(0);
|
||||
brasTelescopique.ouvrir();
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user