Skip to content

Commit 1a5bef4

Browse files
authored
Merge pull request #145 from errorcodexero/model
2 parents 8b36690 + c184870 commit 1a5bef4

19 files changed

Lines changed: 362 additions & 37 deletions

File tree

.advantagescope/Robot_Nautilus2025/config.json

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "Nautilus",
3-
"disableSimplification": false,
43
"rotations": [
54
{"axis": "x", "degrees": 90}
65
],
@@ -15,15 +14,15 @@
1514
}
1615
],
1716
"position": [
18-
0.1975,
19-
-0.2032,
20-
0.205
17+
0.3048,
18+
0.12,
19+
0.12
2120
],
2221
"resolution": [
2322
1280,
2423
960
2524
],
26-
"fov": 82
25+
"fov": 83
2726
},
2827
{
2928
"name": "Back Camera",
@@ -38,9 +37,9 @@
3837
}
3938
],
4039
"position": [
41-
-0.3159252,
42-
-0.0508,
43-
0.1760474
40+
-0.3048,
41+
0,
42+
0.12
4443
],
4544
"resolution": [
4645
960,
@@ -53,17 +52,40 @@
5352
"rotations": [
5453
{
5554
"axis": "y",
56-
"degrees": -20
55+
"degrees": -25
5756
},
5857
{
5958
"axis": "z",
6059
"degrees": 100
6160
}
6261
],
6362
"position": [
64-
0.077343,
65-
-0.322961,
66-
0.1825752
63+
-0.12,
64+
0.3048,
65+
0.12
66+
],
67+
"resolution": [
68+
960,
69+
720
70+
],
71+
"fov": 62.5
72+
},
73+
{
74+
"name": "Right Camera",
75+
"rotations": [
76+
{
77+
"axis": "y",
78+
"degrees": -20
79+
},
80+
{
81+
"axis": "z",
82+
"degrees": -90
83+
}
84+
],
85+
"position": [
86+
0.07,
87+
-0.3048,
88+
0.50
6789
],
6890
"resolution": [
6991
960,
@@ -72,5 +94,22 @@
7294
"fov": 62.5
7395
}
7496
],
75-
"components": []
97+
"components": [
98+
{
99+
"zeroedRotations": [{"axis": "x", "degrees": 90}],
100+
"zeroedPosition": [0, 0, 0]
101+
},
102+
{
103+
"zeroedRotations": [{"axis": "x", "degrees": 90}],
104+
"zeroedPosition": [0, 0, -0.06]
105+
},
106+
{
107+
"zeroedRotations": [{"axis": "x", "degrees": 90}],
108+
"zeroedPosition": [-0.28575, 0, -0.48]
109+
},
110+
{
111+
"zeroedRotations": [{"axis": "x", "degrees": 90}],
112+
"zeroedPosition": [0.124, -0.298, -0.450]
113+
}
114+
]
76115
}
-811 KB
Binary file not shown.
1.99 MB
Binary file not shown.
9.1 MB
Binary file not shown.
4.56 MB
Binary file not shown.
1.99 MB
Binary file not shown.

gradlew

100644100755
File mode changed.

reefscape.png

-333 KB
Loading

src/main/java/frc/robot/Robot.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ public Robot() throws RuntimeException {
102102
case SIM:
103103
// Running a physics simulator, log to NT
104104
Logger.addDataReceiver(new NT4Publisher());
105+
106+
// Silence Joystick Warnings
107+
DriverStation.silenceJoystickConnectionWarning(RobotBase.isSimulation());
105108
break;
106109

107110
case REPLAY:
@@ -115,7 +118,7 @@ public Robot() throws RuntimeException {
115118

116119
// Start AdvantageKit logger
117120
Logger.start();
118-
121+
119122
// Check for valid swerve config
120123
var modules =
121124
new SwerveModuleConstants[] {

src/main/java/frc/robot/RobotContainer.java

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import frc.robot.Constants.DriveConstants;
4343
import frc.robot.Constants.Mode;
4444
import frc.robot.Constants.ReefLevel;
45+
import frc.robot.Constants.RobotType;
4546
import frc.robot.commands.auto.AutoCommands;
4647
import frc.robot.commands.auto.AutoModeBaseCmd;
4748
import frc.robot.commands.drive.DriveCommands;
@@ -61,6 +62,7 @@
6162
import frc.robot.subsystems.brain.SetLevelCmd;
6263
import frc.robot.subsystems.climber.ClimberIO;
6364
import frc.robot.subsystems.climber.ClimberIOHardware;
65+
import frc.robot.subsystems.climber.ClimberIOSim;
6466
import frc.robot.subsystems.climber.ClimberSubsystem;
6567
import frc.robot.subsystems.drive.Drive;
6668
import frc.robot.subsystems.drive.GyroIO;
@@ -73,6 +75,7 @@
7375
import frc.robot.subsystems.funnel.FunnelSubsystem;
7476
import frc.robot.subsystems.grabber.GrabberIO;
7577
import frc.robot.subsystems.grabber.GrabberIOHardware;
78+
import frc.robot.subsystems.grabber.GrabberIOSim;
7679
import frc.robot.subsystems.grabber.GrabberSubsystem;
7780
import frc.robot.subsystems.manipulator.ManipulatorConstants;
7881
import frc.robot.subsystems.manipulator.ManipulatorIO;
@@ -89,6 +92,7 @@
8992
import frc.robot.subsystems.vision.CameraIOLimelight4;
9093
import frc.robot.subsystems.vision.CameraIOPhotonSim;
9194
import frc.robot.subsystems.vision.VisionConstants;
95+
import frc.robot.util.Mechanism3d;
9296
import frc.robot.util.ReefUtil;
9397
import frc.simulator.engine.ISimulatedSubsystem;
9498

@@ -268,13 +272,13 @@ private RobotContainer() {
268272
}
269273

270274
try {
271-
grabber_ = new GrabberSubsystem(new GrabberIOHardware());
275+
grabber_ = new GrabberSubsystem(new GrabberIOSim(drivebase_::getPose));
272276
} catch (Exception ex) {
273277
subsystemCreateException(ex);
274278
}
275279

276280
try {
277-
climber_ = new ClimberSubsystem(new ClimberIOHardware());
281+
climber_ = new ClimberSubsystem(new ClimberIOSim());
278282
} catch (Exception ex) {
279283
subsystemCreateException(ex);
280284
}
@@ -379,14 +383,35 @@ private RobotContainer() {
379383
autonomousTab.add("Auto Mode", autoChooser_.getSendableChooser()).withSize(2, 1);
380384
tuningTab.add("Tuning Modes", tuningChooser_.getSendableChooser()).withSize(2, 1);
381385

386+
// Visualizers
387+
new Mechanism3d(
388+
"Measured",
389+
drivebase_::getPose,
390+
manipulator_::getElevatorPosition,
391+
manipulator_::getArmPosition,
392+
climber_::getClimberPosition,
393+
brain_::gp
394+
);
395+
396+
new Mechanism3d(
397+
"Setpoints",
398+
drivebase_::getPose,
399+
manipulator_::getElevatorTarget,
400+
manipulator_::getArmTarget,
401+
climber_::getClimberPosition,
402+
brain_::gp
403+
);
404+
382405
// Configure the button bindings
383406
configureDriveBindings();
384407
configureButtonBindings();
385408
configureTestModeBindings() ;
386409

387-
manipulator_.setDefaultCommand(new CalibrateCmd(manipulator_));
410+
if (Constants.getRobot() != RobotType.SIMBOT) {
411+
manipulator_.setDefaultCommand(new CalibrateCmd(manipulator_));
412+
}
388413
}
389-
414+
390415
public Drive drivebase() {
391416
return drivebase_;
392417
}

0 commit comments

Comments
 (0)