|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
WPILib problems under linux
I'm having some trouble compiling code with WPILib under Linux. I'm using the Wine mcc-wrappers and the IFI Makefile/configure script (modified to link against wpilib).
In general, compiling with the 2005 libraries works fine. However, when I complied against the 2006 libraries, the linker complained that there were multiple definitions of Set_Number_of_Analog_Channels. Sure enough, I inspected the libraries with a hex editor, that function was defined in each. However, I "fixed" it by changing the name of the function in WPILib2k6.lib. Yes, I know that's terrible, but my code would compile after that. Now, when I try to use CMUcam functions, like InitializeCamera, the linker complains that the symbol numberOfCameraInitBlocks cannot be found in CMUCam2.o. Does anyone here (Brad Miller in particular) know what's going on? |
|
#2
|
|||
|
|||
|
Re: WPILib problems under linux
Quote:
You are correct on all counts... There are actually 2 problems, neither related to the linux environment. 1. The Set_Number_of_Analog_Channels can be fixed by changing the library order in the linker. The symbol is redefined in WPILib and it's a conflict between the IFI libraries and WPILib. Just reorder the two libraries. 2. The numberOfCameraInitBlocks is normally generated by easyC. The way it handles the camera is to create an array of structures, each one containing the camera initialization parameters for a set of tracking values (color, saturation, etc.). You need to add the following code to your program to get it to track the FIRST green target lights: Code:
// camera initialization array - would normally be generated by EasyC
unsigned char numberOfCameraInitBlocks = 1;
CameraInitializationData cameraData[] =
{
{ 85,115,15,17,100,145,0,1,0,1,0,0,128,128,128,1,16,8,5,30,15,5 }};
Code:
InitCamera(1); StartCamera(); And hopefully that will take care of the two problems that you described. If not, feel free to ask more questions. Brad |
|
#3
|
|||
|
|||
|
Re: WPILib problems under linux
Ah, this is very helpful, and I feel silly that I didn't notice this on the sample code page. Thanks for the help.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| WPILib Questions | Kruuzr | Programming | 1 | 22-01-2007 11:46 |
| USB-Serial Adapter and IFILoader under Linux | Venkatesh | Programming | 3 | 03-12-2006 22:52 |
| Use of printf in WPILib | koenig3456 | Programming | 2 | 06-03-2006 07:21 |
| Linux Wireless Card Problems | Mike | Chit-Chat | 3 | 03-01-2006 03:57 |