Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Python (http://www.chiefdelphi.com/forums/forumdisplay.php?f=187)
-   -   Test Harness Tips (http://www.chiefdelphi.com/forums/showthread.php?t=102670)

Ben_Farmer 12-02-2012 19:49

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?

virtuald 13-02-2012 10:44

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.

Ben_Farmer 15-02-2012 19:29

Re: Test Harness Tips
 
Quote:

Originally Posted by virtuald (Post 1125629)
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.

virtuald 15-02-2012 19:39

Re: Test Harness Tips
 
Quote:

Originally Posted by Ben_Farmer (Post 1127592)
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

virtuald 26-11-2012 02:18

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

kevinvincent 20-02-2013 23:53

Re: Test Harness Tips
 
This might be of assistance with pyGame. http://iamtherockstar.com/archive/ma...ame-joysticks/


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