View Single Post
  #2   Spotlight this post!  
Unread 30-04-2013, 19:10
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: [Q] How are we supposed to use threads in our robot code?

Quote:
Originally Posted by pipsqueaker View Post
Hey, I'm a new programmer, and right now me and one of my friends are involved in porting our robot code to c++. One big thing that's been throwing me off however is c++'s apparent lack of threads. Whenever I google it I get suggestions to use the Boost library, which I have no idea how to use with WPILib. Results are even harder to find because of the clash of terminology (Google keeps confusing forum threads with code threads), so the end result is that I'm really not sure how (or if) I can thread the code.

I'm building off of the SimpleTemplate project, if you wanted to know.

Thanks!
Last time I checked (around 1.38), Boost will work on vxWorks. However, compiling it into your robot code will be annoying. [edit] So don't use that on the robot unless you know what you're doing. [/edit]

Use the Task class instead, that allows you to create additional threads using WPILib.
__________________
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

Last edited by virtuald : 30-04-2013 at 21:48. Reason: clarification
Reply With Quote