Quote:
Originally Posted by newkidd-sagar
Hey guys, how do you replace the .cpp files in Windriver (the patch that is on FirstForge)?
|
Realize, please, that what you ask for is complicated, so please do not attempt this if you are not confident of the steps involved. Ask for help if you need it. <Insert strong disclaimers here>
This is probably all written somewhere semi-officially; I looked for such a reference with no success (surprising!) Anywhere, here goes...
Obtain the source for WPILib: This should be nothing more than un-zipping the WPILib<blahblah>rev2259.zip found in the C:/WindRiver/WPILib folder.
Import the WPILib project into Workbench: In Workbench, File -> Import... -> Existing Projects into Workspace (under General) -> Next -> Select "Select Root Directory" -> Browse... to where you un-zipped the source and click OK. "WPILib" should show up in the Projects box, make sure it is checked. You can also uncheck "Copy projects into workspace" if you want to build WPILib where you un-zipped it, or check this to copy it all into your WindRiver workspace tree. Click Finish.
The build process automatically calls a Subversion program to embed the software version into the compiled code. If you don't use Subversion, you'll need to modify the build process in one place: Right-click on your new WPILib project in the Project Explorer, and select Properties -> Build Properties -> the Build Tools tab -> select Build Tool: -> C++ Compiler, and in the Command: window, modify the part of the command that reads -D'SVN_REV="$(shell svnversion -n ..)"' so that the part inside the double quotes is a version string you want to see when your robot boots up. Then click Apply and OK to close the Properties dialog.
Build WPILib.a: Right-click on the WPILib project, and select Rebuild Project... -> Go take a break, and when you come back look in the file folder PPC603gnu\WPILib\Debug under your WPILib project. There should be a WPILib.a there. This is the library you want to link your robot code to. The original, official WPILib.a resides in WindRiver\vxworks-6.3\target\lib, and this is where your robot code project expects to find WPILib by default. If you replace the official WPILib.a, you want to do so in a careful, calculated, reasoned, and fully backed up manner.
Notice we have not *changed* WPILib yet, we merely built the official release ourselves. Link your robot code against your library, and prove that it works as well as the official version. Trust me, do not hurry this step.
Once you have established a working baseline WPILib, now proceed to attempt modifications. Get the .zip you mentioned from FIRST Forge, unzip the three files there into their corresponding places in your WPILib source tree. Repeat the "Build WPILib.a" step from above.
Link this new modified library with your robot code, and see if the camera is working better now. Make sure everything else you need works too. Report any problems back here and on the FIRST Forge artifact, thanks.