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

Provide async notification of DS state changes #151

Closed
PeterJohnson opened this issue Jul 9, 2016 · 5 comments
Closed

Provide async notification of DS state changes #151

PeterJohnson opened this issue Jul 9, 2016 · 5 comments
Assignees
Labels
type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Comments

@PeterJohnson
Copy link
Member

For some features (like gyro calibration) it would be a nice feature to be able to hook into transitions from disabled to autonomous/teleop. Currently this can only be done in the RobotBase class, but a feature to monitor these changes in the DS thread and call a callback would be relatively easy to implement and provide this ability more independently of user code.

@PeterJohnson PeterJohnson added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Jul 9, 2016
@Kevin-OConnor Kevin-OConnor added this to the 2018 milestone Nov 16, 2016
@AustinShalit AustinShalit modified the milestones: 2018 Beta 1, 2018 Beta 2 Aug 28, 2017
@PeterJohnson PeterJohnson self-assigned this Oct 28, 2017
@PeterJohnson PeterJohnson modified the milestones: 2018 Beta 2, 2018 Beta 3 Oct 28, 2017
@PeterJohnson PeterJohnson modified the milestones: 2018 Beta 3, 2019 Nov 18, 2017
@PeterJohnson PeterJohnson removed this from the 2019 milestone Dec 20, 2018
@Starlight220
Copy link
Member

Starlight220 commented May 10, 2020

I would be happy to implement this in Java, but I disagree with a few points:
I think the current DS class would need a lot of added functionality to do this, said functionality already exists in RobotBase. Adding it to the DS would either cause duplicates or a buggy transition.

independently of user code

Is there a way to write functional robot code without using RobotBase? If not, and the RobotBase class is trivial just like the DS class, then what problem is there with implementing it there? The functionality almost exists.

As I understand it, the wanted functionality is pretty much disabled/auto/teleop init/periodic, just as a callback and not in the Robot functions.

@calcmogul
Copy link
Member

What kind of stuff would we be running asynchronously? Is the idea that we'd have gyro calibration, for example, happen on the library side on DS transition, and the user wouldn't see it?

@Starlight220
Copy link
Member

I think this would be useful mostly for team libraries, and/or decentralization of the Robot class.

@calcmogul
Copy link
Member

calcmogul commented Aug 25, 2020

You can already get that "decentralization" by making a MySubsystem.teleopInit() function and call that in TimedRobot.telopInit(), and it's much easier to reason about and debug. Team libraries could do the same thing. Are there specific kinds of libraries you had in mind?

As @prateekma pointed out on the FRC Discord, a callback is useful when you don't have access to the state change, but you do in this case via the TimedRobot init() methods.

@Starlight220
Copy link
Member

not really, it's just a possible reason I thought of. If this isn't a useful feature anymore, close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Brand new functionality, features, pages, workflows, endpoints, etc.
Projects
None yet
Development

No branches or pull requests

5 participants