This commit is contained in:
Olivier Dubois 2024-11-11 19:12:45 -05:00
commit ab0439e309
10 changed files with 445 additions and 14 deletions

View File

@ -0,0 +1,12 @@
{
"robotWidth": 0.9,
"robotLength": 0.9,
"holonomicMode": true,
"pathFolders": [],
"autoFolders": [],
"defaultMaxVel": 3.0,
"defaultMaxAccel": 3.0,
"defaultMaxAngVel": 540.0,
"defaultMaxAngAccel": 720.0,
"maxModuleSpeed": 4.5
}

View File

@ -0,0 +1,37 @@
{
"version": 1.0,
"startingPose": {
"position": {
"x": 6.5,
"y": 0.9
},
"rotation": 0
},
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Slalum"
}
},
{
"type": "path",
"data": {
"pathName": "L + Ratio"
}
},
{
"type": "path",
"data": {
"pathName": "Tour de la tour (Jeu de mot non voulu)"
}
}
]
}
},
"folder": null,
"choreoAuto": false
}

File diff suppressed because one or more lines are too long

View File

@ -3,25 +3,41 @@
"waypoints": [
{
"anchor": {
"x": 2.0,
"y": 7.0
"x": 6.5,
"y": 0.9
},
"prevControl": null,
"nextControl": {
"x": 3.0,
"y": 7.0
"x": 6.586062320106703,
"y": 4.261103410099197
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 5.9001283880171185,
"y": 2.9171184022824534
"x": 6.632078555636399,
"y": 5.963704124721274
},
"prevControl": {
"x": 4.9001283880171185,
"y": 2.9171184022824534
"x": 6.5812654090653,
"y": 4.2614637146487615
},
"nextControl": {
"x": 6.650485049849024,
"y": 6.580321680822735
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 2.9323732190059952,
"y": 6.267411279220785
},
"prevControl": {
"x": 4.211624566746893,
"y": 6.377850244489728
},
"nextControl": null,
"isLocked": false,
@ -38,14 +54,14 @@
"maxAngularAcceleration": 720.0
},
"goalEndState": {
"velocity": 0,
"rotation": 0,
"velocity": 4.5,
"rotation": 180.0,
"rotateFast": false
},
"reversed": false,
"folder": null,
"previewStartingState": {
"rotation": 0,
"rotation": 180.0,
"velocity": 0
},
"useDefaultConstraints": true

View File

@ -0,0 +1,168 @@
{
"version": 1.0,
"waypoints": [
{
"anchor": {
"x": 6.5,
"y": 0.9
},
"prevControl": null,
"nextControl": {
"x": 7.515590277817328,
"y": 1.3344708303766382
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 9.337833204814393,
"y": 2.3468280120416742
},
"prevControl": {
"x": 9.595524123783674,
"y": 1.831446174103111
},
"nextControl": {
"x": 9.012033057727226,
"y": 2.998428306216007
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.239492864635955,
"y": 4.16907093903874
},
"prevControl": {
"x": 7.285509100166183,
"y": 3.635282606888085
},
"nextControl": {
"x": 7.1872490187780045,
"y": 4.775099550990983
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 8.343882517361449,
"y": 6.506695703974367
},
"prevControl": {
"x": 7.387516553412176,
"y": 6.558192332802404
},
"nextControl": {
"x": 9.5403046411474,
"y": 6.442272974232048
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 9.503491652723216,
"y": 5.9268911362934835
},
"prevControl": {
"x": 9.637145969826634,
"y": 6.280120402923943
},
"nextControl": {
"x": 9.374646193238576,
"y": 5.58637099336979
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 8.14141108102844,
"y": 4.831704730674035
},
"prevControl": {
"x": 9.257085826573364,
"y": 5.268273109365526
},
"nextControl": {
"x": 6.448013613516017,
"y": 4.16907093903874
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.5,
"y": 0.9
},
"prevControl": {
"x": 6.484826601940201,
"y": 2.4020474946779493
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 1.45,
"rotationDegrees": 63.44712332687376,
"rotateFast": false
},
{
"waypointRelativePos": 2,
"rotationDegrees": 4.763641690726149,
"rotateFast": false
},
{
"waypointRelativePos": 0.5499999999999999,
"rotationDegrees": 20.153417368512876,
"rotateFast": false
},
{
"waypointRelativePos": 5,
"rotationDegrees": -61.03233935393599,
"rotateFast": false
},
{
"waypointRelativePos": 5.1,
"rotationDegrees": -49.47054707781578,
"rotateFast": false
},
{
"waypointRelativePos": 2.65,
"rotationDegrees": -20.732131564200795,
"rotateFast": false
},
{
"waypointRelativePos": 3.0,
"rotationDegrees": -85.54439716667379,
"rotateFast": false
}
],
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
"goalEndState": {
"velocity": 0.0,
"rotation": 180.0,
"rotateFast": false
},
"reversed": false,
"folder": null,
"previewStartingState": {
"rotation": 0,
"velocity": 0.0
},
"useDefaultConstraints": true
}

View File

@ -0,0 +1,126 @@
{
"version": 1.0,
"waypoints": [
{
"anchor": {
"x": 2.93,
"y": 6.27
},
"prevControl": null,
"nextControl": {
"x": 1.5702926473117529,
"y": 6.000517113141849
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 2.0856744852503164,
"y": 4.095444962190373
},
"prevControl": {
"x": 1.5702926473117529,
"y": 6.028126854459987
},
"nextControl": {
"x": 2.327736371101423,
"y": 3.187712890248723
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.96339545145325,
"y": 2.089137093076611
},
"prevControl": {
"x": 5.7311425984202575,
"y": 1.116305893313723
},
"nextControl": {
"x": 7.487980536497859,
"y": 2.50328321284867
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.282355165607193,
"y": 6.138565819732537
},
"prevControl": {
"x": 6.7057045324852975,
"y": 5.908484642081393
},
"nextControl": {
"x": 5.508568923092858,
"y": 6.5591018210990235
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 2.93,
"y": 6.27
},
"prevControl": {
"x": 4.469315485716174,
"y": 6.699963893201328
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 0.95,
"rotationDegrees": -77.06357086531585,
"rotateFast": false
},
{
"waypointRelativePos": 1.25,
"rotationDegrees": -12.0,
"rotateFast": false
},
{
"waypointRelativePos": 1.65,
"rotationDegrees": -12.0,
"rotateFast": false
},
{
"waypointRelativePos": 2.8,
"rotationDegrees": 121.86757878185286,
"rotateFast": false
},
{
"waypointRelativePos": 3.9,
"rotationDegrees": -168.7809809013034,
"rotateFast": false
}
],
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
"goalEndState": {
"velocity": 0,
"rotation": 180.0,
"rotateFast": false
},
"reversed": false,
"folder": null,
"previewStartingState": {
"rotation": 180.0,
"velocity": 0
},
"useDefaultConstraints": true
}

View File

@ -5,12 +5,12 @@
},
"absoluteEncoderOffset": 5.537,
"drive": {
"type": "sparkmax",
"type": "talonFX",
"id": 11,
"canbus": null
},
"angle": {
"type": "sparkmax",
"type": "talonFX",
"id": 12,
"canbus": null
},

View File

@ -0,0 +1,48 @@
// 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.Accumulateur;
import frc.robot.Subsystems.LED;
public class LEDactive extends Command {
private Accumulateur accumulateur;
private LED led;
/** Creates a new LEDactive. */
public LEDactive(Accumulateur accumulateur, LED led) {
this.accumulateur = accumulateur;
this.led = led;
addRequirements(accumulateur,led);
// 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(accumulateur.photocell())
led.led(0, 255, 0);
else{
led.led(25, 25, 100);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
led.led(25, 25, 100);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,22 @@
// 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.ctre.phoenix.led.CANdle;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class LED extends SubsystemBase {
/** Creates a new LED. */
public LED() {}
CANdle led = new CANdle(0);
public void led(int R, int G, int B){
led.setLEDs(R, G, B);
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}