-
Notifications
You must be signed in to change notification settings - Fork 5
Add operator for transforming TS4231 position data #477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Consolidate win form event handlers - Initialize SpatialTransformMatrix property to indentity matrix - Refactor some functions here and there
- This is a more elegant than using the `WinForm.Control.Invoke` pattern to avoid cross-threading errors
- I think the the sptial transform should be another property within TS4231PositionData that allows the user to map the base-station-based coordinate system into an external coordinate system - Defaulting to identity matrix means that this does nothing by default.
- add cancel button - add timeout (probably only need timeout or cancel button) - check workflow is running before opening GUI - leave text boxes blank - correctly populate ts4231V1CoordinatesMatrix - give persistent scope to subscriptions so they can be disposed - simplify conditional statement for checking if user input is valid - minor edit to top-level label to be consistent with changes
…Dialog - This should recover the raw position values from P and Q alone without the M that is currently being edited.
jonnew's feedback: - Add status strip - Use "OK", "Cancel" button paradigms additionally: - Improve resizing - Address all VS messages - PascalCase methods - Make "using" syntax more concise - Add/Edit some XML comments - Instead of transforming every Vector3 and then averaging, average all Vector3s and then take the transform - Inline/remove the GetData() function
- The operator is now an included workflow comprising of ts4231 source node and a spatial transform node - The property that's set by the dialog is a struct containing pre-transform coordinates, post-transform coordinates and spatial transform matrix instead of just the matrix - Add workflows to ItemGroup in Onix1.csproj - Revert TS4231V1PositionData - Dialog changes: - Add X, Y, Z labels - Add a textbox for each component of each coordinate instead of one textbox - Add a textbox & label for displaying Spatial Transform Matrix - Change status messages TextBox to RichTextBox which allows changing font color and using newline characters instead of environment.newline. - Automatically calculate transform matrix when inputs are valid (avoids decoupling sets of pre-transform & post-transform coordinates and the spatial transform) - Simplify bottom toolstrip behavior - Move event handlers to top and helper methods underneath - Change instructions in top label according to the above changes
For context, I already tried combining these two One workaround could be to make a new dataframe that outputs position data and transformed position data, if for some reason Bonsai has real limitations. |
- Add cancel button - Add timeout (probably only need timeout or cancel button) - Check workflow is running before opening GUI - Add status strip - Use "OK", "Cancel" button paradigms Also: - Give persistent scope to subscriptions so they can be disposed - Simplify conditional statement for checking if user input is valid - Minor edit to top-level label to be consistent with changes - Improve resizing - PascalCase methods - Make "using" syntax more concise - Add/Edit some XML comments - Instead of transforming every Vector3 and then averaging, average all Vector3s and then take the transform - Inline/remove the GetData() function
- Add X, Y, Z labels - Add a textbox for each component of each coordinate instead of one textbox - Add a textbox & label for displaying Spatial Transform Matrix - Change status messages TextBox to RichTextBox which allows changing font color and using newline characters instead of environment.newline. - Automatically calculate transform matrix when inputs are valid (avoids decoupling sets of pre-transform & post-transform coordinates and the spatial transform) - Simplify bottom toolstrip behavior - Move event handlers to top and helper methods underneath - Change instructions in top label according to the above changes - Change some text in the confirmation dialog - Remove private access modifiers where they're not necessary
89b1c78
to
cc4eee6
Compare
Previous discussion on this branch can be found here #432 |
I rebased 1) to catch up this branch with main and 2) to remove some of the commits that added extraneous files or no-longer-needed edits (because I took a roundabout path to get this branch to where it is now). I'm wondering if it makes more sense to just squash and merge though. |
Looking very good. Since you are providing instruction in the text box, might be nice to be even more explicit:
|
Ill need to finish the review on monday when I have access to the hardware for testing |
- Change instructions label to rich text box for improved formatting - Use some text from jonnew in PR comment as basis for the content of the rich text box - rich text box detects URLs to make clickable hyperlinks if desired - remove private access modifiers where not necessary
I'm hesitant to add a link in the GUI. With that said, the instructions at top are now a rich text box (instead of a basic label) as of my last commit which detects URLs and turns them to clickable hyperlinks so it's easy to add if that's what we decide. |
Also fix instructions at top
This workflow works:

This workflow doesn't work:

The second workflow encapsulates

TS4231V1PositionData
andTS4231V1SpatialTransform
into a single node. It yields the following error when trying to open the GUI:I'm trying to encapsulate
TS4231PositionData
andTS4231V1SpatialTransform
into a single node because the correctness of the SpatialTransform depends on persistent P & Q values. When we discussed this, we said we want whateverTS4231V1TransformedPositionData
node we come up to have no external dependencies e.g. to be a pure function.I suspect the error is happening because the underlying bonsai infrastructure that I'm using to pipe
TS4231V1PositionDataFrames
into the GUI is looking for an input node, and it no longer considersTS4231V1PositionData
as an input node once it's in a GroupWorkflow or IncludeWorkflow (however you make the encapsulated workflow).Besides trying to fix this error, I think it would be helpful to refactor this branch of commits bc I took quite a circuitous path here (like making edits to
TS4231PositionData
and then reverting all those changes).Fix #427