Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature] Allow scanning for remote asynchronously. #1800

Open
laurensvalk opened this issue Sep 3, 2024 · 2 comments
Open

[Feature] Allow scanning for remote asynchronously. #1800

laurensvalk opened this issue Sep 3, 2024 · 2 comments

Comments

@laurensvalk
Copy link
Member

I was wondering if it would be possible to connect asynchronously with the controller at any time while the main program is already running, and let the robot check whether the controller is connected and behave differently when it is (remote-controlled) or not (autonomous).

Originally posted by @DanieleBenedettelli in #1598

@laurensvalk
Copy link
Member Author

What I think would be helpful is if the XboxController constructor took an auto_connect parameter. So you could create XboxController(auto_connect=False), and then later you could call an (async) connect method. When the controller isn't connected then it should behave as if the joysticks are centered and nothing is pressed.

That way you could write code for menus, for example, that could use either the controller or the hub buttons to control the robot. With just a connection timeout parameter, I think we'd have to create a wrapper class around the controller instead of using it directly.

It seems like an auto_connect parameter and connect method might also work well with the block coding.

Originally posted by @dsplaisted in #1598 (comment)

@laurensvalk
Copy link
Member Author

This would also be nice to have for the upcoming builtin "port view" or "port control" application discussed in #139

Then we can have it scan for remotes, but also allow you to operate it without a remote.

We can make make this optional, and make it use the current behavior as the default so that it isn't a breaking change.

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

No branches or pull requests

1 participant