Software icon indicating copy to clipboard operation
Software copied to clipboard

Draw Virtual Obstacles

Open Mr-Anyone opened this issue 1 year ago • 18 comments

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 .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/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

Mr-Anyone avatar Nov 12 '24 02:11 Mr-Anyone

Also, highly likely that the code is buggy.

Mr-Anyone avatar Nov 12 '24 07:11 Mr-Anyone

i think the UI rn is quite good actually, if you wanna improve it:

  1. click a point
  2. as you move your mouse to the next point, a line is there from the first point to your mouse position
  3. click to add second point (so the line doesn't only show up once you click the second point)
  4. when done, double click to finish the polygon

sauravbanna avatar Nov 30 '24 20:11 sauravbanna

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.)

williamckha avatar Dec 10 '24 20:12 williamckha

To confirm: we are moving to the toolbox approach?

I am fine with either way.

Mr-Anyone avatar Dec 11 '24 03:12 Mr-Anyone

To confirm: we are moving to the toolbox approach?

I am fine with either way.

Yes

williamckha avatar Dec 11 '24 03:12 williamckha

Are we looking for something like this:

ezgif-1-081424cf48

It seems that Alt have been already been mapped. So to change toolbars, you press F1 and F2.

Mr-Anyone avatar Dec 21 '24 23:12 Mr-Anyone

@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).

itsarune avatar Dec 24 '24 02:12 itsarune

New changes

  1. Pushing to stack is now done by Shift+double clicking
  2. Adding one point is by done by Shift+click
  3. Pressing F1 and F2 changes between layers.
  4. 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!

Mr-Anyone avatar Dec 29 '24 18:12 Mr-Anyone

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.

github-actions[bot] avatar Feb 01 '25 02:02 github-actions[bot]

This PR was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Feb 07 '25 02:02 github-actions[bot]

So are we still keeping the ability to switch between toolbars?

Mr-Anyone avatar Feb 19 '25 00:02 Mr-Anyone

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?

Mr-Anyone avatar Feb 25 '25 05:02 Mr-Anyone

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

williamckha avatar Feb 26 '25 05:02 williamckha

I have just reset all the toolbar related commits.

Mr-Anyone avatar Mar 02 '25 01:03 Mr-Anyone

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.

github-actions[bot] avatar Apr 23 '25 03:04 github-actions[bot]

This PR was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Apr 28 '25 03:04 github-actions[bot]

@GrayHoang Could you please approve again. I think William resolved a merge conflict which dismissed the approval.

Mr-Anyone avatar May 15 '25 22:05 Mr-Anyone