View Single Post
  #3   Spotlight this post!  
Unread 30-04-2013, 21:53
virtuald's Avatar
virtuald virtuald is online now
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,067
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: [Q] How are we supposed to use threads in our robot code?

Quote:
Originally Posted by pipsqueaker View Post
Are you saying that I have to use boost and WPILib's task class?
No.

Quote:
Also, on the above page, it says the task::run takes the arguments of types FUNCPTR and int. just asking, the fcptr is just the function name without any arguments or parentheses, correct?
Yes.

Quote:
Also the arguments are of type int, does that mean I can only pass integers?
Sorta. Since it's C++ and it allows you to shoot yourself in the foot, you can technically pass in anything that is the same size as an integer. Be wary of this behavior, as integer sizes may vary on other platforms (such as your PC).

I recommend searching these forums for more information, other people have asked the same questions.
__________________
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