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 44 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

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

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

Copy link
Contributor

github-actions bot commented Feb 1, 2025

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 github-actions bot added the Stale Inactive pull requests label Feb 1, 2025
Copy link
Contributor

github-actions bot commented Feb 7, 2025

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

@github-actions github-actions bot closed this Feb 7, 2025
@Mr-Anyone Mr-Anyone reopened this Feb 13, 2025
@github-actions github-actions bot removed the Stale Inactive pull requests label Feb 14, 2025
@@ -218,3 +222,67 @@ def set_speed_callback(self, callback: Callable[[float], None]) -> None:
:param callback: the callback function to update the simulation speed
"""
self.speed_callback = callback


class RandomToolbar(GLToolbar):
Copy link
Contributor

Choose a reason for hiding this comment

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

?

print("I just did something")


# TODO: move this into a different layer 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.

resolve TODO or make a new GitHub issue

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.

I thought about it again. I think the toggle between the shift+click selecting between ball movement and virtual obstacle creation should be two buttons that are part of the toolbar on the right side of the screen.

Screenshot 2025-02-17 02:46:32 edited

Then, we don't need the F1, F2 thing because I'm finding the current controls hard to figure out

@Mr-Anyone
Copy link
Contributor Author

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

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