Skip to content

Commit 1a6b417

Browse files
Cleanup
1 parent 44dfb7f commit 1a6b417

File tree

6 files changed

+35
-42
lines changed

6 files changed

+35
-42
lines changed

fission/src/systems/simulation/wpilib_brain/SimCameraVisualization.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@ export class SimCameraVisualization extends SceneObject {
1717
super()
1818
this._robot = robot
1919

20-
// Same position as SimCameraRenderer
21-
this._cameraPosition = new THREE.Vector3(0, 0.5, 0.2) // Mounted on robot
20+
this._cameraPosition = new THREE.Vector3(0, 0.5, 0.2)
2221

2322
this._cameraGroup = new THREE.Group()
2423
}
2524

2625
public setup(): void {
27-
// Add to scene
2826
World.sceneRenderer.addObject(this._cameraGroup)
29-
console.log("📹 [VISUAL] SimCameraVisualization added to scene")
27+
console.log("[VISUAL] SimCameraVisualization added to scene")
3028
}
3129

3230
public update(): void {
@@ -68,19 +66,18 @@ export class SimCameraVisualization extends SceneObject {
6866
this._isVisible = visible
6967
this._cameraGroup.visible = visible
7068

71-
if (visible) {
72-
console.log("📹 [VISUAL] Camera visualization enabled - you should see a camera model on your robot")
73-
} else {
74-
console.log("📹 [VISUAL] Camera visualization disabled")
75-
}
69+
// if (visible) {
70+
// console.log("📹 [VISUAL] Camera visualization enabled - you should see a camera model on your robot")
71+
// } else {
72+
// console.log("📹 [VISUAL] Camera visualization disabled")
73+
// }
7674
}
7775

7876
public dispose(): void {
7977
if (this._cameraGroup.parent) {
8078
this._cameraGroup.parent.remove(this._cameraGroup)
8179
}
8280

83-
// Dispose of geometries and materials
8481
this._cameraGroup.traverse(child => {
8582
if (child instanceof THREE.Mesh) {
8683
child.geometry.dispose()
@@ -92,6 +89,6 @@ export class SimCameraVisualization extends SceneObject {
9289
}
9390
})
9491

95-
console.log("📹 [VISUAL] SimCameraVisualization disposed")
92+
console.log("[VISUAL] SimCameraVisualization disposed")
9693
}
9794
}

fission/src/systems/simulation/wpilib_brain/SimInput.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,16 @@ export class SimCameraInput extends SimInput {
151151
this._cameraVisualization.setup()
152152

153153
console.log(
154-
`🎬 [CONSTRUCTOR] SimCameraInput created for ${device} (${this._defaultWidth}x${this._defaultHeight} @ ${this._defaultFPS}fps, interval=${this._frameInterval}ms)`
154+
`[CONSTRUCTOR] SimCameraInput created for ${device} (${this._defaultWidth}x${this._defaultHeight} @ ${this._defaultFPS}fps, interval=${this._frameInterval}ms)`
155155
)
156156
}
157157

158158
public update(deltaT: number) {
159-
if (Math.random() < 0.01) {
160-
console.log(
161-
`🔄 [UPDATE] SimCameraInput.update() called for ${this.device} (initialized: ${this._isInitialized})`
162-
)
163-
}
159+
// if (Math.random() < 0.01) {
160+
// console.log(
161+
// `🔄 [UPDATE] SimCameraInput.update() called for ${this.device} (initialized: ${this._isInitialized})`
162+
// )
163+
// }
164164

165165
if (!this._isInitialized) {
166166
this.initializeCamera()
@@ -175,7 +175,7 @@ export class SimCameraInput extends SimInput {
175175
}
176176

177177
private initializeCamera() {
178-
console.log(`🎥 [INIT] Starting camera initialization for ${this.device}`)
178+
console.log(`[INIT] Starting camera initialization for ${this.device}`)
179179

180180
// Initialize metadata
181181
SimCamera.setConnected(this.device, true)
@@ -186,7 +186,7 @@ export class SimCameraInput extends SimInput {
186186
SimCamera.setExposure(this.device, 50)
187187
SimCamera.setAutoExposure(this.device, true)
188188

189-
console.log(`🎥 [INIT] Camera metadata set, creating renderer...`)
189+
// console.log(`🎥 [INIT] Camera metadata set, creating renderer...`)
190190

191191
try {
192192
// Initialize video renderer for 3D scene capture
@@ -197,18 +197,18 @@ export class SimCameraInput extends SimInput {
197197
this._cameraVisualization.setVisible(true)
198198

199199
// Force immediate test frame to verify renderer works
200-
console.log(`[TEST] Attempting immediate test frame capture...`)
200+
// console.log(`[TEST] Attempting immediate test frame capture...`)
201201
this._cameraRenderer
202202
.captureFrameAsJPEG()
203203
.then(blob => {
204-
console.log(`🧪 [TEST] Initial test frame captured: ${blob.size} bytes - renderer is working!`)
204+
// console.log(`🧪 [TEST] Initial test frame captured: ${blob.size} bytes - renderer is working!`)
205205
this.sendFrameToRobot(blob)
206206
})
207207
.catch(error => {
208-
console.error(`[TEST] Initial test frame failed:`, error)
208+
console.error(`[TEST] Initial test frame failed:`, error)
209209
})
210210
} catch (error) {
211-
console.error(`[INIT] Failed to create camera renderer:`, error)
211+
console.error(`[INIT] Failed to create camera renderer:`, error)
212212
}
213213
}
214214

@@ -245,24 +245,24 @@ export class SimCameraInput extends SimInput {
245245

246246
private generateVideoFrame(deltaT: number) {
247247
if (!this._cameraRenderer) {
248-
console.warn(`📹 [FRAME] No camera renderer for ${this.device} - skipping frame generation`)
248+
// console.warn(`📹 [FRAME] No camera renderer for ${this.device} - skipping frame generation`)
249249
return
250250
}
251251

252252
this._lastFrameTime += deltaT * 1000
253253

254254
// Add timing debug logs occasionally
255-
if (Math.random() < 0.01) {
256-
console.log(
257-
`⏱[TIMING] ${this.device}: lastFrameTime=${this._lastFrameTime.toFixed(1)}ms, interval=${this._frameInterval}ms, deltaT=${(deltaT * 1000).toFixed(1)}ms`
258-
)
259-
}
255+
// if (Math.random() < 0.01) {
256+
// console.log(
257+
// `⏱[TIMING] ${this.device}: lastFrameTime=${this._lastFrameTime.toFixed(1)}ms, interval=${this._frameInterval}ms, deltaT=${(deltaT * 1000).toFixed(1)}ms`
258+
// )
259+
// }
260260

261261
// Generate frame at specified FPS
262262
if (this._lastFrameTime >= this._frameInterval) {
263263
this._lastFrameTime = 0
264264

265-
console.log(`[FRAME] Capturing 3D frame for ${this.device}`)
265+
// console.log(`[FRAME] Capturing 3D frame for ${this.device}`)
266266

267267
// Capture frame from 3D scene (robot perspective)
268268
this._cameraRenderer
@@ -282,7 +282,7 @@ export class SimCameraInput extends SimInput {
282282
const arrayBuffer = await frameBlob.arrayBuffer()
283283
const base64Frame = btoa(String.fromCharCode(...new Uint8Array(arrayBuffer)))
284284

285-
console.log(`🚀 [SEND] Converting frame: ${arrayBuffer.byteLength} bytes → ${base64Frame.length} chars`)
285+
console.log(`[SEND] Converting frame: ${arrayBuffer.byteLength} bytes → ${base64Frame.length} chars`)
286286

287287
// Send frame through WebSocket protocol
288288
const frameMessage = {

fission/src/systems/simulation/wpilib_brain/WPILibBrain.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ class WPILibBrain extends Brain {
639639
constructor(assembly: MirabufSceneObject) {
640640
super(assembly.mechanism, "wpilib")
641641

642-
console.log(`🧠 [WPILIBRAIN] Constructor called for assembly: ${assembly.assemblyName}`)
642+
console.log(`[WPILIBRAIN] Constructor called for assembly: ${assembly.assemblyName}`)
643643

644644
this._assembly = assembly
645645

@@ -650,7 +650,7 @@ class WPILibBrain extends Brain {
650650
return
651651
}
652652

653-
console.log(`🧠 [WPILIBRAIN] SimulationLayer found, setting up devices...`)
653+
console.log(`[WPILIBRAIN] SimulationLayer found, setting up devices...`)
654654

655655
this.addSimInput(new SimGyroInput("Test Gyro[1]", this._mechanism))
656656
this.addSimInput(new SimAccelInput("ADXL362[4]", this._mechanism))
@@ -674,9 +674,9 @@ class WPILibBrain extends Brain {
674674
}
675675

676676
public addSimInput(input: SimInput) {
677-
console.log(`[WPILIBRAIN] Adding SimInput: ${input.constructor.name} for device "${input.device}"`)
677+
console.log(`[WPILIBRAIN] Adding SimInput: ${input.constructor.name} for device "${input.device}"`)
678678
this._simInputs.push(input)
679-
console.log(`📊 [WPILIBRAIN] Total inputs: ${this._simInputs.length}`)
679+
console.log(`[WPILIBRAIN] Total inputs: ${this._simInputs.length}`)
680680
}
681681

682682
public addSimFlow(flow: SimFlow): boolean {

fission/src/systems/simulation/wpilib_brain/WPILibWSWorker.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async function tryConnect(port?: number): Promise<void> {
3939

4040
socket.addEventListener("message", onMessage)
4141
})
42-
.then(() => console.debug("Mutex released"))
42+
.then(() => { /* console.debug("Mutex released") */ })
4343
}
4444

4545
async function tryDisconnect(): Promise<void> {
@@ -51,12 +51,9 @@ async function tryDisconnect(): Promise<void> {
5151
})
5252
}
5353

54-
// Posts incoming messages
5554
function onMessage(event: MessageEvent) {
5655
self.postMessage(event.data)
5756
}
58-
59-
// Sends outgoing messages
6057
self.addEventListener("message", e => {
6158
switch (e.data.command) {
6259
case "enable": {
@@ -91,7 +88,6 @@ self.addEventListener("message", e => {
9188
}
9289
case "camera_frame": {
9390
if (socketOpen()) {
94-
// Send camera frame data through WebSocket
9591
const frameMessage = {
9692
type: "CAMERA_FRAME",
9793
device: e.data.data.device,

simulation/SyntheSimJava/src/main/java/com/autodesk/synthesis/SynthesisWebSocketServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void startServer() {
6060
if (!isRunning) {
6161
try {
6262
start();
63-
System.out.println("🚀 Synthesis WebSocket server starting on ws://localhost:3300/wpilibws");
63+
System.out.println("Synthesis WebSocket server starting on ws://localhost:3300/wpilibws");
6464
} catch (Exception e) {
6565
System.err.println("Error starting WebSocket server: " + e.getMessage());
6666
}

simulation/samples/JavaSample/src/main/java/frc/robot/Robot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public void disabledInit() {
206206
m_AO.setVoltage(12.0);
207207

208208
// Stop WebSocket server when robot is disabled
209-
System.out.println("🛑 Stopping WebSocket server...");
209+
System.out.println("Stopping WebSocket server...");
210210
SynthesisWebSocketServer.getInstance().stopServer();
211211
}
212212

0 commit comments

Comments
 (0)