Compare commits
3 Commits
Lanceur
...
025d9e47f0
Author | SHA1 | Date | |
---|---|---|---|
025d9e47f0 | |||
89d155ae5e | |||
787251658c |
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": "sparkmax",
|
||||||
|
"id": 8,
|
||||||
|
"canbus": null
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "sparkmax",
|
||||||
|
"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": "sparkmax",
|
||||||
|
"id": 11,
|
||||||
|
"canbus": null
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "sparkmax",
|
||||||
|
"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": "sparkmax",
|
||||||
|
"id": 2,
|
||||||
|
"canbus": null
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "sparkmax",
|
||||||
|
"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": "sparkmax",
|
||||||
|
"id": 18,
|
||||||
|
"canbus": null
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "sparkmax",
|
||||||
|
"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"
|
||||||
|
]
|
||||||
|
}
|
@ -11,6 +11,8 @@ 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.wpilibj.Encoder;
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||||
|
|
||||||
public class Lanceur extends SubsystemBase {
|
public class Lanceur extends SubsystemBase {
|
||||||
@ -20,6 +22,10 @@ public class Lanceur extends SubsystemBase {
|
|||||||
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 tourel = new CANSparkMax(2, MotorType.kBrushed);
|
||||||
|
Encoder encoder = new Encoder(0, 1);
|
||||||
|
public void encodeur(double distance){
|
||||||
|
encoder.setDistancePerPulse(distance);
|
||||||
|
}
|
||||||
public void lance(double vitesse){
|
public void lance(double vitesse){
|
||||||
lanceur1.set(vitesse);
|
lanceur1.set(vitesse);
|
||||||
lanceur2.set(-vitesse);
|
lanceur2.set(-vitesse);
|
||||||
|
Reference in New Issue
Block a user