View Full Version : WindRiver WPILib problems
01-11-2009, 07:10 PM
Over the past few days I've been trying to get my head around the Windriver IDE and more specifically, trying to get access to the WPILib files. For instance, in the SimpleTracker sample, in order to change the tracking parameters, you need to edit the TrackAPI.cpp file but as far as I can tell that file is not in the project. I'm probably missing something obvious here but can someone explain what I need to do?
01-12-2009, 12:14 AM
I don't think you would need to change the TrackAPI.cpp file. All of the source files are pre compiled into WPILib.a. You can download the WPILib source files to look at the code, and you can probably compile it, but I don't think that would be necessary. What parameters are you trying to change?
01-12-2009, 10:23 PM
Well, looking back at the Tracker program, the values for the green are set in the user routine portion so I don't actually need to edit the WPILib stuff for that. What I'm wondering is say I want to change the ArcadeDrive method to have scaling built in. Is that something that is discouraged and instead we're supposed to put a wrapper method that does the scaling and then calls ArcadeDrive? That just seems like a more complex way to do it because now your code is all spread out.
From the sounds of it though, I take it we're not supposed to modify the WPILib files (even if there is a way).
01-12-2009, 11:52 PM
All you have to do copy the drive function out of WPILib into a new cpp file and rename to something else, then call it in your program. Otherwise you need to download the source, compile it and then change the build properties for you project to point to your own WPILib.a instead of the pre-compiled one.
01-13-2009, 07:35 AM
You can use WPILib pre-compiled?
We've been compiling it every time: given the bugs we've found in the WPI code (InArea, FindColor, and GetLargestParticle so far), it is very useful to be able to modify it. What we did was go into windows explorer, and drag-drop every single CPP and H into our project. This ends up moving them all to your project's directory, and then you can freely modify them while still having a backup in c:\windriver\wpilib
Just posted a thread (http://www.chiefdelphi.com/forums/showthread.php?threadid=72018) detailing the bugs we found, in case anyone is interested.
01-13-2009, 04:17 PM
Ok, at this point with the drive stuff I guess I'll just do my own functions like you said Kingofl.
Anybody know a relative time frame for the next update to the WPILib? I don't want to go in and start fixing that code if an update is coming this week or something but I also don't want that to stop us from working on it.
vBulletin® v3.6.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.