Skip to content

Conversation

Gold872
Copy link
Member

@Gold872 Gold872 commented Nov 21, 2024

Adds a new service to handle global shortcuts. The shortcuts are only called if the window is in focus, but is not dependent on which specific widget is in focus (which is why I avoided the flutter shortcuts widget).

Right now there's 2 shortcuts which are binded in the init() method of the ShortcutsService, but these could be added from anywhere

Space will set the rover to idle if it's in auto or manual, and []\ (at the same time) will set it to manual if it's currently idle.

And yes, I stole these shortcuts from the FRC driver station

@Levi-Lesches
Copy link
Member

Look into MaterialApp.shortcuts and .actions ;)

@Gold872
Copy link
Member Author

Gold872 commented Nov 21, 2024

Look into MaterialApp.shortcuts and .actions ;)

Since when did that exist?

I like my implementation though since it gives more control on when you want things to run

@Levi-Lesches
Copy link
Member

Levi-Lesches commented Nov 21, 2024

Not forever, but at least a little while I think

Sure, but you can just use a bool for the same effect. Also, can we rethink the key bindings? I think space bar to toggle idle <--> manual makes more sense

@Gold872
Copy link
Member Author

Gold872 commented Nov 21, 2024

Sure, but you can just use a bool for the same effect. Also, can we rethink the key bindings? I think space bar to toggle idle <--> manual makes more sense

The reason I chose not to do that is because it becomes less of a safety feature and more of a utility where you have to know what is going on. This is intended for quickly E-Stopping when something hazardous is happening and you need to quickly stop it from the laptop. I would want to have it set up so you have a no-doubt disable button where you know for a fact it will stop sending commands to the rover.

@Levi-Lesches
Copy link
Member

Not as clear cut, because there is a difference between stop sending commands and stop dangerous behavior. You can stop sending commands already by letting go of the controller, but we have a special stop command for all the Subsystems that we map to SELECT, which actively cancels all past commands. If you wanted to emulate the SELECT behavior on the space bar, that could be useful too (put in idle and stop everything)

Also, let's be careful with terminology here because e-stop is a physical hardware button that cuts off the battery, and using it immediately ends the mission and gives a 20% penalty

@Gold872
Copy link
Member Author

Gold872 commented Nov 21, 2024

Not as clear cut, because there is a difference between stop sending commands and stop dangerous behavior. You can stop sending commands already by letting go of the controller, but we have a special stop command for all the Subsystems that we map to SELECT, which actively cancels all past commands. If you wanted to emulate the SELECT behavior on the space bar, that could be useful too (put in idle and stop everything)

IMO when you're at the "control station" (the laptop in our case), you should have a way to quickly stop everything

Also, let's be careful with terminology here because e-stop is a physical hardware button that cuts off the battery, and using it immediately ends the mission and gives a 20% penalty

Thanks for the clarification, I'm used to E-stop meaning a completely different thing. A better term would be "e-disable"

@Gold872 Gold872 changed the title Added shortcuts to e-stop and set to manual Keyboard Shortcuts Nov 21, 2024
@Gold872 Gold872 requested a review from a team as a code owner April 24, 2025 01:45
@github-actions github-actions bot added the GUI label Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants