Go to Post I was considering letting Big Mike bearhug me for the warmth. - Barry Bonzack [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 14-03-2009, 06:35
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,050
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
GUI WPILib Test Harness Released

If you're interested, I've created a 'test harness' for the C++ WPILib, that allows you to run the robot code on your PC (and theoretically Mac/Linux are supported if someone makes the build files for it too). Theres a lot of stuff it supports doing, and a lot of stuff that it doesn't support yet. Hopefully if theres enough community support we can make it support just about everything.

Its been very helpful for me, even in its early stages -- I've used it to find bugs in my program and in WPILib as well. For more details/screenshots and of course the source code (GPL), see my blog: http://www.virtualroadside.com/blog/...ness-released/
__________________
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
  #2   Spotlight this post!  
Unread 14-03-2009, 11:12
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,077
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: GUI WPILib Test Harness Released

I think a *lot* of people are going to be VERY happy about this. I look forward to testing it out!

Thanks!
Reply With Quote
  #3   Spotlight this post!  
Unread 15-03-2009, 13:01
Shinigami2057 Shinigami2057 is offline
Slackware Is Your New God (Mentor)
AKA: Harry Bock
FRC #1350 (Rambots)
Team Role: Programmer
 
Join Date: Oct 2006
Rookie Year: 2006
Location: Johnston, RI
Posts: 106
Shinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really nice
Re: GUI WPILib Test Harness Released

This is an awesome idea. I hope to contribute to this in the near future!

A few comments as to what I've seen so far:
  • It's a bad idea to use wxWidgets library calls in the simulator. If you ever plan on moving to another GUI toolkit, you can't just rip out the current GUI and add a Qt or GTK interface without drastically changing your simulator. Also, what if someone wants a console interface to the simulator? I'm more than willing to help on this front; it looks like you only need thread synchronization from wxWidgets, which is very easy to port.
  • A better approach in the long run, although more difficult, would be to implement the FPGA interface (the ChipObject classes and whatnot) rather than editing WPILib directly. Then WPILib can be run directly without need for modifications (that can easily be buggy).

Another good thing to implement would be a unit testing framework for WPILib.
__________________
One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.
Reply With Quote
  #4   Spotlight this post!  
Unread 15-03-2009, 14:37
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,050
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: GUI WPILib Test Harness Released

Quote:
Originally Posted by Shinigami2057 View Post
It's a bad idea to use wxWidgets library calls in the simulator. If you ever plan on moving to another GUI toolkit, you can't just rip out the current GUI and add a Qt or GTK interface without drastically changing your simulator.
I've kept this in the back of my mind when creating it -- this is why the stuff that does the actual work all sits in its own set of files/classes, as opposed to being totally intertwined with the GUI window.

As for abstracting the GUI itself away -- I feel this is rather silly -- the whole point of wx is to be cross platform (in fact, it uses GTK in Linux), and trying to abstract over that (which is already an abstraction) is just a bunch of unnecessary work that I didn't feel was necessary.

Besides, 90% of the code in the GUI window is just fluffy glue that moves information from the GUI controls to the control interface class (and vice versa). There isn't really any real work involved there.

You have to draw a line somewhere, and I placed my line in the Simulator directory classes. Feel free to draw the line somewhere else though, and send a patch.

Quote:
Also, what if someone wants a console interface to the simulator? I'm more than willing to help on this front; it looks like you only need thread synchronization from wxWidgets, which is very easy to port.
You're more than welcome to separate out the synchronization stuff, it should be quite trivial to do. There is also a line in Simulator::SimulateStep() that sends an event to the main window, I suspect that could be abstracted away quite easily, in the same way that the synchronization stuff would be.

Quote:
A better approach in the long run, although more difficult, would be to implement the FPGA interface (the ChipObject classes and whatnot) rather than editing WPILib directly. Then WPILib can be run directly without need for modifications (that can easily be buggy).
A good number of the WPILib classes don't depend on anything in the hardware, and so I've tried including those verbatim when possible (though, it wasn't my original goal to do this so some of the objects have a lot more chopped out of them -- my point of view on this evolved as time went on). At some point I will probably go back over the classes and reevaluate how I chopped them up -- one in particular that should have been done better is the chopping of DigitalModule/AnalogModule.

You will not be able to get it done totally unmodified, due to some compiler quirks (for example, Visual Studio will not allow you to have non-integer static constants). Also, due to the looping nature of the code, you have to find somewhere to stop the loop, so modifying IterativeRobot and SimpleRobot is necessary (a very tiny modification in each).

The downside of abstracting at the fpga class level is that all of the ChipObject stuff is totally undocumented (even though its typically obvious what the function does), and is subject to significant change at the whim of the fpga designers. I felt abstracting at the WPILib level was subject to less change, and would be easier.

Of course, feel free to do it differently. Send patches.

Quote:
Another good thing to implement would be a unit testing framework for WPILib.
If you're talking about WPILib itself... well, I would hope they have some kind of testing that they do for it that they just don't give to us (but, thats probably not the case).

If you're talking about using this to create something that you can unit test your robot code in it, then I would agree thats probably a good thing to do. I don't have a ton of experience in this area, so I would rather defer this work to someone who has a better idea of useful things a unit testing framework should have.
__________________
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 02-08-2009, 00:59
xtreampb's Avatar
xtreampb xtreampb is offline
Lead Programmer 2642
FRC #2642 (Pitt Pirates)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Snow Hill
Posts: 21
xtreampb is an unknown quantity at this point
Send a message via AIM to xtreampb Send a message via Yahoo to xtreampb
Re: GUI WPILib Test Harness Released

I was wondering if eaither of yall could show me how to set up wxWidgets for Microsoft Visual C++ 2008 express.

Thanks

~xtreampb~
__________________
~Xtreampb~

Pitt Pirates 2642

Lead Programmer
Reply With Quote
  #6   Spotlight this post!  
Unread 02-08-2009, 10:25
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,050
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: GUI WPILib Test Harness Released

http://wiki.wxwidgets.org/Microsoft_..._C%2B%2B_Guide

Or to summarize what you'll find there:
  • Download/install the source code (you'll want the wxMSW installer)
  • After installation, open the workspace: build\msw\wx.dsw
  • Build it in Debug Unicode mode and Release Unicode mode

My code assumes that you have wx installed at c:\wxWidgets -- typically what I do is setup a symbolic link to that directory using the Junction utility, but you can just directly install it there as well.

You can also use wxPack for a precompiled version of wx, but I don't have any experience with that.
__________________
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
  #7   Spotlight this post!  
Unread 06-12-2009, 19:21
DaveFrederick's Avatar
DaveFrederick DaveFrederick is offline
Registered User
FRC #1895
 
Join Date: Jan 2009
Location: Manassas,VA
Posts: 37
DaveFrederick is a jewel in the roughDaveFrederick is a jewel in the roughDaveFrederick is a jewel in the rough
Re: GUI WPILib Test Harness Released

Dustin,
Bravo !!!!
Thank you for your efforts on this simulator.
I have found it very useful in learning how to use the WPI library.
Our main Student programmer is a senior this year so I figure as a Mentor I need to learn how to develop the software so I can teach next years students.

Please keep everyone informed as to when any updates are released.

Regards,
Dave Frederick, Mentor, Manassas, Virginia Team 1895.
Reply With Quote
  #8   Spotlight this post!  
Unread 23-12-2009, 11:34
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,050
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: GUI WPILib Test Harness Released

Yeah... I'm sure I'll be updating this once the build season starts up. Haven't touched it since last year though. At some point I need to make a Google Code project for it...
__________________
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
  #9   Spotlight this post!  
Unread 28-02-2011, 22:23
brian3795 brian3795 is offline
Registered User
FRC #3795
 
Join Date: Jan 2011
Location: Garland, TX
Posts: 29
brian3795 can only hope to improve
Re: GUI WPILib Test Harness Released

Any updates on this? Seems a shame that interest in this has fallen off...nothing more bothersome than having to actually have the cRIO present and accounted for when testing code.
Reply With Quote
  #10   Spotlight this post!  
Unread 01-03-2011, 00:22
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,050
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: GUI WPILib Test Harness Released

Quote:
Originally Posted by brian3795 View Post
Any updates on this? Seems a shame that interest in this has fallen off...nothing more bothersome than having to actually have the cRIO present and accounted for when testing code.
I really haven't had a need (or motivation) for it recently, since our robot code has been quite simple the last two years, so I haven't done anything with it. Feel free to improve/update it, however.
__________________
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
  #11   Spotlight this post!  
Unread 01-03-2011, 00:34
brian3795 brian3795 is offline
Registered User
FRC #3795
 
Join Date: Jan 2011
Location: Garland, TX
Posts: 29
brian3795 can only hope to improve
Re: GUI WPILib Test Harness Released

Quote:
Originally Posted by virtuald View Post
I really haven't had a need (or motivation) for it recently, since our robot code has been quite simple the last two years, so I haven't done anything with it. Feel free to improve/update it, however.
Looks interesting! Got it up and running, so I'll see what I can do with this.
Reply With Quote
  #12   Spotlight this post!  
Unread 01-03-2011, 11:03
jwakeman jwakeman is offline
Registered User
FRC #0063 (Red Barons)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: 16510
Posts: 182
jwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nice
Re: GUI WPILib Test Harness Released

I also downloaded this and got it up and running this past weekend. I agree this project has some real potential. Dustin, Brian, what do you see as the next steps/features to implement for the project? I would also like to help!
Reply With Quote
  #13   Spotlight this post!  
Unread 01-03-2011, 12:12
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,050
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: GUI WPILib Test Harness Released

Quote:
Originally Posted by jwakeman View Post
I also downloaded this and got it up and running this past weekend. I agree this project has some real potential. Dustin, Brian, what do you see as the next steps/features to implement for the project? I would also like to help!
Did you use the version in SVN or the last file release? I think it's slightly broken right now... though I don't exactly recall where I left the code.

I believe the thing I was working on before I dropped it was porting the rest of the WPILib components to the test harness, and trying to use more of the actual source code for WPILib in the work.

If you guys want to do work on it, join the FIRSTForge project and I'll give you SVN access.
__________________
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
  #14   Spotlight this post!  
Unread 01-03-2011, 15:44
jwakeman jwakeman is offline
Registered User
FRC #0063 (Red Barons)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: 16510
Posts: 182
jwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nice
Re: GUI WPILib Test Harness Released

I downloaded it from the file releases, WPILibTestHarness-0.1.1. It seemed to be working fine. I was able to run the DefaultCode project and see the solenoid lights flashing in a nice sequence. I am a member of FIRST forge as jwakeman. I can't guarantee I will be submitting anything anytime soon but I would like to be able to get the latest code from the svn to study.

One question for you though. I can see how you can drive outputs and see the solenoid light for example. But if I declared a digital input for example how would I drive the value of that input? Is there some way to drive the digital input high/low from outside of the robot code under test? Or is that a TODO?
Reply With Quote
  #15   Spotlight this post!  
Unread 01-03-2011, 19:06
brian3795 brian3795 is offline
Registered User
FRC #3795
 
Join Date: Jan 2011
Location: Garland, TX
Posts: 29
brian3795 can only hope to improve
Re: GUI WPILib Test Harness Released

I tried to browse the source, but I was denied anonymous access. I'll see about registering an account.

Jwakeman, I've got this compiled using VC++ Express 2010 (for whatever reason, I was unable to download 2008) as well as the latest dev version of wxWidgets. There were a few minor changes required. Right now, I'm getting error messages on the PWM output widgets (all the other widgets seem to be present and accounted for). I'd like to try compiling against the latest WPILib code.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beta WPILib Docs Released... Nate Smith FRC Control System 5 09-10-2008 18:49
Quick release wire harness mechanicalbrain Electrical 2 08-01-2006 15:36
2003 Gyro Wiring Harness DukesAZ Electrical 3 03-02-2005 18:20
Electrical Harness MulletFish Electrical 3 18-01-2005 17:40
Wire harness Alex Forest Electrical 2 02-01-2003 22:27


All times are GMT -5. The time now is 13:24.

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