field movement layer improvements#3720
Conversation
|
|
||
| # This must be enabled for the mouse_moved_in_scene_signal to be emitted | ||
| self.detect_mouse_movement_in_scene = False | ||
| self.detect_mouse_movement_in_scene = True |
There was a problem hiding this comment.
I needed this turned on to implement the robot preview on hover. Previously, it was only turned on when the measure tool was in use. I'm not sure if keeping this always on would be a problem. If so, maybe we could implement some sort of counter so it's only turned off if neither the measure tool nor the field movement layer are enabled?
There was a problem hiding this comment.
I think I added this flag because detecting mouse movements every tick was hurting performance.
Software/src/software/thunderscope/gl/gl_widget.py
Lines 311 to 317 in 31720f6
We can get rid of the flag, seems like it was just premature optimization. I haven't noticed any extra lag when measure mode is on, at least not on my PC
There was a problem hiding this comment.
Yea I agree it should be fine to make this change, but perhaps if there is a way to just use a boolean to check if field movement layer is enabled that would be best
There was a problem hiding this comment.
Added the boolean! Now when a layer or the measure tool is enabled/disabled, it checks to see if any other layers/tools require mouse movements and changes the flag accordingly
…vements' into alice/field_movement_layer_improvements
williamckha
left a comment
There was a problem hiding this comment.
This is sweet, thanks alice!
|
|
||
| # This must be enabled for the mouse_moved_in_scene_signal to be emitted | ||
| self.detect_mouse_movement_in_scene = False | ||
| self.detect_mouse_movement_in_scene = True |
There was a problem hiding this comment.
I think I added this flag because detecting mouse movements every tick was hurting performance.
Software/src/software/thunderscope/gl/gl_widget.py
Lines 311 to 317 in 31720f6
We can get rid of the flag, seems like it was just premature optimization. I haven't noticed any extra lag when measure mode is on, at least not on my PC
nycrat
left a comment
There was a problem hiding this comment.
Hey Alice I tested this PR and everything looks good except one minor issue about when the robot preview visual is updated (see review comment)
| def mouse_in_scene_moved(self, event: MouseInSceneEvent) -> None: | ||
| """Handle mouse moved events to update robot position preview. | ||
|
|
||
| :param event: The event | ||
| """ |
There was a problem hiding this comment.
The overlay for the target robot position only shows up after the mouse has been dragged, and only disappears once the mouse moves.
Perhaps add a key press handler to set the target_point whenever shift+alt is pressed so it will updated immediately.
There was a problem hiding this comment.
I did try adding an alt key press handler but it had some unreliable behaviour. When I only pressed and released alt, it worked fine. But when I pressed shift first and then alt, it didn't register. There was some similar weirdness with the key release, depending on the order of events. I figured it was simpler to just leave it at mouse movements than introduce something unreliable
|
|
||
| # This must be enabled for the mouse_moved_in_scene_signal to be emitted | ||
| self.detect_mouse_movement_in_scene = False | ||
| self.detect_mouse_movement_in_scene = True |
There was a problem hiding this comment.
Yea I agree it should be fine to make this change, but perhaps if there is a way to just use a boolean to check if field movement layer is enabled that would be best
|
@a-png129 bumping this ticket for updates, since we will need it for testing soon |
|
So sorry about the delay!! I'll make sure to address the comments today |
…vements' into alice/field_movement_layer_improvements
…vements' into alice/field_movement_layer_improvements
|
@williamckha @nycrat @Andrewyx ready for another review 🫡 |
Andrewyx
left a comment
There was a problem hiding this comment.
CI seems to be failing, and pending eric's comment, but otherwise lgtm
| @@ -1,134 +0,0 @@ | |||
| # | |||
There was a problem hiding this comment.
not sure what triggered this deletion
Description
Shift+Alt+clickbegins a movement commandShift+Alt, hovering over the field displays a preview of the target robot position and orientation before committing the commandTesting Done
Manual testing in Thunderscope
(the frame rate only looks this bad in my recording... it's fine otherwise)
Screencast.from.2026-05-20.23-01-05.webm
Resolved Issues
#3719
Review Checklist
It is the reviewers responsibility to also make sure every item here has been covered
.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.TODO(or similar) statements should either be completed or associated with a github issue