Spawn Intake/Ejector in the middle of the robot [SYNTH-204]#1372
Spawn Intake/Ejector in the middle of the robot [SYNTH-204]#1372RoushilS wants to merge 6 commits into
[SYNTH-204]#1372Conversation
rutmanz
left a comment
There was a problem hiding this comment.
I really don't like the idea of comparing the config to the default to see if it's been user-modified. Perhaps instead make the default array for the robot preferences empty or otherwise qualitatively different to make it clear it hasn't yet been configured, and use your bounding box computation then.
|
|
||
| export function convertArrayToThreeMatrix4(arr: number[]) { | ||
| // DO NOT ask me why retrieving and setting the same EXACT data is done is two DIFFERENT majors | ||
| // biome-ignore-start format: We would prefer to visualize this as a matrix |
There was a problem hiding this comment.
This is still true, the old formatting made it much clearer how the matrix works
There was a problem hiding this comment.
Oh okay, I'll revert it.
| // return identity matrix if array is not valid | ||
| if (!arr || arr.length !== 16) { | ||
| return new THREE.Matrix4() | ||
| } |
There was a problem hiding this comment.
I mean I suppose this works, but I was thinking that when the robot preferences are loaded or when the intake zone prefs are accessed it automatically replace it with the centered position.
That would also have the effect of making the zone position be centered even before they open the intake config panel which isn't nice just for consistency.
There was a problem hiding this comment.
What does the last sentence mean?
There was a problem hiding this comment.
I just want to be sure I'm understanding you.
There was a problem hiding this comment.
Basically I don't think it makes sense to have the intake be in one spot before you configure it and a different spot after if you don't move it. Right now it's possible (I think, I'm not able to run it right now) to intake before you configure the intake and the zone is just wherever the identity matrix puts it.
Alternatively, it might make sense to just return early from all the intake and ejector-related functions (the collision checker / button handlers) if the transform array is empty, or even have an explicit "isConfigured" flag in each subsystem so that they don't do anything until someone actually places them somewhere
| } from "@/util/TypeConversions" | ||
|
|
||
| function isDefaultDelta(delta: number[]): boolean { | ||
| return !delta || delta.length === 0 |
There was a problem hiding this comment.
This isn't necessarily a problem but !delta will always be false (empty and filled arrays are truthy*). Unless you're trying to do a null check in which case you should update the method type signature
rutmanz
left a comment
There was a problem hiding this comment.
Uh I mean it seems like this works but it's more addressing the symptom than the cause. I'm realizing that #1371 makes handling this much easier, but basically I think the settings need to be saved after this.endureDefaultZoneTransformations is called if things are modified. You could either do that with PreferencesSystem or wait for #1371 to get merged (which might take a while)
rutmanz
left a comment
There was a problem hiding this comment.
Problem appears to still be occuring
Screen.Recording.2026-07-08.at.4.43.21.PM.mov
|
hmm. Is there any chance you could send me that robot? And also test on the other robots, as they all work for me. |

Task
SYNTH-204
Make intake/ejector config intially spawn in the center.
Symptom
When Intake/Ejector is spawned for the first time, it is often distanced from the robot itself (sometimes underground), making the user configuration period take slightly longer.
Solution
Set gizmo to spawn at center after doing a check to make sure the transformation delta is not the intial one.
Verification
Before merging, ensure the following criteria are met: