How do you setup a Controller?
See original GitHub issueConsider I want to setup a gamepad controller to control a simulated robot:
gamepad = ipywidgets.Controller()
gamepad.buttons[0].observe(lambda data: self.robot.device["gripper"].open())
gamepad.buttons[1].observe(lambda data: self.robot.device["gripper"].close())
gamepad.axes[1].observe(lambda data: self.robot.move(-data["new"], 0), 'value')
But I can’t do that (I guess) because the gamepad hasn’t been initialized yet. When should I hook up the buttons to the functions? Is there a callback for after the controller has been initialized?
BTW, here is the simulator: https://github.com/Calysto/jyro/blob/master/docs/Jyro Simulator.ipynb
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (12 by maintainers)
Top Results From Across the Web
How to Use Your Gaming Controllers With Your Computer
You may think that your Xbox One or PS4 controller will always stay ... Head into Settings then Controller Settings and make sure...
Read more >[Steam] How to set up a controller for ... - University at Albany
No information is available for this page.
Read more >How to Connect an Xbox Controller to a PC | PCMag
Plug one end of your USB-to-micro USB or USB-to-USB-C (depending on the version of controller) cable into the controller. Plug the other end...
Read more >Connect an Xbox Wireless Controller to your console
The controller will automatically connect to the Bluetooth device you were just using. Once you connect your controller to your console, make sure...
Read more >Setup Gamepad - Parsec
Once you create the profile, double-click it in the list to start configuring which keys on the keyboard will trigger a button on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The flight simulator example does:
Oh, I forgot about the
.connectedobservable attribute. I’d rather just observe that, like you did above, without adding another function. That way we’re consistent in how to trigger actions - just use observe.