Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   2007 Default Code? (http://www.chiefdelphi.com/forums/showthread.php?t=51057)

amateurrobotguy 10-01-2007 13:16

Re: 2007 Default Code?
 
Whoa, new Master Code :) Even though I don't really need to, as I only use the CMUCam Code, I will run a file difference compare on it to see what changed in the .c and .h files. I'll let y'all know what I find.

Athena 10-01-2007 13:28

Re: 2007 Default Code?
 
The default code for 2007 is now available on ifirobotics. Just look under Robot Controls and FRC Robot Controller. The new code is located at the bottom. I just downloaded it now. One question though. Is the new code for stabilizing the victors in the default code? Or is it somewhere else? I have not been able to find it.

Thanx!
Athena

P.S-I am not using Easy C

Kevin Watson 10-01-2007 13:58

Re: 2007 Default Code?
 
Quote:

Originally Posted by amateurrobotguy (Post 553148)
Whoa, new Master Code :) Even though I don't really need to, as I only use the CMUCam Code, I will run a file difference compare on it to see what changed in the .c and .h files. I'll let y'all know what I find.

Just FYI, according to IFI, there are no changes to the code other than the new master code. Version thirteen of the master code is needed for the new radio modems.

-Kevin

JamesBrown 10-01-2007 14:06

Re: 2007 Default Code?
 
Quote:

Originally Posted by Kevin Watson (Post 553174)
Just FYI, according to IFI, there are no changes to the code other than the new master code. Version thirteen of the master code is needed for the new radio modems.

-Kevin

Last night I put the 2007 controller and radios on the 2005 robot and was not able to download my code, I got a solid orange on the RC mode led even when the bot was not disabled, does any one know if this could be due to the new radio modems and not having the right master code?

dcbrown 10-01-2007 15:40

Re: 2007 Default Code?
 
2005 was different PIC18F processor (8520 if I remember correctly).
2007 controller is PIC18F 8722. If you were downloading 2005 code onto 2007 hardware that may not work correctly unless you recompile with correct settings.

Bud

dcbrown 10-01-2007 16:06

Re: 2007 Default Code?
 
Differences between 2/2006 and 1/2007 code zips

file: 18f8722.lkr not same
grp15 is now protected, wasn't in 2006

file: ifi_library.c in 2007, not in 2006(?)
LibReadMe.txt, change high priority pragma not to use shadow regs

file: README.txt
2006 update comment:
"02/20/2006
- Ifi library update." missing from 2007 file

file: user_routines.c
Default_Routine() has following added lines in 2007 base
" p1_x = 255 - p1_y;
p1_y = 255 - pwm05;"

file: user_SerialDrv.c
"static char rom2ramBufr[12];" added to 2007
Serial_Write() routine added to 2007 code base

file: user_SerialDrv.h
prototype added to 2007 code.

file: Using_a_2005_FRC.txt, file name change - was called
Using_Last_Years_FRC.txt.

file: Util_lib.asm appears to be new for 2007

file: FRC_alltimers_8722.lib now called FRC_alltimers_beta.lib

file: FRC_alltimers.lib new, added 2007.

file: FRC_Default.hex different, time stamp on 2006 is 2/28/2006, the
one for 2007 has an older timestamp of 12/13/2005.

file: FrcCode8722/FRC_default.hex dated 10/10/2005 is new in 2007 zip.

file: FRC_library.lib appears to be new file included in 2007, is
dated 10/10/2005.

file: FRC_MASTER_V12.BIN replaced with FRC_MASTER_V13.BIN

file: FrcCode.hex appears to be new file in 2007.

Astronouth7303 10-01-2007 16:40

Re: 2007 Default Code?
 
Quote:

Originally Posted by dcbrown (Post 553270)
file: user_routines.c
Default_Routine() has following added lines in 2007 base
" p1_x = 255 - p1_y;
p1_y = 255 - pwm05;"

That's strange. Anyone understand why?

amateurrobotguy 10-01-2007 17:00

Re: 2007 Default Code?
 
What was the latest version of the 2006 code? I though there was a December edition, but I only have 2-28-06 stuff. It seems like all the changes that were made were not really important--like it is a "tidy" version. I will port my code to it anyways as it does have newer .lib and .hex files. Cut and Paste --- the only thing Microsoft did right.

From the 2007 readme "This directory contains the default code for the Innovation First 2006 Full-size Robot Controller"

LOL. Maybe they should change the date ;)

amateurrobotguy 10-01-2007 17:02

Re: 2007 Default Code?
 
Quote:

Originally Posted by Astronouth7303 (Post 553299)
That's strange. Anyone understand why?

The second line of code is a joystick inverse code (Up is down, down is up). The first one would re-inverse that on the p1_x variable. I don't see any point of this.

amateurrobotguy 10-01-2007 17:16

Re: 2007 Default Code?
 
Quote:

Originally Posted by dcbrown (Post 553252)
2005 was different PIC18F processor (8520 if I remember correctly).
2007 controller is PIC18F 8722. If you were downloading 2005 code onto 2007 hardware that may not work correctly unless you recompile with correct settings.

Bud

Yes, you have to follow the "Using last year's code.txt" if you want to use 2005 on ur 2006/2007 bot.

Mike Copioli 10-01-2007 17:29

Re: 2007 Default Code?
 
Yes, exactly. Last year Dave dropped the hint that the CUMcam2 would be back, and I'm hoping teams have spent some time in the off-season working with the camera.

Quote:

Originally Posted by Kevin Watson (Post 549795)
The best thing to do at this point is to spend some time thinking about what the camera will "see" from the starting area. It's important to know a few things:

1) The camera has a very wide field of view of ~60 degrees.
2) The camera will not always "see" two lights. Recent data taken on a regulation field shows that the camera will only detect a single light if it's within about +/- 25 degrees of rotation relative to the camera.
3) If two lights are detected by the camera, the camera will return a single rectangle around both lights.
4) If only one light is detected by the camera, the number of pixels reported by the camera will be small (~10).

-Kevin

Kevin, There seems to be some confusion about this years camera code. At the kickoff we were all told that this years camera code could support multiple targets. Is this the case? And if so. How? The code on your repository appears to be no different than last years. Does the new code independantly track multiple centroids? Or does it average the independant targets to produce one centroid? From the above statement it appears that the only way to differentiate between multiple and isolated targets is by the number of pixels. If two targets are "seen" by the camera, how do you direct the camera to select one of the targets?

Joel J 10-01-2007 17:41

Re: 2007 Default Code?
 
It seems to just average the centroids of both targets (so if it finds two lights, then following the centroid sent back would have you heading towards one of the "un lighted" columns). If the pixel count indicates the presence of two targets, you would possibly have to rotate the camera to home in on only one, then track again.

edit: I'm kinda curious how this announced feature works, as well. I shouldn't speculate based only on what I've seen.

Kevin Watson 10-01-2007 18:19

Re: 2007 Default Code?
 
Quote:

Originally Posted by Mike Copioli (Post 553353)
Kevin, There seems to be some confusion about this years camera code. At the kickoff we were all told that this years camera code could support multiple targets. Is this the case? And if so. How?

Dave was referring to code written by FIRST engineering staff and included with EasyC.

Quote:

Originally Posted by Mike Copioli (Post 553353)
The code on your repository appears to be no different than last years.

The existing code already does much of the work for you. A lot of information about the state of the "rack" can be backed out of the dimensions of the blob (x1, y1, x2, y2), the blob's center of mass (mx, my), Number of color-matching pixels (pixels) and the ratio of color-matching pixels to total number of pixels (confidence) returned in the camera's t-packet. Have a look at terminal.c for a way to access the t-packet information when it arrives.

Quote:

Originally Posted by Mike Copioli (Post 553353)
Does the new code independantly track multiple centroids?

The camera cannot track multiple objects that are in view. FIRST's code does not track multiple lights.

Quote:

Originally Posted by Mike Copioli (Post 553353)
Or does it average the independant targets to produce one centroid?

The camera returns a rectangle that includes both lights, one on the left, the other on the right, and the center of mass somewhere in between. This information alone will tell you if one or two lights are visible as a single light will only light-up about ten pixels from the starting area.

Quote:

Originally Posted by Mike Copioli (Post 553353)
From the above statement it appears that the only way to differentiate between multiple and isolated targets is by the number of pixels. If two targets are "seen" by the camera, how do you direct the camera to select one of the targets?

One way is to rotate the camera until only one light is visible.

I have a few algorithms that can be used to derive the information you seek, but I'm not sure how much of the problem I should solve for teams. I've asked for guidance from the GDC on how to proceed. Until then, I'd really like to see some open discussion about this problem because it's a fun problem with a few possible solutions.

-Kevin

Mike Copioli 10-01-2007 18:29

Re: 2007 Default Code?
 
Thanks Kevin. We can figure out the rest. I just wanted to make sure I was not missing something obvious. Now I have to get MPLAB to compilke the camera code. I keep getting this linker error:

MPLINK 4.02, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - could not find file 'clib.lib'.

When I open the lib, this file is present in the directory???????

Now I use MPLAB almost every day. But I'm not quite sure how to fix this issue. I have tried several lib/linker combinations. Does this have anything to do with the fact that I am using a newer version of MPLAB 7.5?

Mike Copioli 10-01-2007 19:01

Re: 2007 Default Code?
 
MPLINK 4.02, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - Coff file format for 'C:\First2007\Code\frc_camera_s_2\camera.o' is out of date.
Errors : 1

Now I get his error????


All times are GMT -5. The time now is 23:08.

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