Go to Post The discussion and helpfulness that goes on within this website is a great example of gracious professionalism. - andy.vangessel [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-01-2007, 21:55
tmbg37 tmbg37 is offline
Registered User
AKA: Ted Kaplan
FRC #0694 (Stuypulse)
Team Role: Leadership
 
Join Date: Aug 2005
Rookie Year: 2005
Location: New York
Posts: 4
tmbg37 is an unknown quantity at this point
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   Spotlight this post!  
Unread 23-01-2007, 23:38
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: WPILib problems under linux

Quote:
Originally Posted by tmbg37 View Post
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?

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 }};
Then to use the camera do this:
Code:
	InitCamera(1);
	StartCamera();
That will initialize it using the set of parameters supplied (see API.h for the meaning - it's an initializer for a CameraInitializationData struct.)

And hopefully that will take care of the two problems that you described. If not, feel free to ask more questions.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #3   Spotlight this post!  
Unread 23-01-2007, 23:53
tmbg37 tmbg37 is offline
Registered User
AKA: Ted Kaplan
FRC #0694 (Stuypulse)
Team Role: Leadership
 
Join Date: Aug 2005
Rookie Year: 2005
Location: New York
Posts: 4
tmbg37 is an unknown quantity at this point
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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 13:40.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi