Merge branch 'main' of https://git.demerso.net/pls5618/2024/robot
This commit is contained in:
		
							
								
								
									
										16
									
								
								.pathplanner/settings.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								.pathplanner/settings.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | |||||||
|  | { | ||||||
|  |   "robotWidth": 0.9, | ||||||
|  |   "robotLength": 0.9, | ||||||
|  |   "holonomicMode": true, | ||||||
|  |   "pathFolders": [ | ||||||
|  |     "1" | ||||||
|  |   ], | ||||||
|  |   "autoFolders": [ | ||||||
|  |     "1" | ||||||
|  |   ], | ||||||
|  |   "defaultMaxVel": 3.0, | ||||||
|  |   "defaultMaxAccel": 3.0, | ||||||
|  |   "defaultMaxAngVel": 540.0, | ||||||
|  |   "defaultMaxAngAccel": 720.0, | ||||||
|  |   "maxModuleSpeed": 4.5 | ||||||
|  | } | ||||||
							
								
								
									
										31
									
								
								src/main/deploy/pathplanner/autos/1.auto
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								src/main/deploy/pathplanner/autos/1.auto
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | |||||||
|  | { | ||||||
|  |   "version": 1.0, | ||||||
|  |   "startingPose": { | ||||||
|  |     "position": { | ||||||
|  |       "x": 1.3, | ||||||
|  |       "y": 5.55 | ||||||
|  |     }, | ||||||
|  |     "rotation": 180.0 | ||||||
|  |   }, | ||||||
|  |   "command": { | ||||||
|  |     "type": "sequential", | ||||||
|  |     "data": { | ||||||
|  |       "commands": [ | ||||||
|  |         { | ||||||
|  |           "type": "path", | ||||||
|  |           "data": { | ||||||
|  |             "pathName": "1.1" | ||||||
|  |           } | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |           "type": "path", | ||||||
|  |           "data": { | ||||||
|  |             "pathName": "1.2" | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |       ] | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   "folder": "1", | ||||||
|  |   "choreoAuto": false | ||||||
|  | } | ||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										49
									
								
								src/main/deploy/pathplanner/paths/1.1.path
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								src/main/deploy/pathplanner/paths/1.1.path
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | |||||||
|  | { | ||||||
|  |   "version": 1.0, | ||||||
|  |   "waypoints": [ | ||||||
|  |     { | ||||||
|  |       "anchor": { | ||||||
|  |         "x": 1.3, | ||||||
|  |         "y": 5.55 | ||||||
|  |       }, | ||||||
|  |       "prevControl": null, | ||||||
|  |       "nextControl": { | ||||||
|  |         "x": 1.2733425960299216, | ||||||
|  |         "y": 5.55 | ||||||
|  |       }, | ||||||
|  |       "isLocked": false, | ||||||
|  |       "linkedName": null | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |       "anchor": { | ||||||
|  |         "x": 2.59859163592971, | ||||||
|  |         "y": 5.55 | ||||||
|  |       }, | ||||||
|  |       "prevControl": { | ||||||
|  |         "x": 2.534011049823752, | ||||||
|  |         "y": 5.55 | ||||||
|  |       }, | ||||||
|  |       "nextControl": null, | ||||||
|  |       "isLocked": false, | ||||||
|  |       "linkedName": null | ||||||
|  |     } | ||||||
|  |   ], | ||||||
|  |   "rotationTargets": [], | ||||||
|  |   "constraintZones": [], | ||||||
|  |   "eventMarkers": [], | ||||||
|  |   "globalConstraints": { | ||||||
|  |     "maxVelocity": 3.0, | ||||||
|  |     "maxAcceleration": 3.0, | ||||||
|  |     "maxAngularVelocity": 540.0, | ||||||
|  |     "maxAngularAcceleration": 720.0 | ||||||
|  |   }, | ||||||
|  |   "goalEndState": { | ||||||
|  |     "velocity": 0, | ||||||
|  |     "rotation": -179.1243356864854, | ||||||
|  |     "rotateFast": false | ||||||
|  |   }, | ||||||
|  |   "reversed": false, | ||||||
|  |   "folder": "1", | ||||||
|  |   "previewStartingState": null, | ||||||
|  |   "useDefaultConstraints": false | ||||||
|  | } | ||||||
							
								
								
									
										49
									
								
								src/main/deploy/pathplanner/paths/1.2.path
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								src/main/deploy/pathplanner/paths/1.2.path
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | |||||||
|  | { | ||||||
|  |   "version": 1.0, | ||||||
|  |   "waypoints": [ | ||||||
|  |     { | ||||||
|  |       "anchor": { | ||||||
|  |         "x": 2.6, | ||||||
|  |         "y": 5.55 | ||||||
|  |       }, | ||||||
|  |       "prevControl": null, | ||||||
|  |       "nextControl": { | ||||||
|  |         "x": 2.6266574039700785, | ||||||
|  |         "y": 5.55 | ||||||
|  |       }, | ||||||
|  |       "isLocked": false, | ||||||
|  |       "linkedName": null | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |       "anchor": { | ||||||
|  |         "x": 1.3, | ||||||
|  |         "y": 5.55 | ||||||
|  |       }, | ||||||
|  |       "prevControl": { | ||||||
|  |         "x": 1.2354194138940418, | ||||||
|  |         "y": 5.55 | ||||||
|  |       }, | ||||||
|  |       "nextControl": null, | ||||||
|  |       "isLocked": false, | ||||||
|  |       "linkedName": null | ||||||
|  |     } | ||||||
|  |   ], | ||||||
|  |   "rotationTargets": [], | ||||||
|  |   "constraintZones": [], | ||||||
|  |   "eventMarkers": [], | ||||||
|  |   "globalConstraints": { | ||||||
|  |     "maxVelocity": 3.0, | ||||||
|  |     "maxAcceleration": 3.0, | ||||||
|  |     "maxAngularVelocity": 540.0, | ||||||
|  |     "maxAngularAcceleration": 720.0 | ||||||
|  |   }, | ||||||
|  |   "goalEndState": { | ||||||
|  |     "velocity": 0, | ||||||
|  |     "rotation": -179.1243356864854, | ||||||
|  |     "rotateFast": false | ||||||
|  |   }, | ||||||
|  |   "reversed": false, | ||||||
|  |   "folder": "1", | ||||||
|  |   "previewStartingState": null, | ||||||
|  |   "useDefaultConstraints": false | ||||||
|  | } | ||||||
| @@ -17,10 +17,8 @@ public class Accumulateur extends SubsystemBase { | |||||||
|   final WPI_TalonSRX Moteuracc2 = new WPI_TalonSRX(Constants.Moteuracc2); |   final WPI_TalonSRX Moteuracc2 = new WPI_TalonSRX(Constants.Moteuracc2); | ||||||
|   final WPI_TalonSRX Moteuracc = new WPI_TalonSRX(Constants.Moteuracc); |   final WPI_TalonSRX Moteuracc = new WPI_TalonSRX(Constants.Moteuracc); | ||||||
|   final DigitalInput limitacc = new DigitalInput(0); |   final DigitalInput limitacc = new DigitalInput(0); | ||||||
|    |   public void Deaccumuler(double vitesse){Moteuracc2.set(vitesse);} | ||||||
|   public void Deaccumuler(double vitesse){ |   public void moteuraccfollow(){Moteuracc.follow(Moteuracc2); Moteuracc.setInverted(true);} | ||||||
|     Moteuracc2.set(vitesse);} |  | ||||||
|    |  | ||||||
|  |  | ||||||
|   @Override |   @Override | ||||||
|   public void periodic() { |   public void periodic() { | ||||||
|   | |||||||
| @@ -18,11 +18,9 @@ public class Grimpeur extends SubsystemBase { | |||||||
|   public Grimpeur() {} |   public Grimpeur() {} | ||||||
|   final CANSparkMax grimpeurd = new CANSparkMax(Constants.grimpeurd,MotorType.kBrushless); |   final CANSparkMax grimpeurd = new CANSparkMax(Constants.grimpeurd,MotorType.kBrushless); | ||||||
|   final CANSparkMax grimpeurg = new CANSparkMax(Constants.grimpeurg,MotorType.kBrushless);  |   final CANSparkMax grimpeurg = new CANSparkMax(Constants.grimpeurg,MotorType.kBrushless);  | ||||||
|  |  | ||||||
|   // limit switch |   // limit switch | ||||||
|   final DigitalInput limitdroite = new DigitalInput(Constants.limithaut); |   final DigitalInput limitdroite = new DigitalInput(Constants.limithaut); | ||||||
|   final DigitalInput limitgauche = new DigitalInput(Constants.limitbas); |   final DigitalInput limitgauche = new DigitalInput(Constants.limitbas); | ||||||
|  |  | ||||||
|   //fonction |   //fonction | ||||||
| public void droit(double vitesse){ | public void droit(double vitesse){ | ||||||
|   grimpeurd.set(vitesse); |   grimpeurd.set(vitesse); | ||||||
| @@ -42,14 +40,10 @@ public void resetencodeurd(){ | |||||||
| public void resetencodeurg(){ | public void resetencodeurg(){ | ||||||
|   grimpeurg.getEncoder().setPosition(0); |   grimpeurg.getEncoder().setPosition(0); | ||||||
| } | } | ||||||
| public void grimpeur(){ |  | ||||||
|   grimpeurg.follow(grimpeurd); |  | ||||||
| } |  | ||||||
| public AHRS gyroscope = new AHRS(); | public AHRS gyroscope = new AHRS(); | ||||||
|   public double getpitch(){ |   public double getpitch(){ | ||||||
|     return gyroscope.getPitch(); |     return gyroscope.getPitch(); | ||||||
|   } |   } | ||||||
|    |  | ||||||
|   @Override |   @Override | ||||||
|   public void periodic() { |   public void periodic() { | ||||||
|     // This method will be called once per scheduler run |     // This method will be called once per scheduler run | ||||||
|   | |||||||
							
								
								
									
										18
									
								
								src/main/java/frc/robot/subsystem/Pixy.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/main/java/frc/robot/subsystem/Pixy.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | |||||||
|  | // 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.subsystem; | ||||||
|  |  | ||||||
|  | import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||||||
|  |  | ||||||
|  | public class Pixy extends SubsystemBase { | ||||||
|  |    | ||||||
|  |   /** Creates a new Pixy. */ | ||||||
|  |   public Pixy() {} | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public void periodic() { | ||||||
|  |     // This method will be called once per scheduler run | ||||||
|  |   } | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user