Merge branch 'master' of https://git.demerso.net/pls5618/2024/betabot-2024
This commit is contained in:
commit
6fab163a72
@ -88,5 +88,10 @@
|
||||
"buttonCount": 0,
|
||||
"povCount": 0
|
||||
}
|
||||
],
|
||||
"robotJoysticks": [
|
||||
{
|
||||
"guid": "030000006d04000015c2000000000000"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
11
simgui.json
11
simgui.json
@ -1,7 +1,16 @@
|
||||
{
|
||||
"NTProvider": {
|
||||
"types": {
|
||||
"/FMSInfo": "FMSInfo"
|
||||
"/FMSInfo": "FMSInfo",
|
||||
"/SmartDashboard/Field": "Field2d",
|
||||
"/SmartDashboard/navX-Sensor[1]": "Gyro"
|
||||
},
|
||||
"windows": {
|
||||
"/SmartDashboard/Field": {
|
||||
"window": {
|
||||
"visible": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,17 +6,17 @@
|
||||
"absoluteEncoderOffset": 0,
|
||||
"drive": {
|
||||
"type": "sparkmax",
|
||||
"id": 0,
|
||||
"id": 8,
|
||||
"canbus": null
|
||||
},
|
||||
"angle": {
|
||||
"type": "sparkmax",
|
||||
"id": 0,
|
||||
"id": 9,
|
||||
"canbus": null
|
||||
},
|
||||
"encoder": {
|
||||
"type": "cancoder",
|
||||
"id": 0,
|
||||
"id": 22,
|
||||
"canbus": null
|
||||
},
|
||||
"inverted": {
|
||||
|
@ -6,17 +6,17 @@
|
||||
"absoluteEncoderOffset": 0,
|
||||
"drive": {
|
||||
"type": "sparkmax",
|
||||
"id": 0,
|
||||
"id": 11,
|
||||
"canbus": null
|
||||
},
|
||||
"angle": {
|
||||
"type": "sparkmax",
|
||||
"id": 0,
|
||||
"id": 12,
|
||||
"canbus": null
|
||||
},
|
||||
"encoder": {
|
||||
"type": "cancoder",
|
||||
"id": 0,
|
||||
"id": 22,
|
||||
"canbus": null
|
||||
},
|
||||
"inverted": {
|
||||
|
@ -11,12 +11,12 @@
|
||||
},
|
||||
"angle": {
|
||||
"type": "sparkmax",
|
||||
"id": 0,
|
||||
"id": 1,
|
||||
"canbus": null
|
||||
},
|
||||
"encoder": {
|
||||
"type": "cancoder",
|
||||
"id": 0,
|
||||
"id": 22,
|
||||
"canbus": null
|
||||
},
|
||||
"inverted": {
|
||||
|
@ -6,17 +6,17 @@
|
||||
"absoluteEncoderOffset": 0,
|
||||
"drive": {
|
||||
"type": "sparkmax",
|
||||
"id": 0,
|
||||
"id": 17,
|
||||
"canbus": null
|
||||
},
|
||||
"angle": {
|
||||
"type": "sparkmax",
|
||||
"id": 0,
|
||||
"id": 18,
|
||||
"canbus": null
|
||||
},
|
||||
"encoder": {
|
||||
"type": "cancoder",
|
||||
"id": 0,
|
||||
"id": 22,
|
||||
"canbus": null
|
||||
},
|
||||
"inverted": {
|
||||
|
@ -3,26 +3,32 @@
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot;
|
||||
|
||||
import edu.wpi.first.wpilibj.Joystick;
|
||||
import edu.wpi.first.wpilibj.XboxController;
|
||||
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 edu.wpi.first.wpilibj2.command.button.JoystickButton;
|
||||
import frc.robot.subsystems.Drive;
|
||||
|
||||
public class RobotContainer {
|
||||
CommandXboxController manette1 = new CommandXboxController(0);
|
||||
CommandXboxController manette2 = new CommandXboxController(0);
|
||||
CommandXboxController manette = new CommandXboxController(0);
|
||||
Joystick joystick1 = new Joystick(0);
|
||||
Drive drive = new Drive();
|
||||
public RobotContainer() {
|
||||
configureBindings();
|
||||
// drive.setDefaultCommand(new RunCommand(()->{
|
||||
// drive.drive(manette.getLeftX(), manette.getLeftY(), manette.getRightX());
|
||||
//},drive));
|
||||
drive.setDefaultCommand(new RunCommand(()->{
|
||||
drive.drive(manette1.getLeftX(), manette1.getLeftY(), manette1.getRightX());
|
||||
drive.drive(joystick1.getX(), -joystick1.getY(), -joystick1.getZ());
|
||||
},drive));
|
||||
}
|
||||
|
||||
private void configureBindings() {}
|
||||
private void configureBindings() {
|
||||
JoystickButton button =new JoystickButton(joystick1, 1);
|
||||
}
|
||||
|
||||
public Command getAutonomousCommand() {
|
||||
return Commands.print("No autonomous command configured");
|
||||
|
23
src/main/java/frc/robot/commands/Accumuler.java
Normal file
23
src/main/java/frc/robot/commands/Accumuler.java
Normal file
@ -0,0 +1,23 @@
|
||||
// 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.SequentialCommandGroup;
|
||||
import frc.robot.subsystems.Accumulateur;
|
||||
import frc.robot.subsystems.Lanceur;
|
||||
|
||||
|
||||
// NOTE: Consider using this command inline, rather than writing a subclass. For more
|
||||
// information, see:
|
||||
// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html
|
||||
public class Accumuler extends SequentialCommandGroup {
|
||||
|
||||
public void Accumuler(Accumulateur accumulateur) {
|
||||
// Add your commands in the addCommands() call, e.g.
|
||||
// addCommands(new FooCommand(), new BarCommand());
|
||||
addCommands(new Deaccumuler(accumulateur), new Reaccumuler(accumulateur));
|
||||
|
||||
}
|
||||
}
|
@ -39,6 +39,6 @@ public class Lancer extends CommandBase {
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
return lanceur.distance()>1;
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ public class Drive extends SubsystemBase {
|
||||
File swerveJsonDirectory = new File(Filesystem.getDeployDirectory(),"swerve");
|
||||
|
||||
public void drive(double x, double y, double zRotation){
|
||||
swerveDrive.drive(new Translation2d(x, y), zRotation, true, true);
|
||||
swerveDrive.drive(new Translation2d(x, y), zRotation, true, false);
|
||||
}
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@ public class Lanceur extends SubsystemBase {
|
||||
}
|
||||
|
||||
// encodeur
|
||||
public double vitesse() {
|
||||
public double distance() {
|
||||
return(lanceur.getEncoder().getPosition());
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user