Go to Post I love our bot. I think I want to take it to prom...:D - prettycolors91 [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: 24 votes, 5.00 average. Display Modes
  #16   Spotlight this post!  
Unread 28-10-2010, 01:48
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 260
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: RobotPy: Python for FRC

I've implemented dynamic loading of C modules. The next release of RobotPy will break out many of the C modules into separate loadable object files, the same way that normal Python does. These separate .out files are located in /lib/python3.1/dyn-load on the robot, so they won't clutter up the /ni-rt/system directory.

This should also make distributing other modules (e.g. NumPy) easier, as they can be distributed as separate .zip packages without having to integrate them into the RobotPy executable.

I'm also going to make the wpilib module dynamically loaded. This will make it easier to test with different/beta/custom versions of WPILib. This reduces the size of the basic Python executable down to ~3.5M; the wpilib module is ~5M!
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)

Last edited by Peter Johnson : 28-10-2010 at 04:55. Reason: wpilib will be dynamically loaded
Reply With Quote
  #17   Spotlight this post!  
Unread 02-11-2010, 19:14
EricS-Team180's Avatar
Happy Birthday! EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
Re: RobotPy: Python for FRC

After they were blown away with WindRiver/C++ last season, I introduced the controls and software team to Python by taking part in Team 342's summerpygames. They got the hang of it and are asking for more. This is perfect!
We'll give it a try.

Thanks,
Eric
__________________

Don't PANIC!
S. P. A. M.
Reply With Quote
  #18   Spotlight this post!  
Unread 03-11-2010, 17:31
EricS-Team180's Avatar
Happy Birthday! EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
Re: RobotPy: Python for FRC

Quote:
Originally Posted by AustinSchuh View Post
Hmm. That does complicate things. Something else to add to the list of prereqs for SciPy. It looks like some of what I assumed was in SciPy is also in NumPy (matricies, for example) so NumPy might be enough. At the very least, it'll help quite a bit.
...just a thought. You might be able to f2c the FORTRAN. I've had success with this with older versions of vxWorks.
__________________

Don't PANIC!
S. P. A. M.
Reply With Quote
  #19   Spotlight this post!  
Unread 04-11-2010, 12:53
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,187
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: RobotPy: Python for FRC

A bit off topic, but the book "Learn Python The Hard Way" seems like a great guide to learning how to program, using Python. (Different than learning how to use Python )

This might be good supplement to RobotPy.

http://learnpythonthehardway.org/index
Reply With Quote
  #20   Spotlight this post!  
Unread 06-11-2010, 17:23
andreboos andreboos is offline
Registered User
FRC #3021 (The Agency)
Team Role: Programmer
 
Join Date: Dec 2009
Rookie Year: 2010
Location: San Diego
Posts: 132
andreboos is a jewel in the roughandreboos is a jewel in the roughandreboos is a jewel in the roughandreboos is a jewel in the rough
Re: RobotPy: Python for FRC

I built the most recent version from source. The make_dist.bat file copies the loadable modules to "dyn-load", but Python looks for the modules in the "lib-dynload" directory. I fixed the bat file to reflect this, and it works fine now. Before, boot.py couldn't find the time library and aborted.

I post this here because the discussion boards on FIRST Forge are limited to project members (total project members: 1).
Reply With Quote
  #21   Spotlight this post!  
Unread 06-11-2010, 18:23
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 260
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: RobotPy: Python for FRC

Quote:
Originally Posted by andreboos View Post
I built the most recent version from source. The make_dist.bat file copies the loadable modules to "dyn-load", but Python looks for the modules in the "lib-dynload" directory. I fixed the bat file to reflect this, and it works fine now. Before, boot.py couldn't find the time library and aborted.

I post this here because the discussion boards on FIRST Forge are limited to project members (total project members: 1).
Sorry about the problem, although you shouldn't have seen it with the latest git sources (it was fixed in http://git.tortall.net/cgit.cgi/Robo...b7ade9051151a). The zip files have also been updated.

You should be able to request project membership on FIRST Forge to post there... let me know if you are unable to for some reason; maybe there's a setting I missed. Thanks!
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
Reply With Quote
  #22   Spotlight this post!  
Unread 06-11-2010, 22:51
andreboos andreboos is offline
Registered User
FRC #3021 (The Agency)
Team Role: Programmer
 
Join Date: Dec 2009
Rookie Year: 2010
Location: San Diego
Posts: 132
andreboos is a jewel in the roughandreboos is a jewel in the roughandreboos is a jewel in the roughandreboos is a jewel in the rough
Re: RobotPy: Python for FRC

Hmm. I checked out from the git repository just this morning. However, all the other files seem to match the most recent changeset, so maybe it's a client-side issue.

Anyways, I'm happy to report that I've finished porting last year's code to Python, and as a separate project, modified our existing C++ code to load Python to run an autonomous script that our drive team can edit while queuing for a match with alliance members, with surprising ease. I copied the RobotPy/Python directory and the wchar.h and wchar.c files into the old directory, expanded the include paths to include the root directory (containing the wchar files), /Python/, and /Python/Include/, and compiled. In our autonomous method I put the contents of RobotTask(), replacing ROBOTPY_BOOT with the path (on the robot) to our Python autonomous script. Then I uploaded the resulting .out file to the robot, leaving the existing Python libraries intact.

NetConsole shows many error messages about duplicate symbols when Autonomous mode starts, probably as a result of linking WPILib to the C++ code and also loading the _wpilib.out from RobotPy. However, WPILib also throws (fatal) "resource resuse [sic]" errors when WPILib instances from the Python code are not properly deleted before the script ends and the same resources are used in teleoperated code. I'm still resolving the kinks in WPILib on Python, but Python itself runs fine.
Reply With Quote
  #23   Spotlight this post!  
Unread 07-11-2010, 19:55
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 260
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: RobotPy: Python for FRC

Quote:
Originally Posted by andreboos View Post
However, WPILib also throws (fatal) "resource resuse [sic]" errors when WPILib instances from the Python code are not properly deleted before the script ends and the same resources are used in teleoperated code. I'm still resolving the kinks in WPILib on Python, but Python itself runs fine.
Unfortunately I haven't yet been able to get Python to always call the WPILib destructors. It does seem to call them if you explicitly del the WPILib Python variables, but that's obviously non-ideal. I'm actively trying to get this fixed (it's tied in with how Python unloads modules, so it's somewhat of a pain). Note it'll probably always be necessary to call gc.collect() explicitly to ensure the objects are destroyed (the default boot.py will do this).

Glad you were able to have some early success even not using the library how it's designed (as a full-up Python solution)!
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
Reply With Quote
  #24   Spotlight this post!  
Unread 15-11-2010, 14:57
dbeckwith's Avatar
dbeckwith dbeckwith is offline
Lead Programmer
AKA: Daniel Beckwith
FRC #3205 (The Patriots)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: USA
Posts: 84
dbeckwith is an unknown quantity at this point
Re: RobotPy: Python for FRC

Python sounds great! Is it legal for the 2010 season? And are there handlers or image-recognition algorithims for the camera?
Reply With Quote
  #25   Spotlight this post!  
Unread 16-11-2010, 01:26
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 260
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: RobotPy: Python for FRC

Quote:
Originally Posted by dbeckwith View Post
Python sounds great! Is it legal for the 2010 season? And are there handlers or image-recognition algorithims for the camera?
You mean the 2011 season? See the second FAQ (http://firstforge.wpi.edu/sf/wiki/do...botpy/wiki/Faq) for the full answer (and a caveat emptor warning). Basically I can't say as I'm not the GDC and can't predict future rules, but I see no reason why it wouldn't be legal according to the 2010 rules. Python itself is available to all teams and thus should be considered COTS code, and to the robot it looks like a C++ program that reads text files.

With regards to the image recognition suite (WPILib Vision library), there's currently no wrappers but it should a straightforward project for an enterprising person who wants to learn a bit about SWIG (see Packages\wpilib\wpilib.i in the source tree).
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
Reply With Quote
  #26   Spotlight this post!  
Unread 27-09-2011, 00:10
aidyl aidyl is offline
Team 4019 mentor
FRC #4019 (Mechanical Paradise)
Team Role: Mentor
 
Join Date: Sep 2011
Rookie Year: 2012
Location: Studio City
Posts: 2
aidyl is an unknown quantity at this point
Re: RobotPy: Python for FRC

Hi,
We are a rookie team (temp# 2012085) interested in using RobotPy. Any recommendations on how to start preparing (websites, tutorials, etc).
Thank you!!
Reply With Quote
  #27   Spotlight this post!  
Unread 16-10-2012, 21:15
z_beeblebrox's Avatar
z_beeblebrox z_beeblebrox is offline
Custom User Title
AKA: Cal
FRC #4183 (Bit Buckets)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Cambridge MA
Posts: 811
z_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond repute
Re: RobotPy: Python for FRC

I'm very sorry to bring back an old thread, but I'm wondering if this project has gone anywhere since 2010. If not, would everything in it still work? I've heard some very good things about Python, so am curious about maybe using it next year.
__________________
2012 Utah Regional Rookie All-Star
2013 Phoenix Regional Judge's Award for "design process and prototyping"
2014 Hub City Regional Quality Award, Arizona Regional Excellence in Engineering Award
2015 Arizona East Regional Creativity Award, Winner
2016 Arizona North Regional Finalist, Arizona West Excellence in Engineering Award, Finalist
Reply With Quote
  #28   Spotlight this post!  
Unread 17-10-2012, 01:32
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 260
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: RobotPy: Python for FRC

Quote:
Originally Posted by z_beeblebrox View Post
I'm very sorry to bring back an old thread, but I'm wondering if this project has gone anywhere since 2010. If not, would everything in it still work? I've heard some very good things about Python, so am curious about maybe using it next year.
Yes, we've continued to update it (generally as part of the beta test so it's fully up to date by the time of kickoff). For example, last year we updated it to support the Kinect. Team 294 has used in in competition in both 2011 and 2012 and plan to continue doing so in future years. I believe there are a handful of other teams out there using it as well.
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
Reply With Quote
  #29   Spotlight this post!  
Unread 17-10-2012, 11:46
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,084
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: RobotPy: Python for FRC

As Peter said, RobotPy still works and is being maintained. There's a bunch of resources included with the RobotPy distribution, and my team has released our robot code the last two years, both of which are written in python.
__________________
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Im doing something wrong here (python) Robototes2412 Programming 9 31-08-2010 00:05
Programing with Python Lord Byron Programming 5 25-08-2009 22:26
Looking for FRC teams for calendar fundraiser SciDKelly134 Fundraising 9 18-06-2009 11:55
Favorite Monty Python Sketch/Movie Joe Matt Chit-Chat 47 30-03-2004 21:45
monty python [split from thread: big jump, up to 131] Carolyn Duncan Chit-Chat 23 30-07-2001 20:46


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

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