Go to Post I never said there was anything wrong with the kit frame, simply that it was weak. - Viper37 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Python
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-07-2014, 07:16
hyprvx's Avatar
hyprvx hyprvx is offline
Registered User
AKA: Devon
FRC #2151 (Monty Pythons)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Forest Park
Posts: 22
hyprvx is an unknown quantity at this point
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 :/
__________________
My userbars were eaten by Cthulhu.


FRC team 2151, the Monty Pythons!
Reply With Quote
  #2   Spotlight this post!  
Unread 13-07-2014, 10:07
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,040
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
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.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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