Skip to content
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

Draw Virtual Obstacles #3406

Open
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

Mr-Anyone
Copy link
Contributor

@Mr-Anyone Mr-Anyone commented Nov 12, 2024

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

  • 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.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

@Mr-Anyone
Copy link
Contributor Author

Also, highly likely that the code is buggy.

Copy link

@Mr-Anyone
Copy link
Contributor Author

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!

Comment on lines +20 to +21
# TODO: as of current, this layer only supports two layers, but
# it can be easily extended to support multiple layers in the future
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO should be tagged with a github issue

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump

from software.thunderscope.gl.widgets.gl_toolbar import GLToolbar


class ShiftButtonToolbar(GLToolbar):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this UI very confusing. Rather than a drop-down menu, it might be better as a push button where pushing the button in enables shift-click and the depressed button disables shift-click.

Also, I wonder if there are other ideas on this that @williamckha or @sauravbanna can suggest

Copy link
Contributor

@itsarune itsarune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some feedback

Mr-Anyone and others added 6 commits December 30, 2024 10:53
Co-authored-by: itsarune <42703774+itsarune@users.noreply.github.com>
Co-authored-by: itsarune <42703774+itsarune@users.noreply.github.com>
Copy link
Contributor

@itsarune itsarune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good, just that pending TODO and waiting for some UI feedback from others

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New layer to draw obstacles on the field widget
4 participants