Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/simulation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Turret:
inputSamplesToAverage: 16
P: 0.025
I: 0.025
maxI: 10.0
maxIError: 10.0
F: 0.004
minOutput: 0.0
target: { within: 1.0 }
Expand Down Expand Up @@ -67,4 +67,4 @@ Turret:
D: 0
maxAbsoluteOutput: 0.75
target: { within: .5, stop: true }
Vision:
Vision:
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ static AbstractTurret providesTurret(SimulationTurret turret) {
}

@Provides
@Singleton
static AbstractVision providesVision(/*SimulationVision vision*/) {
// return vision;
return new NoopVision();
return new SimulationVision();
}

@Provides
Expand Down
2 changes: 1 addition & 1 deletion desktop/src/main/java/org/teamtators/rotator/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void start() {
logger.info("Opening window");
simulationFrame.setVisible(true);

autoCommand = commandStore.getCommand("AutoInit");
autoCommand = commandStore.getCommand("AutoChooser");
scheduler.registerStateListener(this);

scheduler.enterState(RobotState.DISABLED);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.teamtators.rotator.subsystems;

import org.teamtators.rotator.subsystems.noop.NoopVision;

import javax.inject.Singleton;

@Singleton
public class SimulationVision extends NoopVision {

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.teamtators.rotator.subsystems.AbstractVision;
import org.teamtators.rotator.subsystems.SimulationDrive;
import org.teamtators.rotator.subsystems.SimulationPicker;

Expand All @@ -25,6 +26,7 @@ public class SimulationDisplay extends JPanel {

private SimulationDrive drive;
private SimulationPicker picker;
private AbstractVision vision;

@Inject
public SimulationDisplay() throws HeadlessException {
Expand Down Expand Up @@ -63,6 +65,11 @@ public void setPicker(SimulationPicker picker) {
this.picker = picker;
}

@Inject
public void setVision(AbstractVision vision) {
this.vision = vision;
}

@Inject
public void setDriverJoystick(WASDJoystick driverJoystick) {
this.addKeyListener(driverJoystick);
Expand Down Expand Up @@ -129,6 +136,11 @@ public void paintComponent(Graphics g) {
g2d.setStroke(new BasicStroke(2));
g2d.draw(pickerRect);

if(vision.getLedState()) {
g2d.setColor(Color.GREEN);
g2d.fillOval((int)-width/2+20, -10, 20, 20);
}

g2d.dispose();
}

Expand Down