View Single Post
  #2   Spotlight this post!  
Unread 11-07-2014, 19:15
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: Python Multi Processing

Recommend surrounding your code with [code] tags, it's pretty much impossible to read without them.

Code:
Code goes here. :)
I'm surprised threads didn't work out for you... they should work in RobotPy. What error did you get?

On the other hand, I would be very surprised if multiprocessing worked. I'm surprised we didn't pull the module out.

For periodic tasks like this, I actually tend to prefer a polling approach where the main loop keeps calling my function, without an actual while loop in there. The key to this is to make sure the main loop is controlled tightly without too much variance (using something like our PreciseDelay object). Once you control the loop, you can even do things like adjust the robot angle with pretty good accuracy.

What rate are you trying to reach?
__________________
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