View Single Post
  #4   Spotlight this post!  
Unread 09-04-2011, 18:30
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,043
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: How did using python work for your team?

Quote:
Originally Posted by Jeanne Boyarsky View Post
What tool did you use for the test program? I was thinking about py_compile, but that doesn't look like it checks method signatures for correctness.
We actually didn't use a tool, I just created a file called 'test.py', imported robot.py, and ran the program like the cRio would.

We have print statements sprinkled throughout the program, so we just verified the operation of the program manually -- and honestly, the biggest thing I was worried about was accidentally throwing an exception because of a syntax error, so the actual results didn't always matter to us -- just the fact that it ran all the way through our autonomous routine and a few rounds of operator control was good enough for me.

Of course, we also had a lot of things like the following sprinkled throughout our main loop too, just in case we missed something...

Code:
try:
    # call some complicated function in another module
except:
    # swallow any exceptions if we're in a real match...
    if not wpilib.DriverStation.GetInstance().IsFMSAttached():
        raise
__________________
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