Go to Post the programmers are -- um, well, doing what programmers do: drinking more Mt Dew. - Roger [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 Rating: Thread Rating: 2 votes, 4.50 average. Display Modes
  #1   Spotlight this post!  
Unread 12-02-2012, 19:49
Ben_Farmer's Avatar
Ben_Farmer Ben_Farmer is offline
FIRST Robotics Team 2945
AKA: Gilgion
FRC #2945 (Steel-Stangs)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2008
Location: Manitou Springs, CO
Posts: 6
Ben_Farmer is an unknown quantity at this point
Question Test Harness Tips

So on my FRC team we are using C++ as our main language with python as a secondary backup language. We only have the means to test one code language at a time and the C++ half of our programming team always get dibs. This caused me to make a test harness to simulate the CRIO. My question is how do I emulate joystick input with (or without) wpilib?
__________________
- Ben Farmer
FIRST Robotics Team 2945
Reply With Quote
  #2   Spotlight this post!  
Unread 13-02-2012, 10:44
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,032
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: Test Harness Tips

Use pygame for joystick input.

If your test harness is general enough, you should consider releasing it for others to use. I've been considering making one and adding it to the RobotPy release, but for what we've needed simple unit testing (with a fake wpilib) has been sufficient. Check out this thread.
__________________
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
  #3   Spotlight this post!  
Unread 15-02-2012, 19:29
Ben_Farmer's Avatar
Ben_Farmer Ben_Farmer is offline
FIRST Robotics Team 2945
AKA: Gilgion
FRC #2945 (Steel-Stangs)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2008
Location: Manitou Springs, CO
Posts: 6
Ben_Farmer is an unknown quantity at this point
Question Re: Test Harness Tips

Quote:
Originally Posted by virtuald View Post
Use pygame for joystick input.
How exactly would I do that? I have read recently that many people use pygame for this but I can't find anything on how you do it. I don't really ever use pygame (sadly) so I kinda need some help.
__________________
- Ben Farmer
FIRST Robotics Team 2945
Reply With Quote
  #4   Spotlight this post!  
Unread 15-02-2012, 19:39
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,032
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: Test Harness Tips

Quote:
Originally Posted by Ben_Farmer View Post
How exactly would I do that? I have read recently that many people use pygame for this but I can't find anything on how you do it. I don't really ever use pygame (sadly) so I kinda need some help.
No idea. I've not used pygame myself, but I've read that it is *the* thing to use for interfacing with Joysticks. You might also try PyQT as well, I think QT has Joystick support.

For PyGame: http://www.pygame.org/wiki/tutorials
__________________
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
  #5   Spotlight this post!  
Unread 26-11-2012, 02:18
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,032
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: Test Harness Tips

Btw, we have our own test harness library that is associated with RobotPy. See http://www.chiefdelphi.com/forums/sh...d.php?t=109678
__________________
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
  #6   Spotlight this post!  
Unread 20-02-2013, 23:53
kevinvincent kevinvincent is offline
Registered User
FRC #0254
 
Join Date: Jan 2013
Location: San Jose
Posts: 4
kevinvincent is an unknown quantity at this point
Re: Test Harness Tips

This might be of assistance with pyGame. http://iamtherockstar.com/archive/ma...ame-joysticks/
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 21:35.

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