Compare commits
	
		
			68 Commits
		
	
	
		
			Lanceur
			...
			015fec18d2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 015fec18d2 | ||
|  | d524a87319 | ||
|  | f06c9b0428 | ||
|  | 7b460fa3de | ||
|  | 908c5d0b96 | ||
|  | 46a71c5fba | ||
|  | a45f27eb7f | ||
| 2b35ef9267 | |||
| b070971185 | |||
|  | 2ca57f2556 | ||
|  | 144c9a1d71 | ||
|  | 368948b2aa | ||
|  | f7e38ca9bc | ||
|  | 1367087b14 | ||
|  | e7be2d6428 | ||
|  | 437bf16505 | ||
|  | c22c507da0 | ||
| a11b463cc2 | |||
| 910caa963e | |||
| bf63394d77 | |||
|  | 954c82a7a0 | ||
|  | 0063ce1722 | ||
|  | 810ea210b1 | ||
|  | b8894d4efd | ||
|  | 4197299808 | ||
|  | bdbcf2e38f | ||
|  | 0e4efef6ee | ||
|  | d0137d1531 | ||
| 8d93e7f24f | |||
| 4ece413126 | |||
|  | f1406f0db0 | ||
|  | 9804a3cfbf | ||
|  | 9f51699e35 | ||
|  | 1c1e8fb714 | ||
|  | 104c9195bc | ||
|  | 205da73570 | ||
| 1989806378 | |||
| fd72aaf8bd | |||
|  | 99525dc7d7 | ||
|  | 2533a3a462 | ||
|  | ed5d3bc08b | ||
|  | e9f55c9fd6 | ||
| bde1715f76 | |||
|  | 48a4f2e0f4 | ||
|  | fc75e1f997 | ||
|  | d6508d513b | ||
| 1a899887da | |||
| 7e65352246 | |||
|  | ee263139c1 | ||
|  | 938198d4e2 | ||
|  | b460501b95 | ||
|  | 5e39e6fc4d | ||
|  | 6bec6011ca | ||
| e1111511b7 | |||
| c3d4b8c43c | |||
| 4944f4662b | |||
|  | 4f6552202c | ||
|  | adb6d5554f | ||
| eca7bb1891 | |||
| 6687dc73ea | |||
|  | ea96a16864 | ||
|  | dfa05d79a7 | ||
| 650e8341ec | |||
|  | 025d9e47f0 | ||
| f0cdb9a241 | |||
| ae9e9577c2 | |||
|  | 89d155ae5e | ||
|  | 787251658c | 
							
								
								
									
										12
									
								
								.pathplanner/settings.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								.pathplanner/settings.json
									
									
									
									
									
										Normal 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 | ||||||
|  | } | ||||||
| @@ -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 | ||||||
|  | } | ||||||
							
								
								
									
										3
									
								
								src/main/deploy/pathplanner/navgrid.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/main/deploy/pathplanner/navgrid.json
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										68
									
								
								src/main/deploy/pathplanner/paths/L + Ratio.path
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								src/main/deploy/pathplanner/paths/L + Ratio.path
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,68 @@ | |||||||
|  | { | ||||||
|  |   "version": 1.0, | ||||||
|  |   "waypoints": [ | ||||||
|  |     { | ||||||
|  |       "anchor": { | ||||||
|  |         "x": 6.5, | ||||||
|  |         "y": 0.9 | ||||||
|  |       }, | ||||||
|  |       "prevControl": null, | ||||||
|  |       "nextControl": { | ||||||
|  |         "x": 6.586062320106703, | ||||||
|  |         "y": 4.261103410099197 | ||||||
|  |       }, | ||||||
|  |       "isLocked": false, | ||||||
|  |       "linkedName": null | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |       "anchor": { | ||||||
|  |         "x": 6.632078555636399, | ||||||
|  |         "y": 5.963704124721274 | ||||||
|  |       }, | ||||||
|  |       "prevControl": { | ||||||
|  |         "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, | ||||||
|  |       "linkedName": null | ||||||
|  |     } | ||||||
|  |   ], | ||||||
|  |   "rotationTargets": [], | ||||||
|  |   "constraintZones": [], | ||||||
|  |   "eventMarkers": [], | ||||||
|  |   "globalConstraints": { | ||||||
|  |     "maxVelocity": 3.0, | ||||||
|  |     "maxAcceleration": 3.0, | ||||||
|  |     "maxAngularVelocity": 540.0, | ||||||
|  |     "maxAngularAcceleration": 720.0 | ||||||
|  |   }, | ||||||
|  |   "goalEndState": { | ||||||
|  |     "velocity": 4.5, | ||||||
|  |     "rotation": 180.0, | ||||||
|  |     "rotateFast": false | ||||||
|  |   }, | ||||||
|  |   "reversed": false, | ||||||
|  |   "folder": null, | ||||||
|  |   "previewStartingState": { | ||||||
|  |     "rotation": 180.0, | ||||||
|  |     "velocity": 0 | ||||||
|  |   }, | ||||||
|  |   "useDefaultConstraints": true | ||||||
|  | } | ||||||
							
								
								
									
										168
									
								
								src/main/deploy/pathplanner/paths/Slalum.path
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										168
									
								
								src/main/deploy/pathplanner/paths/Slalum.path
									
									
									
									
									
										Normal 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 | ||||||
|  | } | ||||||
| @@ -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 | ||||||
|  | } | ||||||
							
								
								
									
										8
									
								
								src/main/deploy/swerve/controllerproperties.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/main/deploy/swerve/controllerproperties.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | |||||||
|  | { | ||||||
|  |   "angleJoystickRadiusDeadband": 0.5, | ||||||
|  |   "heading": { | ||||||
|  |     "p": 0.4, | ||||||
|  |     "i": 0, | ||||||
|  |     "d": 0.01 | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										30
									
								
								src/main/deploy/swerve/modules/backleft.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								src/main/deploy/swerve/modules/backleft.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | |||||||
|  | { | ||||||
|  |   "location": { | ||||||
|  |     "front": -12.375, | ||||||
|  |     "left": 12.375 | ||||||
|  |   }, | ||||||
|  |   "absoluteEncoderOffset":209.443, | ||||||
|  |   "drive": { | ||||||
|  |     "type": "talonFX", | ||||||
|  |     "id": 8, | ||||||
|  |     "canbus": null | ||||||
|  |   }, | ||||||
|  |   "angle": { | ||||||
|  |     "type": "talonFX", | ||||||
|  |     "id": 9, | ||||||
|  |     "canbus": null | ||||||
|  |   }, | ||||||
|  |   "inverted": { | ||||||
|  |     "angle": true, | ||||||
|  |     "drive": false | ||||||
|  |   }, | ||||||
|  |   "conversionFactor": { | ||||||
|  |     "angle": 0, | ||||||
|  |     "drive": 0 | ||||||
|  |   }, | ||||||
|  |   "encoder": { | ||||||
|  |     "type": "cancoder", | ||||||
|  |     "id": 6, | ||||||
|  |     "canbus": null | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										30
									
								
								src/main/deploy/swerve/modules/backright.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								src/main/deploy/swerve/modules/backright.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | |||||||
|  | { | ||||||
|  |   "location": { | ||||||
|  |     "front": -12.375, | ||||||
|  |     "left": -12.375 | ||||||
|  |   }, | ||||||
|  |   "absoluteEncoderOffset": 5.537, | ||||||
|  |   "drive": { | ||||||
|  |     "type": "talonFX", | ||||||
|  |     "id": 11, | ||||||
|  |     "canbus": null | ||||||
|  |   }, | ||||||
|  |   "angle": { | ||||||
|  |     "type": "talonFX", | ||||||
|  |     "id": 12, | ||||||
|  |     "canbus": null | ||||||
|  |   }, | ||||||
|  |   "inverted": { | ||||||
|  |     "angle": true, | ||||||
|  |     "drive": false | ||||||
|  |   }, | ||||||
|  |   "conversionFactor": { | ||||||
|  |     "angle": 0, | ||||||
|  |     "drive": 0 | ||||||
|  |   }, | ||||||
|  |   "encoder": { | ||||||
|  |     "type": "cancoder", | ||||||
|  |     "id": 7, | ||||||
|  |     "canbus": null | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										30
									
								
								src/main/deploy/swerve/modules/frontleft.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								src/main/deploy/swerve/modules/frontleft.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | |||||||
|  | { | ||||||
|  |   "location": { | ||||||
|  |     "front": 12.375, | ||||||
|  |     "left": 12.375 | ||||||
|  |   }, | ||||||
|  |   "absoluteEncoderOffset":258.223 , | ||||||
|  |   "drive": { | ||||||
|  |     "type": "talonFX", | ||||||
|  |     "id": 2, | ||||||
|  |     "canbus": null | ||||||
|  |   }, | ||||||
|  |   "angle": { | ||||||
|  |     "type": "talonFX", | ||||||
|  |     "id": 3, | ||||||
|  |     "canbus": null | ||||||
|  |   }, | ||||||
|  |   "inverted": { | ||||||
|  |     "angle": true, | ||||||
|  |     "drive": false | ||||||
|  |   }, | ||||||
|  |   "conversionFactor": { | ||||||
|  |     "angle": 0, | ||||||
|  |     "drive": 0 | ||||||
|  |   }, | ||||||
|  |   "encoder": { | ||||||
|  |     "type": "cancoder", | ||||||
|  |     "id": 4, | ||||||
|  |     "canbus": null | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										30
									
								
								src/main/deploy/swerve/modules/frontright.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								src/main/deploy/swerve/modules/frontright.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | |||||||
|  | { | ||||||
|  |   "location": { | ||||||
|  |     "front": 12.375, | ||||||
|  |     "left": -12.375 | ||||||
|  |   }, | ||||||
|  |   "absoluteEncoderOffset": 110.215, | ||||||
|  |   "drive": { | ||||||
|  |     "type": "talonFX", | ||||||
|  |     "id": 18, | ||||||
|  |     "canbus": null | ||||||
|  |   }, | ||||||
|  |   "angle": { | ||||||
|  |     "type": "talonFX", | ||||||
|  |     "id": 17, | ||||||
|  |     "canbus": null | ||||||
|  |   }, | ||||||
|  |   "inverted": { | ||||||
|  |     "angle": true, | ||||||
|  |     "drive": false | ||||||
|  |   }, | ||||||
|  |   "conversionFactor": { | ||||||
|  |     "angle": 0, | ||||||
|  |     "drive": 0 | ||||||
|  |   }, | ||||||
|  |   "encoder": { | ||||||
|  |     "type": "cancoder", | ||||||
|  |     "id": 5, | ||||||
|  |     "canbus": null | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										16
									
								
								src/main/deploy/swerve/modules/physicalproperties.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/main/deploy/swerve/modules/physicalproperties.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | |||||||
|  | { | ||||||
|  |   "optimalVoltage": 12, | ||||||
|  |   "wheelGripCoefficientOfFriction": 1.19, | ||||||
|  |   "currentLimit": { | ||||||
|  |     "drive": 40, | ||||||
|  |     "angle": 20 | ||||||
|  |   }, | ||||||
|  |   "conversionFactor": { | ||||||
|  |     "angle": 16.8, | ||||||
|  |     "drive": 0.04 | ||||||
|  |   }, | ||||||
|  |   "rampRate": { | ||||||
|  |     "drive": 0.25, | ||||||
|  |     "angle": 0.25 | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										16
									
								
								src/main/deploy/swerve/modules/pidfproperties.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/main/deploy/swerve/modules/pidfproperties.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | |||||||
|  | { | ||||||
|  |   "drive": { | ||||||
|  |     "p": 0.0020645, | ||||||
|  |     "i": 0, | ||||||
|  |     "d": 0, | ||||||
|  |     "f": 0, | ||||||
|  |     "iz": 0 | ||||||
|  |   }, | ||||||
|  |   "angle": { | ||||||
|  |     "p": 0.01, | ||||||
|  |     "i": 0, | ||||||
|  |     "d": 0, | ||||||
|  |     "f": 0, | ||||||
|  |     "iz": 0 | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										14
									
								
								src/main/deploy/swerve/swervedrive.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								src/main/deploy/swerve/swervedrive.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | |||||||
|  | { | ||||||
|  |   "imu": { | ||||||
|  |     "type": "pigeon", | ||||||
|  |     "id": 0, | ||||||
|  |     "canbus": null | ||||||
|  |   }, | ||||||
|  |   "invertedIMU": false, | ||||||
|  |   "modules": [ | ||||||
|  |     "frontleft.json", | ||||||
|  |     "frontright.json", | ||||||
|  |     "backleft.json", | ||||||
|  |     "backright.json" | ||||||
|  |   ] | ||||||
|  | } | ||||||
							
								
								
									
										38
									
								
								src/main/java/frc/robot/Commands/Desaccumuler.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/main/java/frc/robot/Commands/Desaccumuler.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; | ||||||
|  | import edu.wpi.first.wpilibj2.command.Command; | ||||||
|  | import frc.robot.Subsystems.Accumulateur; | ||||||
|  |  | ||||||
|  | public class Desaccumuler extends Command { | ||||||
|  |   private Accumulateur accumulateur; | ||||||
|  |   /** Creates a new Desaccumuler. */ | ||||||
|  |   public Desaccumuler(Accumulateur accumulateur){ | ||||||
|  |     this.accumulateur = accumulateur; | ||||||
|  |     addRequirements(accumulateur); | ||||||
|  |     // 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()){accumulateur.desaccumule(0.1);} | ||||||
|  |      | ||||||
|  |   } | ||||||
|  |   // Called once the command ends or is interrupted. | ||||||
|  |   @Override | ||||||
|  |   public void end(boolean interrupted) { | ||||||
|  |    accumulateur.desaccumule(0); | ||||||
|  |   } | ||||||
|  |   // Returns true when the command should end. | ||||||
|  |   @Override | ||||||
|  |   public boolean isFinished() { | ||||||
|  |     return false; | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										51
									
								
								src/main/java/frc/robot/Commands/FollowAprilTag.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								src/main/java/frc/robot/Commands/FollowAprilTag.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,51 @@ | |||||||
|  | // 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.Lanceur; | ||||||
|  | import frc.robot.Subsystems.Limelight3G; | ||||||
|  |  | ||||||
|  | public class FollowAprilTag extends Command { | ||||||
|  |  | ||||||
|  |   private Limelight3G enlignement; | ||||||
|  |   private Lanceur lanceur; | ||||||
|  |   /** Creates a new Limelight3g. */ | ||||||
|  |   public FollowAprilTag(Limelight3G enlignement, Lanceur lanceur) { | ||||||
|  |     // Use addRequirements() here to declare subsystem dependencies. | ||||||
|  |     this.lanceur = lanceur; | ||||||
|  |     this.enlignement = enlignement; | ||||||
|  |     addRequirements(lanceur, enlignement); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   // 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 (enlignement.getv()==1)   | ||||||
|  |     { | ||||||
|  |       lanceur.tourelRotation(0,0, enlignement.getx()/30); | ||||||
|  |     } | ||||||
|  |     else | ||||||
|  |     { | ||||||
|  |       lanceur.tourelRotation(0, 0, 0); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   // Called once the command ends or is interrupted. | ||||||
|  |   @Override | ||||||
|  |   public void end(boolean interrupted) { | ||||||
|  |     lanceur.tourelRotation(0, 0, 0); | ||||||
|  |   } | ||||||
|  |   // Returns true when the command should end. | ||||||
|  |   @Override | ||||||
|  |   public boolean isFinished() { | ||||||
|  |     return false; | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										48
									
								
								src/main/java/frc/robot/Commands/LEDactive.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								src/main/java/frc/robot/Commands/LEDactive.java
									
									
									
									
									
										Normal 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; | ||||||
|  |   } | ||||||
|  | } | ||||||
| @@ -3,7 +3,6 @@ | |||||||
| // the WPILib BSD license file in the root directory of this project. | // the WPILib BSD license file in the root directory of this project. | ||||||
|  |  | ||||||
| package frc.robot.Commands; | package frc.robot.Commands; | ||||||
|  |  | ||||||
| import edu.wpi.first.wpilibj2.command.Command; | import edu.wpi.first.wpilibj2.command.Command; | ||||||
| import frc.robot.Subsystems.Lanceur; | import frc.robot.Subsystems.Lanceur; | ||||||
|  |  | ||||||
| @@ -15,25 +14,21 @@ public class Lancer extends Command { | |||||||
|     addRequirements(lanceur); |     addRequirements(lanceur); | ||||||
|     // Use addRequirements() here to declare subsystem dependencies. |     // Use addRequirements() here to declare subsystem dependencies. | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   // Called when the command is initially scheduled. |   // Called when the command is initially scheduled. | ||||||
|   @Override |   @Override | ||||||
|   public void initialize() { |   public void initialize() { | ||||||
|     lanceur.setPID(0, 0, 0); |     lanceur.PIDlanceur(0, 0, 0); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   // Called every time the scheduler runs while the command is scheduled. |   // Called every time the scheduler runs while the command is scheduled. | ||||||
|   @Override |   @Override | ||||||
|   public void execute() { |   public void execute() { | ||||||
|     lanceur.lance(0.5); |     lanceur.lance(0.5); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   // Called once the command ends or is interrupted. |   // Called once the command ends or is interrupted. | ||||||
|   @Override |   @Override | ||||||
|   public void end(boolean interrupted) { |   public void end(boolean interrupted) { | ||||||
|     lanceur.lance(0); |     lanceur.lance(0); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   // Returns true when the command should end. |   // Returns true when the command should end. | ||||||
|   @Override |   @Override | ||||||
|   public boolean isFinished() { |   public boolean isFinished() { | ||||||
|   | |||||||
							
								
								
									
										47
									
								
								src/main/java/frc/robot/Commands/Tracker_Couleur_Forme.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								src/main/java/frc/robot/Commands/Tracker_Couleur_Forme.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,47 @@ | |||||||
|  | // 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.Limelight3G; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | public class Tracker_Couleur_Forme extends Command { | ||||||
|  |   /** Creates a new Tracker_Couleur_Forme. */ | ||||||
|  |   private Limelight3G pipeline; | ||||||
|  |   public Tracker_Couleur_Forme(Limelight3G tracker_couleur, Limelight3G tracker_forme) { | ||||||
|  |     // Use addRequirements() here to declare subsystem dependencies. | ||||||
|  |     this.pipeline = pipeline; | ||||||
|  |     this.tracker_couleur = tracker_couleur; | ||||||
|  |     this.tracker_forme = tracker_forme; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   // 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 (pipeline == 1) { | ||||||
|  |       Limelight3G.tracker_couleur; | ||||||
|  |     } | ||||||
|  |     else if (pipeline == 2){ | ||||||
|  |       Limelight3G.tracker_forme; | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |      | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   // 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; | ||||||
|  |   } | ||||||
|  | } | ||||||
| @@ -4,15 +4,47 @@ | |||||||
|  |  | ||||||
| package frc.robot; | package frc.robot; | ||||||
|  |  | ||||||
|  | import edu.wpi.first.math.MathUtil; | ||||||
|  | import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; | ||||||
|  | import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; | ||||||
| import edu.wpi.first.wpilibj2.command.Command; | import edu.wpi.first.wpilibj2.command.Command; | ||||||
| import edu.wpi.first.wpilibj2.command.Commands; | 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.Desaccumuler; | ||||||
|  | import frc.robot.Commands.FollowAprilTag; | ||||||
|  | import frc.robot.Commands.Lancer; | ||||||
|  | import frc.robot.Subsystems.Accumulateur; | ||||||
|  | import frc.robot.Subsystems.Drive; | ||||||
|  | import frc.robot.Subsystems.Lanceur; | ||||||
|  | import frc.robot.Subsystems.Limelight3G; | ||||||
|  |  | ||||||
| public class RobotContainer { | public class RobotContainer { | ||||||
|  |   Lanceur lanceur= new Lanceur(); | ||||||
|  |   Accumulateur accumulateur = new Accumulateur(); | ||||||
|  |   Limelight3G limelight3G = new Limelight3G(); | ||||||
|  |   Drive drive = new Drive(); | ||||||
|  |   ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard"); | ||||||
|  |   CommandXboxController manette = new CommandXboxController(0); | ||||||
|   public RobotContainer() { |   public RobotContainer() { | ||||||
|  |     dashboard.addCamera("limelight3G", "limelight3G","limelight.local:5800") | ||||||
|  |     .withSize(3,4) | ||||||
|  |     .withPosition(0,0); | ||||||
|  |     dashboard.addCamera("limelight3", "limelight3","limelight.local:5800") | ||||||
|  |     .withSize(3,4) | ||||||
|  |     .withPosition(3,0);   | ||||||
|     configureBindings(); |     configureBindings(); | ||||||
|  |     drive.setDefaultCommand(new RunCommand(()->{ | ||||||
|  |      drive.drive(-MathUtil.applyDeadband(manette.getRightX(),0.2), MathUtil.applyDeadband(-manette.getRightY(),0.2), MathUtil.applyDeadband(-manette.getRightX(), 0.2)); | ||||||
|  |     },drive)); | ||||||
|   } |   } | ||||||
|    |    | ||||||
|   private void configureBindings() {} |   private void configureBindings() { | ||||||
|  |  | ||||||
|  |     manette.x().whileTrue(new Lancer(lanceur)); | ||||||
|  |     manette.leftBumper().toggleOnTrue(new FollowAprilTag(limelight3G, lanceur)); | ||||||
|  |     manette.a().whileTrue(new Desaccumuler(accumulateur)); | ||||||
|  |   } | ||||||
|  |  | ||||||
|   public Command getAutonomousCommand() { |   public Command getAutonomousCommand() { | ||||||
|     return Commands.print("No autonomous command configured"); |     return Commands.print("No autonomous command configured"); | ||||||
|   | |||||||
							
								
								
									
										46
									
								
								src/main/java/frc/robot/Subsystems/Accumulateur.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								src/main/java/frc/robot/Subsystems/Accumulateur.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,46 @@ | |||||||
|  | // 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.wpilibj.shuffleboard.ShuffleboardTab; | ||||||
|  | import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||||||
|  | import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX; | ||||||
|  | public class Accumulateur extends SubsystemBase { | ||||||
|  |    | ||||||
|  |   /** Creates a new Accumulateur. */ | ||||||
|  |   public Accumulateur() {dashboard.addBoolean("photocellacc", this::photocell).withSize(1, 1).withPosition(0, 1); | ||||||
|  |      dashboard.addBoolean("photocellacc2", this::photocell).withSize(1, 1).withPosition(0, 1); | ||||||
|  |     } | ||||||
|  |   ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard"); | ||||||
|  |    | ||||||
|  |   private GenericEntry vitesse = | ||||||
|  |       dashboard.add("vitesseacc", 0.1) | ||||||
|  |       .withSize(1, 1) | ||||||
|  |       .withPosition(0, 4) | ||||||
|  |       .getEntry();  | ||||||
|  |        | ||||||
|  |   final WPI_TalonSRX accumulateur1 = new WPI_TalonSRX(0); | ||||||
|  |   final WPI_TalonSRX accumulateur2 = new WPI_TalonSRX(10); | ||||||
|  |   final DigitalInput photocell = new DigitalInput(94); | ||||||
|  |   final DigitalInput photocell2 = new DigitalInput(93); | ||||||
|  |   public void encodeur(){ | ||||||
|  |   } | ||||||
|  |   public boolean photocell(){ | ||||||
|  |     return photocell.get(); | ||||||
|  |   } | ||||||
|  |   public void desaccumule(double vitesse){ | ||||||
|  |     accumulateur1.set(vitesse); | ||||||
|  |     accumulateur2.set(-vitesse); | ||||||
|  |   } | ||||||
|  |   public void desaccumule(){ | ||||||
|  |     desaccumule(vitesse.getDouble(0.9)); | ||||||
|  |   } | ||||||
|  |   @Override | ||||||
|  |   public void periodic() { | ||||||
|  |     // This method will be called once per scheduler run | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										48
									
								
								src/main/java/frc/robot/Subsystems/Drive.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								src/main/java/frc/robot/Subsystems/Drive.java
									
									
									
									
									
										Normal 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.Subsystems; | ||||||
|  | import java.io.File; | ||||||
|  | import java.io.IOException; | ||||||
|  | import com.ctre.phoenix6.hardware.Pigeon2; | ||||||
|  | import edu.wpi.first.math.geometry.Translation2d; | ||||||
|  | import edu.wpi.first.math.kinematics.SwerveModulePosition; | ||||||
|  | import edu.wpi.first.wpilibj.Filesystem; | ||||||
|  | import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||||||
|  | import swervelib.SwerveDrive; | ||||||
|  | import swervelib.parser.SwerveParser; | ||||||
|  |  | ||||||
|  | public class Drive extends SubsystemBase { | ||||||
|  |  | ||||||
|  |     SwerveDrive swerveDrive; | ||||||
|  |  | ||||||
|  |   File swerveJsonDirectory = new File(Filesystem.getDeployDirectory(),"swerve"); | ||||||
|  |    | ||||||
|  |   Pigeon2 Gyro = new Pigeon2(0); | ||||||
|  |     | ||||||
|  |   public void drive(double x, double y, double zRotation){ | ||||||
|  |     swerveDrive.drive(new Translation2d(x*5, y*5), zRotation*4, true, false); | ||||||
|  |   } | ||||||
|  |    | ||||||
|  |   public Drive() { | ||||||
|  |      try { | ||||||
|  |       this.swerveDrive = new SwerveParser(swerveJsonDirectory).createSwerveDrive(5); | ||||||
|  |       swerveDrive.setHeadingCorrection(true); | ||||||
|  |     } catch (IOException e) { | ||||||
|  |       e.printStackTrace(); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   public void restgyroscope(){ | ||||||
|  |     Gyro.reset(); | ||||||
|  |   } | ||||||
|  |   public SwerveModulePosition[] distance(){ | ||||||
|  |     return swerveDrive.getModulePositions(); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |    | ||||||
|  |   @Override | ||||||
|  |   public void periodic() { | ||||||
|  |     // This method will be called once per scheduler run | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										22
									
								
								src/main/java/frc/robot/Subsystems/LED.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								src/main/java/frc/robot/Subsystems/LED.java
									
									
									
									
									
										Normal 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 | ||||||
|  |   } | ||||||
|  | } | ||||||
| @@ -6,28 +6,66 @@ package frc.robot.Subsystems; | |||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | import com.ctre.phoenix.motorcontrol.FeedbackDevice; | ||||||
|  | import com.ctre.phoenix.motorcontrol.StatusFrameEnhanced; | ||||||
| import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX; | import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX; | ||||||
|  |  | ||||||
| import com.revrobotics.CANSparkMax; | import com.revrobotics.CANSparkMax; | ||||||
| import com.revrobotics.CANSparkLowLevel.MotorType; | import com.revrobotics.CANSparkLowLevel.MotorType; | ||||||
|  |  | ||||||
|  | import edu.wpi.first.networktables.GenericEntry; | ||||||
|  | import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; | ||||||
|  | import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; | ||||||
| import edu.wpi.first.wpilibj2.command.SubsystemBase; | import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||||||
|  |  | ||||||
| public class Lanceur extends SubsystemBase { | public class Lanceur extends SubsystemBase { | ||||||
|   /** Creates a new Lanceur. */ |   /** Creates a new Lanceur. */ | ||||||
|   public Lanceur() {} |   public Lanceur() {} | ||||||
|  |   ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard"); | ||||||
|    |    | ||||||
|   final WPI_TalonSRX lanceur1 = new WPI_TalonSRX(0); |   final WPI_TalonSRX lanceur1 = new WPI_TalonSRX(0); | ||||||
|   final WPI_TalonSRX lanceur2 = new WPI_TalonSRX(1); |   final WPI_TalonSRX lanceur2 = new WPI_TalonSRX(1); | ||||||
|   final CANSparkMax tourel = new CANSparkMax(2, MotorType.kBrushed); |   final CANSparkMax tourelle = new CANSparkMax(2, MotorType.kBrushed); | ||||||
|  |   private GenericEntry vitesse = | ||||||
|  |         dashboard.add("vitesselanceur", 0.2) | ||||||
|  |         .withSize(0,0) | ||||||
|  |         .withPosition(1, 4) | ||||||
|  |         .getEntry(); | ||||||
|  |         private GenericEntry rotation = | ||||||
|  |         dashboard.add("rottourel", 0.2) | ||||||
|  |         .withSize(0,0) | ||||||
|  |         .withPosition(1, 5) | ||||||
|  |         .getEntry(); | ||||||
|  |   public void encodeur(double distance){ | ||||||
|  |     lanceur1.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative); | ||||||
|  |     lanceur2.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative); | ||||||
|  |     lanceur1.setStatusFramePeriod(StatusFrameEnhanced.Status_2_Feedback0, 1); | ||||||
|  |   } | ||||||
|  |   public void masterslave(){ | ||||||
|  |     lanceur2.follow(lanceur1); | ||||||
|  |     lanceur2.setInverted(true); | ||||||
|  |   } | ||||||
|   public void lance(double vitesse){ |   public void lance(double vitesse){ | ||||||
|     lanceur1.set(vitesse); |     lanceur1.set(vitesse);lanceur2.set(vitesse); | ||||||
|     lanceur2.set(-vitesse); |  | ||||||
|   } |   } | ||||||
|   public void tourelRotation(double vitesse){ |   public void lance(){   | ||||||
|     tourel.set(vitesse); |     lance(vitesse.getDouble(0.2)); | ||||||
|   } |   } | ||||||
|   public void setPID(double p, double i, int d) { |   public void tourelRotation(double x, double y, double rotation){ | ||||||
|  |     tourelle.set(rotation); | ||||||
|  |   } | ||||||
|  |   public void tourelRotation(){ | ||||||
|  |     tourelle.set(rotation.getDouble(0.1)); | ||||||
|  |   } | ||||||
|  |   public double vitessetourel(){ | ||||||
|  |    return(tourelle.getEncoder().getVelocity());  | ||||||
|  |   } | ||||||
|  |   public double distancetourel(){ | ||||||
|  |     return(tourelle.getEncoder().getPosition()); | ||||||
|  |   } | ||||||
|  |   public void PIDlanceur(double p, double i, double d) { | ||||||
|  |    lanceur1.config_kP(0, p); | ||||||
|  |    lanceur1.config_kI(0, i); | ||||||
|  |    lanceur1.config_kD(0, d); | ||||||
|   } |   } | ||||||
|   @Override |   @Override | ||||||
|   public void periodic() { |   public void periodic() { | ||||||
|   | |||||||
							
								
								
									
										51
									
								
								src/main/java/frc/robot/Subsystems/Limelight3G.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								src/main/java/frc/robot/Subsystems/Limelight3G.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,51 @@ | |||||||
|  | // 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.wpilibj2.command.SubsystemBase; | ||||||
|  | import edu.wpi.first.net.PortForwarder; | ||||||
|  | import edu.wpi.first.networktables.NetworkTable; | ||||||
|  | import edu.wpi.first.networktables.NetworkTableEntry; | ||||||
|  | import edu.wpi.first.networktables.NetworkTableInstance; | ||||||
|  | import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; | ||||||
|  | import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; | ||||||
|  |  | ||||||
|  | public class Limelight3G extends SubsystemBase { | ||||||
|  |   ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard"); | ||||||
|  |   NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight"); | ||||||
|  |   NetworkTableEntry tx = table.getEntry("tx"); | ||||||
|  |   NetworkTableEntry ty = table.getEntry("ty"); | ||||||
|  |   NetworkTableEntry pipeline = table.getEntry("pipeline"); | ||||||
|  |   NetworkTableEntry tv = table.getEntry("tv"); | ||||||
|  |   NetworkTableEntry camMode = table.getEntry("camMode"); | ||||||
|  |   NetworkTableEntry tid = table.getEntry("tid"); | ||||||
|  |   /** Creates a new Limelight. */ | ||||||
|  |   public Limelight3G() { | ||||||
|  |     for (int port = 5800; port <= 5807; port++) { | ||||||
|  |       PortForwarder.add(port, "limelight.local", port); | ||||||
|  |   }} | ||||||
|  |   public  double getx(){ | ||||||
|  |     return tx.getDouble(0);  | ||||||
|  |   } | ||||||
|  |   public double gety(){ | ||||||
|  |     return ty.getDouble(0); | ||||||
|  |   } | ||||||
|  |   public double getv(){ | ||||||
|  |     return tv.getDouble(0); | ||||||
|  |   } | ||||||
|  |   public void setpipeline(){ | ||||||
|  |      pipeline.setNumber(0); | ||||||
|  |   } | ||||||
|  |   public void setcamMode(){ | ||||||
|  |     camMode.setNumber(0); | ||||||
|  |   } | ||||||
|  |   public double getTid(){ | ||||||
|  |     return tid.getDouble(0); | ||||||
|  |   } | ||||||
|  |   @Override | ||||||
|  |   public void periodic() { | ||||||
|  |     // This method will be called once per scheduler run | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										38
									
								
								vendordeps/PathplannerLib.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								vendordeps/PathplannerLib.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | |||||||
|  | { | ||||||
|  |     "fileName": "PathplannerLib.json", | ||||||
|  |     "name": "PathplannerLib", | ||||||
|  |     "version": "2024.2.8", | ||||||
|  |     "uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786", | ||||||
|  |     "frcYear": "2024", | ||||||
|  |     "mavenUrls": [ | ||||||
|  |         "https://3015rangerrobotics.github.io/pathplannerlib/repo" | ||||||
|  |     ], | ||||||
|  |     "jsonUrl": "https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLib.json", | ||||||
|  |     "javaDependencies": [ | ||||||
|  |         { | ||||||
|  |             "groupId": "com.pathplanner.lib", | ||||||
|  |             "artifactId": "PathplannerLib-java", | ||||||
|  |             "version": "2024.2.8" | ||||||
|  |         } | ||||||
|  |     ], | ||||||
|  |     "jniDependencies": [], | ||||||
|  |     "cppDependencies": [ | ||||||
|  |         { | ||||||
|  |             "groupId": "com.pathplanner.lib", | ||||||
|  |             "artifactId": "PathplannerLib-cpp", | ||||||
|  |             "version": "2024.2.8", | ||||||
|  |             "libName": "PathplannerLib", | ||||||
|  |             "headerClassifier": "headers", | ||||||
|  |             "sharedLibrary": false, | ||||||
|  |             "skipInvalidPlatforms": true, | ||||||
|  |             "binaryPlatforms": [ | ||||||
|  |                 "windowsx86-64", | ||||||
|  |                 "linuxx86-64", | ||||||
|  |                 "osxuniversal", | ||||||
|  |                 "linuxathena", | ||||||
|  |                 "linuxarm32", | ||||||
|  |                 "linuxarm64" | ||||||
|  |             ] | ||||||
|  |         } | ||||||
|  |     ] | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user