Skip to content

Commit

Permalink
The schemes and machinations are complete
Browse files Browse the repository at this point in the history
Co-Authored-By: Jack Jewell <[email protected]>
Co-Authored-By: lydiahays <[email protected]>
  • Loading branch information
3 people committed Mar 10, 2024
1 parent 124b842 commit a183d5f
Show file tree
Hide file tree
Showing 26 changed files with 8,594 additions and 4,873 deletions.
8 changes: 7 additions & 1 deletion advantagescope.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@
"key": "NT:/GRRDashboard/Subsystems/Swerve/Visualizations/visionTargets",
"sourceTypeIndex": 0,
"sourceType": 5
},
{
"type": "Green Ghost",
"key": "NT:/GRRDashboard/Subsystems/Swerve/Details/speaker",
"sourceTypeIndex": 0,
"sourceType": 5
}
],
[
Expand Down Expand Up @@ -249,7 +255,7 @@
"cameraIndex": -1,
"fov": 50
},
"configHidden": true,
"configHidden": false,
"title": "Field"
},
{
Expand Down
3,757 changes: 2,234 additions & 1,523 deletions autos.chor

Large diffs are not rendered by default.

22 changes: 10 additions & 12 deletions dashboard/src/ntStores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@ export const HasNote = nt.subscribe<boolean>(`/GRRDashboard/Subsystems/Pivot/Det

export const RobotPosition = nt.subscribe<number[]>(`/GRRDashboard/Subsystems/Swerve/Visualizations/robot`, [0, 0, 0]);

export const TunableNoteVelocity = nt.subscribe<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableNoteVelocity`, 5);
export const TunableNoteVelocityPub = nt.publish<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableNoteVelocity`, `double`, 5);
export const TunableNormFudge = nt.subscribe<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableNormFudge`, 0.9);
export const TunableNormFudgePub = nt.publish<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableNormFudge`, `double`, 0.9);
export const TunableSpeakerXFudge = nt.subscribe<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableSpeakerXFudge`, 0.0);
export const TunableSpeakerXFudgePub = nt.publish<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableSpeakerXFudge`, `double`, 0.0);
export const TunableSpeakerYFudge = nt.subscribe<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableSpeakerYFudge`, 0.0);
export const TunableSpeakerYFudgePub = nt.publish<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableSpeakerYFudge`, `double`, 0.0);
export const TunableAmpXFudge = nt.subscribe<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableAmpXFudge`, 0.0);
export const TunableAmpXFudgePub = nt.publish<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableAmpXFudge`, `double`, 0.0);
export const TunableAmpYFudge = nt.subscribe<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableAmpYFudge`, 0.0);
export const TunableAmpYFudgePub = nt.publish<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableAmpYFudge`, `double`, 0.0);
export const TunableNoteVelocity = nt.publish<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableNoteVelocity`, `double`, 6);
export const TunableNormFudge = nt.publish<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableNormFudge`, `double`, 0.475);
export const TunableStrafeFudge = nt.publish<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableStrafeFudge`, `double`, 0.95);
export const TunableSpinCompensation = nt.publish<number>(
`/GRRDashboard/Subsystems/Swerve/Details/tunableSpinCompensation`,
`double`,
-2 * (Math.PI / 180),
);
export const TunableSpeakerXFudge = nt.publish<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableSpeakerXFudge`, `double`, 0.0);
export const TunableSpeakerYFudge = nt.publish<number>(`/GRRDashboard/Subsystems/Swerve/Details/tunableSpeakerYFudge`, `double`, 0.0);

nt.connect();
42 changes: 18 additions & 24 deletions dashboard/src/tabs/Tunables.svelte
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@
<script lang="ts">
import {
TunableNoteVelocity,
TunableNoteVelocityPub,
TunableNormFudge,
TunableNormFudgePub,
TunableStrafeFudge,
TunableSpinCompensation,
TunableSpeakerXFudge,
TunableSpeakerXFudgePub,
TunableSpeakerYFudge,
TunableSpeakerYFudgePub,
TunableAmpXFudge,
TunableAmpXFudgePub,
TunableAmpYFudge,
TunableAmpYFudgePub,
} from "../ntStores";
const onNoteVelocityBlur = (e: FocusEvent) => {
$TunableNoteVelocityPub = Number(decodeURIComponent((e.target as any)?.innerText).trim());
$TunableNoteVelocity = Number(decodeURIComponent((e.target as any)?.innerText).trim());
};
const onNormFudgeBlur = (e: FocusEvent) => {
$TunableNormFudgePub = Number(decodeURIComponent((e.target as any)?.innerText).trim());
$TunableNormFudge = Number(decodeURIComponent((e.target as any)?.innerText).trim());
};
const onSpeakerXBlur = (e: FocusEvent) => {
$TunableSpeakerXFudgePub = Number(decodeURIComponent((e.target as any)?.innerText).trim());
const onStrafeFudgeBlur = (e: FocusEvent) => {
$TunableStrafeFudge = Number(decodeURIComponent((e.target as any)?.innerText).trim());
};
const onSpeakerYBlur = (e: FocusEvent) => {
$TunableSpeakerYFudgePub = Number(decodeURIComponent((e.target as any)?.innerText).trim());
const onSpinCompensationBlur = (e: FocusEvent) => {
$TunableSpinCompensation = Number(decodeURIComponent((e.target as any)?.innerText).trim());
};
const onAmpXBlur = (e: FocusEvent) => {
$TunableAmpXFudgePub = Number(decodeURIComponent((e.target as any)?.innerText).trim());
const onSpeakerXBlur = (e: FocusEvent) => {
$TunableSpeakerXFudge = Number(decodeURIComponent((e.target as any)?.innerText).trim());
};
const onAmpYBlur = (e: FocusEvent) => {
$TunableAmpYFudgePub = Number(decodeURIComponent((e.target as any)?.innerText).trim());
const onSpeakerYBlur = (e: FocusEvent) => {
$TunableSpeakerYFudge = Number(decodeURIComponent((e.target as any)?.innerText).trim());
};
</script>

Expand All @@ -48,17 +42,17 @@
<p>Norm Fudge:</p>
<code contenteditable on:blur="{onNormFudgeBlur}">{$TunableNormFudge}</code>
<br /><br />
<p>Strafe Fudge:</p>
<code contenteditable on:blur="{onStrafeFudgeBlur}">{$TunableStrafeFudge}</code>
<br /><br />
<p>Spin Compensation:</p>
<code contenteditable on:blur="{onSpinCompensationBlur}">{$TunableSpinCompensation}</code>
<br /><br />
<p>Speaker X:</p>
<code contenteditable on:blur="{onSpeakerXBlur}">{$TunableSpeakerXFudge}</code>
<br /><br />
<p>Speaker Y:</p>
<code contenteditable on:blur="{onSpeakerYBlur}">{$TunableSpeakerYFudge}</code>
<br /><br />
<p>Amp X:</p>
<code contenteditable on:blur="{onAmpXBlur}">{$TunableAmpXFudge}</code>
<br /><br />
<p>Amp Y:</p>
<code contenteditable on:blur="{onAmpYBlur}">{$TunableAmpYFudge}</code>
</div>
</main>

Expand Down
Loading

0 comments on commit a183d5f

Please sign in to comment.