Go to Post Brandon is my hero :) - Cory [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
  #16   Spotlight this post!  
Unread 01-11-2007, 10:12
Abrakadabra Abrakadabra is offline
Here We Go !!!
AKA: Scott Kukshtel, Mr. K
FRC #3467 (The Windham Windup!)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Windham, New Hampshire
Posts: 160
Abrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant future
Re: WPILib and Eclipse

You shouldn't need to use the OIToPWM( ) function right off the bat. I haven't used it myself, but now that I look at it, I'd like to know the meaning of the "function" parameters too.

The "composite operator interface" functions (e.g. Tank2( )), also have some idiosyncrasies that you may need to just experiment with to discover. Put the robot up on blocks and watch what the wheels do when you use the various commands. In my case, I also found that the Tank2( ) function wanted the left motor "inverted", but your case may be different. I suggest playing with those parameters to see what works for you.

Another thing I found is that the Tank and Arcade functions define the motor positions as if you were looking from the back of the robot, whereas the "builtin" drive functions (i.e. those defined in "BuiltIns.h", such as TwoWheelDrive() and Motors()) define the motor positions as if you were looking from the front of the robot. So if you combine the usage of these functions in your code, you have to be careful how you specify the motor positions, especially if you are using defined constants.

I'm starting to accumulate quite a list of annotations to my copy of the WPILib document. If Brad is listening, maybe someone should think about a WPILib documentation Wiki or something like that where we could post corrections and clarifications to the doc as we find them.
  #17   Spotlight this post!  
Unread 01-11-2007, 19:38
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: WPILib and Eclipse

Tank2 works! Thanks for your help.

However, now I'm trying to use interrupt watchers to mess around with a one of the bump switches. I have it hooked up to interrupt port one, called StartInterruptWatcher(1,RISING_EDGE) (also tried FALLING_EDGE), and I can't ever get the Interrupt to go off. I doubt it's a bad swithc, as we tried a few and none worked. Any ideas?

Also, how do I grab pwm values directly from the OI? Eventually I'd like to do more advanced stuff that I can't accomplish by just using the Tank2 function. I also doubt OIToPWM would work, as I need the actualy pwm value. How would I do that?

Thanks.
  #18   Spotlight this post!  
Unread 02-11-2007, 13:40
Abrakadabra Abrakadabra is offline
Here We Go !!!
AKA: Scott Kukshtel, Mr. K
FRC #3467 (The Windham Windup!)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Windham, New Hampshire
Posts: 160
Abrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant future
Re: WPILib and Eclipse

I haven't tried using the Interrupt Watchers yet - I've got bumper switches working on my vExbot just by calling GetDigitalInput( ) inside my main program loop. Yes, it's possible that I'll miss the "press" event, but I've actually got very little code running in the loop right now, and besides, I'm just using the switches to determine if I've driven into a wall, so the "press" is fairly certain to be longer than a program loop cycle. Perhaps Brad can chime in here on the "gotchas" for Interrupt Watchers?

As for your second question, I think you mean you want to get the "joystick" values from the OI, and use those to set the PWMs, correct? Here you would use another "undocumented" function - GetRxInput(port, channel), which returns a value between 0 and 255. You can then map that directly to the PWM of your choice using SetPWM( ). (There's also a GetPWM() function, but it's only available on the vEx, and I'm not quite sure what you would use it for anyway?)

Note also these additional "undocumented" functions available for reading values from the OI:
unsigned char GetOIDInput(unsigned char port, unsigned char channel);
unsigned char GetOIAInput(unsigned char port, unsigned char channel);

(where, if it's not obvious, "D" = digital, "A" = analog).
  #19   Spotlight this post!  
Unread 02-11-2007, 15:32
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: WPILib and Eclipse

Ahh. Thanks you very much. The GetDigitalInput() should work, and I'm not sure how I missed it. I went through the two included header files to look for something. And the GetDigitalInput is much more appropriate to a bumper switch than an interrupt.

Yeah, I meant joystick values. I guess I was really tired last night :/ Thanks, I'll definitely use those functions.

It seems to me there's a need to extend the current documentation available. While I'm currently still learning the system, myself and the other programmers on our team working with me would love to help if we ever get a wiki online. Additionally, we'll probably be writing a file to handle PID loops soon. We'd be happy to share it if you're interested in it.
  #20   Spotlight this post!  
Unread 02-11-2007, 20:00
NSolarz NSolarz is offline
Registered User
FRC #2358 (LZ MPC Bears)
Team Role: Leadership
 
Join Date: Nov 2007
Rookie Year: 2008
Location: Lake Zurich
Posts: 7
NSolarz is an unknown quantity at this point
Re: WPILib and Eclipse

im getting an error in Eclipse when i try to build my project. i don't understand the error. can someone try to explain what is going wrong?
here is the error.

**** Build of configuration vEx WPILib Robot for project Dog ****


(Exec error:Launching failed)


thx for your help
  #21   Spotlight this post!  
Unread 03-11-2007, 16:24
Abrakadabra Abrakadabra is offline
Here We Go !!!
AKA: Scott Kukshtel, Mr. K
FRC #3467 (The Windham Windup!)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Windham, New Hampshire
Posts: 160
Abrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant future
Re: WPILib and Eclipse

sumadin -
Yes, please let us know when you get a good PID routine working. We're going to be tackling the same thing in the next few weeks. There is all kinds of talk about using PID all over CD, but a real lack of good programming examples.

NSolarz -
You haven't given us much to go on, but it sounds like your search path is set up incorrectly, and it's not finding the compiler and/or linker. Make sure you've followed *all* the instructions on the WPILib web site for setting up the Eclipse plugins and the mcc18 compiler.
  #22   Spotlight this post!  
Unread 15-11-2007, 11:57
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: WPILib and Eclipse

We have the logic written out, pretty much the same as we had it on last year's FRC robot, but we haven't tested it yet. So far, we've been waiting for a few sensors (gyro, ultrasonic rangefinder) to arrive in the mail, so we've been implementing some auxillary functions and structures from last year's robot.
  #23   Spotlight this post!  
Unread 17-11-2007, 18:28
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: WPILib and Eclipse

New issues: I've now been trying to convert code from Vex to FIRST. Even just having the just API.h, and BuiltIns.h, by having the project in the /WPILib/2k6/ folder. However, any time I try to call on any of the FIRST functions (Tank2, GetOIAInput, StartEncoder, etc.), I'm getting an error that says:

**** Build of configuration FRC 18f8722 WPILib Robot for project 2k6 ****

mingw32-make all
'Building file: ../main.c'
'Invoking: C18 Compiler'
mcc18 -D_FRC_BOARD -I=C:\mcc18\h -p=18F8722 -w=2 -nw=2066 -fo="main.o" "../main.c"
C:\WPILib\2k6\main.c:51:Error [1204] too many arguments in function call
mingw32-make: *** [main.o] Error 3

Any idea why this is happening? I've tried to mess around with pretty much every idea I had, and the only thing that seemed to relate is calling any of the WPILib functions.
  #24   Spotlight this post!  
Unread 18-11-2007, 02:06
Abrakadabra Abrakadabra is offline
Here We Go !!!
AKA: Scott Kukshtel, Mr. K
FRC #3467 (The Windham Windup!)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Windham, New Hampshire
Posts: 160
Abrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant future
Re: WPILib and Eclipse

What does line 51 in main.c look like? As you know, several of the WPILib function prototypes are different between vEx and FRC, so you may need to use #ifdef _FRC_BOARD or #ifdef _VEX_BOARD in your own code in order to use the correct prototype.
  #25   Spotlight this post!  
Unread 18-11-2007, 04:34
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: WPILib and Eclipse

Oh, that was increidbly stupid on my behalf. I just realized I copied the wrong error. I'm sorry. This one I completley understand. The one I do not understand does not supply a line, and the error itself complains about multiple definitions to "Set_Number_of_Analog_Channels". This happened any time I was in FRC code and tried to call any WPILib function, from either the main file or any other file. Any idea why that is happening? Sorry about the confusion.
  #26   Spotlight this post!  
Unread 26-11-2007, 16:59
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: WPILib and Eclipse

I managed to replicate the error by calling StartEncoder(1) (although any number does it). Same thing happens with calling any WPILib function, such as InitGyro, or any WPILib function I tried. Any idea why this happens? Here's the error message:

**** Build of configuration FRC 18f8722 WPILib Robot for project 2k6 ****

mingw32-make all
'Building file: ../main.c'
'Invoking: C18 Compiler'
mcc18 -D_FRC_BOARD -I=C:\mcc18\h -p=18F8722 -w=2 -nw=2066 -fo="main.o" "../main.c"
'Finished building: ../main.c'
' '
'Building target: 2k6.hex'
'Invoking: MPLINK Linker'
mplink "..\18F8722.lkr" /a INHX32 /w /m FRCMapfile.map /o"2k6.hex" ./controls.o ./main.o ./motors.o /l"C:\mcc18\lib" ..\FRC2k6_library.lib ..\WPILib2k6.lib
MPLINK 3.90, Linker
Copyright (c) 2004 Microchip Technology Inc.
Error - symbol 'Set_Number_of_Analog_Channels' has multiple definitions.
Errors : 1

mingw32-make: *** [2k6.hex] Error 1
  #27   Spotlight this post!  
Unread 27-11-2007, 04:36
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
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 and Eclipse

Quote:
Originally Posted by sumadin View Post
Implink "..\18F8722.lkr" /a INHX32 /w /m FRCMapfile.map /o"2k6.hex" ./controls.o ./main.o ./motors.o /l"C:\mcc18\lib" ..\FRC2k6_library.lib ..\WPILib2k6.lib
MPLINK 3.90, Linker
Copyright (c) 2004 Microchip Technology Inc.
Error - symbol 'Set_Number_of_Analog_Channels' has multiple definitions.
Errors : 1
This error is caused by linking with WPILib2k6.lib and FRC2k6_library.lib in the wrong order. You can change that by going to the project settings window. Once there, select C/C++ Build, then select Settings. Under the "Tool Settings" tab, you select "MPLINK Linker" then "Linker Information". Scroll down to "Libraries included in Linking". There you can select one of the two libraries and using the up/down arrow buttons reorder them. The idea is to have the WPILib library first in the list.

The reason this happens is that there is some code in WPILib that duplicates part of the A/D code in the IFI library. If the IFI library is linked first, then both sections of code get included in the .hex file - and you see the multiple definition error.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #28   Spotlight this post!  
Unread 27-11-2007, 23:18
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: WPILib and Eclipse

Ahh, thank you. That solved it.
  #29   Spotlight this post!  
Unread 07-12-2007, 00:12
Capt. Quirk Capt. Quirk is offline
Registered User
AKA: Bill Mazzacane
FRC #1704 (Robotic Steelers)
Team Role: Mentor
 
Join Date: Aug 2007
Rookie Year: 2007
Location: SoCalif
Posts: 64
Capt. Quirk will become famous soon enoughCapt. Quirk will become famous soon enough
Re: WPILib and Eclipse

I'm stuck in the same place Sumadin & NSolarz were, in their first posts. After installation, and I am about to open my first project, there is no "project type" named "Microchip Embedded Systems" to open. I believe my mistake is also in the "path". Would someone please check these out. Thanks

From "My Computer" C:\ "System Properties" dialog box:

"User Variables for Bill"

PATH C:\MCC18\mpasm;C:\MCC18\bin;C:\MCC18\mpasm;C:\MCC1 8\bin;
TEMP %USERPROFILE%\Local Settings\Temp
TMP %USERPROFILE%\Local Settings\Temp


"Systems Variables" (I think this is the problem)

PATH C:\MCC18\mpasm;C:\MCC18\bin;C:\MCC18\mpasm;C:\MCC1 8\bin;%SystemRoot%\system32;C:\WINDOWS\System32;C: \MinGW\bin

I was using the instructions from this White Paper and then added the 2 plug-ins from "WPLib". Also I am using C18 v2.20 and the MPLAB v6.62

Thanks again

Bill

Last edited by Capt. Quirk : 07-12-2007 at 01:18.
  #30   Spotlight this post!  
Unread 07-12-2007, 01:27
Capt. Quirk Capt. Quirk is offline
Registered User
AKA: Bill Mazzacane
FRC #1704 (Robotic Steelers)
Team Role: Mentor
 
Join Date: Aug 2007
Rookie Year: 2007
Location: SoCalif
Posts: 64
Capt. Quirk will become famous soon enoughCapt. Quirk will become famous soon enough
Re: WPILib and Eclipse

Screen Shot
Attached Thumbnails
Click image for larger version

Name:	Screen Shot.gif
Views:	74
Size:	34.5 KB
ID:	5822  

Last edited by Capt. Quirk : 07-12-2007 at 01:34.
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
Eclipse Development Astronouth7303 Programming 39 16-12-2007 02:52
"Full screen mode" in Eclipse/Easy Eclipse Kelly Programming 0 15-07-2007 16:37
Direct Control of PWMs and OI in WPILib CyberWolf_22 Programming 7 06-02-2006 19:06
using eclipse dasRatsel Programming 82 02-01-2006 13:20


All times are GMT -5. The time now is 01:20.

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