Draw Virtual Obstacles
Description
Have the ability to draw virtual obstacles. I think this is terrible UI design but it works for now. The way you use this is that you shift click to add points of a polygon. By pressing q, the polygon is saved to the stack, so you can create a new polygon by shift clicking again. Pressing w would remove all the polygon.
I am not sure what the most user friendly way to draw these obstacles, so please give some feedback.
See below for a video of this
Testing Done
I am going to maybe write a sensor fusion test some time later?
Also, I am probably going to field test test to see if it can avoid virtual obstacles in real life.
Resolved Issues
resolves #3367
Added virtual obstacles for testing and visualization purposes.
Length Justification and Key Files to Review
N/A
See the entire video here: Screencast from 2024-11-11 06:01:02 PM.webm
- [X] Function & Class comments: All function definitions (usually in the
.hfile) should have a javadoc style comment at the start of them. For examples, see the functions defined inthunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class. - [X] Remove all commented out code
- [X] Remove extra print statements: for example, those just used for testing
- [X] Resolve all TODO's: All
TODO(or similar) statements should either be completed or associated with a github issue
Also, highly likely that the code is buggy.
i think the UI rn is quite good actually, if you wanna improve it:
- click a point
- as you move your mouse to the next point, a line is there from the first point to your mouse position
- click to add second point (so the line doesn't only show up once you click the second point)
- when done, double click to finish the polygon
I like the toolbar idea. You could add different keybindings for selecting different options on the toolbar (e.g. Alt+1, Alt+2, Alt+3, etc.)
To confirm: we are moving to the toolbox approach?
I am fine with either way.
To confirm: we are moving to the toolbox approach?
I am fine with either way.
Yes
Are we looking for something like this:
It seems that Alt have been already been mapped. So to change toolbars, you press F1 and F2.
@Mr-Anyone I think that seems okay to me. F1 F2 is kinda clunky but if I think the other obvious key combinations are already taken.
Using a key to toggle the toolbar seems fine to me, but we have a lot of empty space on the right side of Thunderscope, so having a subtle toolbar there might be better? I'm curious what other people think.
An option for you is to have an initial implementation in this PR and have another issue to work on toolbar placement in the future (for someone else).
New changes
- Pushing to stack is now done by Shift+double clicking
- Adding one point is by done by Shift+click
- Pressing F1 and F2 changes between layers.
- We can now disable the shift click ball placement.
Important Notes Regarding Double Click
The program have to differentiate a single click and a double click. To detect for a double click, the programs waits for 100ms after the first click. During that 100 ms time window, the program checks if there is another click. If there isn't a click within the 100 ms time window, the program detects it as a single click. Else, it is a double click.
The consequence of this is that add_one_point now have a 100ms lag. In other words, compare to before (i.e. pressing p), the program now have to wait for 100ms to check for double click!
This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This PR was closed because it has been stalled for 5 days with no activity.
So are we still keeping the ability to switch between toolbars?
From the sound of things on Saturday, are we reverting nuking the entire toolbar idea?
So something like shift+alt+double click and shift+alt+single click would be the new control instead?
From the sound of things on Saturday, are we reverting nuking the entire toolbar idea?
So something like shift+alt+double click and shift+alt+single click would be the new control instead?
Yes, shift + alt + click is fine for now. We can explore improving the toolbar in the future
I have just reset all the toolbar related commits.
This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This PR was closed because it has been stalled for 5 days with no activity.
@GrayHoang Could you please approve again. I think William resolved a merge conflict which dismissed the approval.