Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Python (http://www.chiefdelphi.com/forums/forumdisplay.php?f=187)
-   -   A library to simulate joystick button press events? (http://www.chiefdelphi.com/forums/showthread.php?t=130034)

hyprvx 13-07-2014 07:16

A library to simulate joystick button press events?
 
So basically, I have an idea involving my team's robot, music, and LED light strips. My code is going to be in two parts, Python and LabVIEW (what the robot is currently coded in, moving to C++ in 2015). A Python script will have an animation, pressing one of four "buttons" that gets sent to the DS software, sending it to the robot. On these "button" presses, one of four LED light strips light up. And it all gets timed to music! I'll post a video if/when I get it working on a robot. My only bottleneck is that I don't know of any python libraries for simulating virtual joystick buttonpress events. Do you know of any?

TL;DR: I'm making a light flashy thing for our robot, and I need a joystick button press library for python.

apologies for grammar, I haven't slept last night :/

virtuald 13-07-2014 10:07

Re: A library to simulate joystick button press events?
 
Pressing buttons virtually is one way of accomplishing the task. Other ways I can think of, from easiest to hardest.
  • Use networktables to send a value to the LabVIEW code. Remember, your code can do more than one thing. ;)
  • Or just use sockets for communications. Should be easy to find an example somewhere on Chief Delphi.
  • If you're using python, you could try just sending raw driver station data instead using the driver station protocol. RobotPy has some code that may work for doing this.
  • You could simulate joystick buttons, this looks promising. I'd bet it's harder than the other alternatives.


All times are GMT -5. The time now is 19:49.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi