Ajout yagsl
This commit is contained in:
		
							
								
								
									
										1
									
								
								java/try-catch.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								java/try-catch.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | |||||||
|  | # Try-Catch | ||||||
| @@ -34,11 +34,11 @@ configurations.all { | |||||||
|  |  | ||||||
| ## Ajout dans le programme | ## Ajout dans le programme | ||||||
|  |  | ||||||
| Il faut ensuite ajouter les librairies qui permettent de choisir quoi enregistrer. | Il faut ensuite ajouter les bibliothèques qui permettent de choisir quoi enregistrer. | ||||||
|  |  | ||||||
| ### Librairie | ### Bibliothèques | ||||||
|  |  | ||||||
| Il faut utiliser la même technique que dans [Librairies de composants](./vendor_libraries) avec le lien suivant: | Il faut utiliser la même technique que dans [Bibliothèques de composants](./vendor_libraries) avec le lien suivant: | ||||||
|  |  | ||||||
| ``` | ``` | ||||||
| https://github.com/Mechanical-Advantage/AdvantageKit/releases/latest/download/AdvantageKit.json | https://github.com/Mechanical-Advantage/AdvantageKit/releases/latest/download/AdvantageKit.json | ||||||
| @@ -74,4 +74,4 @@ Il faut importer le `Logger` de `org.littletonrobotics.junction.Logger`. | |||||||
| Remplacer le ModuleType du PowerDistribution par kREV selon le PDP utilisé. | Remplacer le ModuleType du PowerDistribution par kREV selon le PDP utilisé. | ||||||
| ::: | ::: | ||||||
|  |  | ||||||
| AdvantageKit est installé. Vous pouvez maintenant utiliser AdvantageScope. | AdvantageKit est installé. Vous pouvez maintenant utiliser [AdvantageScope](https://github.com/Mechanical-Advantage/AdvantageScope). | ||||||
|   | |||||||
| @@ -2,4 +2,34 @@ | |||||||
| sidebar_position: 1 | sidebar_position: 1 | ||||||
| --- | --- | ||||||
|  |  | ||||||
| # Librairies de composants | # Bibliothèques de composants | ||||||
|  |  | ||||||
|  | NavX | ||||||
|  |  | ||||||
|  | ``` | ||||||
|  | https://dev.studica.com/releases/2023/NavX.json | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | Phoenix (CTRE) | ||||||
|  |  | ||||||
|  | ``` | ||||||
|  | https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-frc2023-latest.json | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | REV | ||||||
|  |  | ||||||
|  | ``` | ||||||
|  | https://software-metadata.revrobotics.com/REVLib-2023.json | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | AdvantageKit (voir [AdvantageKit](./advantagekit)) | ||||||
|  |  | ||||||
|  | ``` | ||||||
|  | https://github.com/Mechanical-Advantage/AdvantageKit/releases/latest/download/AdvantageKit.json | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | YAGSL (Swerve, voir [YAGSL](./yagsl.md)) | ||||||
|  |  | ||||||
|  | ``` | ||||||
|  | https://broncbotz3481.github.io/YAGSL-Lib/yagsl/yagsl.json | ||||||
|  | ``` | ||||||
|   | |||||||
							
								
								
									
										44
									
								
								robot/nouveau_projet/yagsl.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								robot/nouveau_projet/yagsl.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,44 @@ | |||||||
|  | --- | ||||||
|  | sidebar_position: 3 | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | # YAGSL (Swerve) | ||||||
|  |  | ||||||
|  | [Yet Another Generic Swerve Library](https://github.com/BroncBotz3481/YAGSL) permet de facilement créer un sous-système swerve pour un robot. | ||||||
|  |  | ||||||
|  | Plus d'information sera ajoutée, mais pour l'instant vous pouvez suivre la documentation [ici](https://github.com/BroncBotz3481/YAGSL) | ||||||
|  |  | ||||||
|  | ## Installation | ||||||
|  |  | ||||||
|  | Installer les [bibliothèques](vendor_libraries.md) de NavX, Phoenix, REV et YAGSL. | ||||||
|  |  | ||||||
|  | ## Configuration | ||||||
|  |  | ||||||
|  | Pour utiliser la bibliothèque, nous devons lui fournir des fichiers de configuration qui décrivent notre système swerve (les différents moteurs et leurs ID, entre autres). | ||||||
|  |  | ||||||
|  | Vous pouvez donc aller chercher le dossier d'[exemple](https://github.com/BroncBotz3481/YAGSL/tree/main/deploy) ou le [créer vous-même](https://broncbotz3481.github.io/YAGSL-Example/). Vous devez mettre le dossier `swerve` dans le dossier `deploy` de votre projet. | ||||||
|  |  | ||||||
|  | ## Utilisation | ||||||
|  |  | ||||||
|  | 1. Créer un subsystem pour le swerve | ||||||
|  | 2. Créer une variable `SwerveDrive` | ||||||
|  | 3. Créer le `SwerveDrive` à partir de la configuration | ||||||
|  |  | ||||||
|  | ```java | ||||||
|  | SwerveDrive swerveDrive; | ||||||
|  |  | ||||||
|  |   /** Creates a new SwerveSubsystem. */ | ||||||
|  |   public SwerveSubsystem(File file) { | ||||||
|  |     try { | ||||||
|  |       this.swerveDrive = new SwerveParser(file).createSwerveDrive(); | ||||||
|  |     } catch (IOException e) { | ||||||
|  |       throw new RuntimeException(e); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | :::note | ||||||
|  | Ici, on utilise un [try-catch](../../java/try-catch){target="\_blank"}, car il pourrait y avoir une erreur si les fichiers de configuration n'existent pas; | ||||||
|  | ::: | ||||||
|  |  | ||||||
|  | Vous devrez ensuite ajouter vos méthodes pour intéragir avec le `SwerveDrive` dans le subsystem. | ||||||
		Reference in New Issue
	
	Block a user