Go to Post You can be legal and be graciously professional, but still be dumb. - dlavery [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 07-01-2006, 14:03
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
2006 CMUcam2 Code

As was mentioned during the kick-off, we have new-and-improved, country fresh CMUcam2 code this year. There are two versions available: The "bells and whistles" version contains interactive menu code that allows you to change, on-the-fly, the camera calibration and tracking parameters and save the configuration to EEPROM. And we also have the "streamlined" no nonsense version for the minimalist crowd. Both versions can be found here: http://kevin.org/frc. If you have questions or spot a bug in the code or documentation, please post it in this forum.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org

Last edited by Kevin Watson : 07-01-2006 at 14:07.
  #2   Spotlight this post!  
Unread 10-01-2006, 21:53
CarpeDiem CarpeDiem is offline
Registered User
FRC #0135
 
Join Date: Dec 2005
Location: Indiana
Posts: 37
CarpeDiem is an unknown quantity at this point
Re: 2006 CMUcam2 Code

do you use the ifi loader to download the code to the cam via to the frc controller?
  #3   Spotlight this post!  
Unread 10-01-2006, 22:08
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: 2006 CMUcam2 Code

You don't download the program to the camera.
You basically give it a string of commands and it responds.
You could hook it to a PC and run it with Hyperterm if you
wanted.

  #4   Spotlight this post!  
Unread 11-01-2006, 23:06
maniac_2040's Avatar
maniac_2040 maniac_2040 is offline
Registered User
AKA: Matt
FRC #3302 (Turbo Trojans)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Clawson, Michigan
Posts: 34
maniac_2040 is infamous around these partsmaniac_2040 is infamous around these partsmaniac_2040 is infamous around these partsmaniac_2040 is infamous around these parts
Send a message via MSN to maniac_2040
Re: 2006 CMUcam2 Code

Quote:
Originally Posted by Kevin Watson
...If you have questions or spot a bug in the code or documentation, please post it in this forum.

-Kevin
Well I'm not sure if this is a bug that's happening with other teams, but our team (1216) has assembled our camera using the instructions provided on your site and also downloaded the most recent camera driver. The demo project that uses the camera driver keeps giving us a "Code error" (dreaded red light of death) at initialization of the controller. Only at initialization and not at a reset. When we upload and run the 2006 default code there are no errors. When we run our own code, using the serial port driver(but not the camera driver) we get the same "Code error" at initialization...is anyone else having similiar problems? This is using the 2006 controller. Thanks in advance.
  #5   Spotlight this post!  
Unread 12-01-2006, 01:32
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: 2006 CMUcam2 Code

If you recently downloaded the camera code, you may have noticed that it doesn't work. No, you're not going crazy, the code on my website was broken because the last time I built the code I forgot to change the baud rate on serial port two to the same baud rate the camera expects. To fix my gaff, open up serial_ports.c, and change line 450 to this: "SPBRG2 = BAUD_115200" and Line 452 to: "TXSTA2bits.BRGH = 1". Sorry 'bout the hassle and yes, Kevin is a doofus.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #6   Spotlight this post!  
Unread 12-01-2006, 01:57
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,386
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: 2006 CMUcam2 Code

Quote:
Originally Posted by Kevin Watson
If you recently downloaded the camera code, you may have noticed that it doesn't work. No, you're not going crazy, the code on my website was broken because the last time I built the code I forgot to change the baud rate on serial port two to the same baud rate the camera expects. To fix my gaff, open up serial_ports.c, and change line 450 to this: "SPBRG2 = BAUD_115200" and Line 452 to: "TXSTA2bits.BRGH = 1". Sorry 'bout the hassle and yes, Kevin is a doofus.

-Kevin
I just checked the version I have. Those lines already have the correct values, although they were on lines 448 and 450 respectively. have multiple versions of this code been posted on your site in the last couple of days? I think I got mine on 1/8/2006.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #7   Spotlight this post!  
Unread 12-01-2006, 02:14
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: 2006 CMUcam2 Code

Quote:
Originally Posted by billbo911
I just checked the version I have. Those lines already have the correct values, although they were on lines 448 and 450 respectively. have multiple versions of this code been posted on your site in the last couple of days? I think I got mine on 1/8/2006.
No, there was just a window where the code was messed up. I rebuilt the code after making a few comment changes to the serial port code and a tweak to the #pragma interruptlow line in user_routines_fast.c, but forgot to change serial port two's baud rate to the correct baud rate.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #8   Spotlight this post!  
Unread 12-01-2006, 06:17
X-Istence X-Istence is offline
Melt the RC controller!
AKA: Bert JW Regeer
no team
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Montville
Posts: 151
X-Istence will become famous soon enoughX-Istence will become famous soon enough
Send a message via AIM to X-Istence Send a message via MSN to X-Istence
Re: 2006 CMUcam2 Code

This is a diff between the two versions I had available in my repo, so that I could patch my current working sources. I don't gaurantee it working, but it is a straight up diff between the old and the new:

Code:
diff -urNp -x *FRC* -x .svn* -x *.lkr -x *.hex ./../FIRST/tags/FRC-StandardCode-2006-[Kevin_Watson Camera]/ifi_utilities.c ./ifi_utilities.c
--- ./../FIRST/tags/FRC-StandardCode-2006-[Kevin_Watson Camera]/ifi_utilities.c Thu Jan 12 05:56:02 2006
+++ ./ifi_utilities.c   Wed Jan  4 16:33:12 2006
@@ -27,7 +27,6 @@
 
 int             ifi_packet_num1 = 0;
 int             ifi_last_packet1 = 0;
-char            ifi_printfBufr[80];
 unsigned char   *ptr;
 unsigned char   ifi_count;
 unsigned char   ifi_analog_channels;
@@ -88,33 +87,6 @@ void PrintWord(unsigned int odata)
   TXREG = 13;  /* add a carriage return */
   Wait4TXEmpty();
 }
-
-
-/*******************************************************************************
-* FUNCTION NAME: PrintString
-* PURPOSE:       Prints a string to the serial port.
-* CALLED FROM:   anywhere
-* ARGUMENTS:     none
-*     Argument       Type             IO   Description
-*     --------       -------------    --   -----------
-*     bufr           pointer          I    word of data to be transmitted
-* RETURNS:       void
-*******************************************************************************/
-void PrintString(char *bufr)
-{
-  static int len,I;
-    
-  strcpypgm2ram (ifi_printfBufr,(rom char *) bufr); /*Move from flash to ram*/
-  len = (int) strlen((const char *)ifi_printfBufr);
-  if (len > 80) len = 80;
-
-  for (I=0;I<len;I++)
-  {
-    TXREG = ifi_printfBufr[i];
-    Wait4TXEmpty();
-  }
-}
-
 
 /*******************************************************************************
 * FUNCTION NAME: DisplayBufr
diff -urNp -x *FRC* -x .svn* -x *.lkr -x *.hex ./../FIRST/tags/FRC-StandardCode-2006-[Kevin_Watson Camera]/ifi_utilities.h ./ifi_utilities.h
--- ./../FIRST/tags/FRC-StandardCode-2006-[Kevin_Watson Camera]/ifi_utilities.h Thu Jan 12 05:56:02 2006
+++ ./ifi_utilities.h   Wed Jan  4 16:33:46 2006
@@ -74,7 +74,6 @@ void Generate_Pwms(unsigned char pwm_1,u
 void Wait4TXEmpty(void);
 void PrintByte(unsigned char odata);
 void PrintWord(unsigned int odata);
-void PrintString(char *bufr);
 void DisplayBufr(unsigned char *bufr);
 void PacketNum_Check(void);
 void Initialize_Serial_Comms (void);
diff -urNp -x *FRC* -x .svn* -x *.lkr -x *.hex ./../FIRST/tags/FRC-StandardCode-2006-[Kevin_Watson Camera]/readme.txt ./readme.txt
--- ./../FIRST/tags/FRC-StandardCode-2006-[Kevin_Watson Camera]/readme.txt      Wed Dec 31 19:00:00 1969
+++ ./readme.txt        Mon Oct 10 14:26:42 2005
@@ -0,0 +1,65 @@
+This directory contains the default code for the Innovation First 2006 Full-size Robot Controller.
+
+To compile this code you must have Microchip's MPLAB IDE (v7.2) with their C18 compiler (v2.4) installed on your system.
+
+If you wish to restore your Full-size Robot Controller to the default functionality as shipped from the factory, use the IFI Loader application to download the FRC_default.hex file to your Robot Controller.
+
+CAUTION:  Do not relocate this FrcCode directory very deep in your directory tree.  This is because the Microchip compiler has a 64 character path/filename limit.  We suggest placing it in a directory named C:\mcc18\Projects\
+
+Notes:
+Use FRC_library.lib (default) if you plan to use the Generate_Pwms() function.  This uses Timer0 to synchronize any PWM outputs generated by the User processor to make sure they avoid any SPI interrupts.
+If you want to use Timer0 yourself, then you can replace FRC_library.lib with FRC_alltimers.lib in the project.
+
+
+www.InnovationFirst.com
+10/10/2005
+-   Added a checksum to the breaker panel packet
+-   now using <stdio.h>, compiler needs -nw=2066 to suppress warnings (under project->build options->project->MPLAB C18->Use Alternate Settings)
+-   Note:  when using a 'printf' use a '\r' rather than a '\n' with the C18 compiler (v2.4 or later) 
+
+11/12/2004
+-   Added user_SerialDrv.c - device driver for the uart
+-   Added code to handle packets from the breaker panel
+
+2/26/2004
+- ifi_aliases.h
+    Changed "competition_mode" alias to "disabled_mode" to be more accurate.
+    Added comment explaining that this bit is 1 when the RC is disabled.
+- ifi_default.h
+    Corrected comment regarding "disabled" bit.  This bit is 1 when disabled.
+
+2/24/2004
+- user_routines_fast.c
+    Added interrupt enable check to interrupt service routine to ensure that disabled interrupts are not serviced.
+    Also all PWM and Relay outputs are initialized to neutral when entering Autonomous.  This fixes a problem where the last PWM values are remembered and stuck throughout Autonomous mode when switching from Disabled to Autonomous.
+- ifi_aliases.h
+    Added aliases for the CCP pins (PWM OUTPUTS 13-16).
+    These can be used as digital outputs (not inputs) when properly configured.
+- README.txt (this file) 
+    Added recommended directory for code placement.
+
+
+2/18/2004
+- ifi_aliases.h
+    Swapped relayX_fwd and relayX_rev aliases.
+    Added a note that the REV/FWD labels on the Robot Controller are incorrect.
+- FRC_default.hex
+    Recompiled to reflect the correct relay behavior (swapped FWD/REV).
+
+2/10/2004
+- user_routines_fast.c
+    Added Generate_Pwms() function call to User_Autonomous_Code.
+- 18f8520user.lkr
+    Removed debug section of program memory.  Now User code can go all the way up to 0x7FFF.
+- FRC_library.lib and FRC_alltimers.lib
+    Now configure TTL Serial Port (USART2) RX2 pin as an input by default.
+
+1/29/2004
+- user_routines.c
+    Corrected Limit Switch section by removing NOT (!) from inputs.
+- ifi_aliases.h
+    Corrected User_Byte1 and User_Byte2 aliases.
+    Added TTL Serial Port aliases.
+
+1/8/2004
+- Initial Release
diff -urNp -x *FRC* -x .svn* -x *.lkr -x *.hex ./../FIRST/tags/FRC-StandardCode-2006-[Kevin_Watson Camera]/serial_ports.c ./serial_ports.c
--- ./../FIRST/tags/FRC-StandardCode-2006-[Kevin_Watson Camera]/serial_ports.c  Thu Jan 12 05:56:02 2006
+++ ./serial_ports.c    Wed Jan 11 22:10:44 2006
@@ -4,7 +4,7 @@
 *
 *      VERSION:        0.4 (Beta)                           
 *
-*      DATE:           05-Jan-2006
+*      DATE:           10-Jan-2006
 *
 *      AUTHOR:         R. Kevin Watson
 *                              kevinw@jpl.nasa.gov
@@ -144,6 +144,8 @@
 *      05-Feb-2005  0.3  RKW - Added _user_putc() interface to C18's new output
 *                        stream capabilities. Updated documentation.
 *      05-Jan-2006  0.4  RKW - Partial port to 18F8722. Updated documentation.
+*      10-Jan-2006  0.4  RKW - Modified the #pragma interruptlow line to also
+*                        save the .tmpdata section.
 *
 *******************************************************************************/
 #include <p18f8722.h>
diff -urNp -x *FRC* -x .svn* -x *.lkr -x *.hex ./../FIRST/tags/FRC-StandardCode-2006-[Kevin_Watson Camera]/serial_ports.h ./serial_ports.h
--- ./../FIRST/tags/FRC-StandardCode-2006-[Kevin_Watson Camera]/serial_ports.h  Thu Jan 12 05:56:02 2006
+++ ./serial_ports.h    Tue Jan 10 21:22:08 2006
@@ -4,7 +4,7 @@
 *
 *      VERSION:        0.4 (Beta)                           
 *
-*      DATE:           05-Jan-2006
+*      DATE:           10-Jan-2006
 *
 *      AUTHOR:         R. Kevin Watson
 *                              kevinw@jpl.nasa.gov
@@ -29,6 +29,8 @@
 *      05-Feb-2005  0.3  RKW - Added _user_putc() interface to C18's new output
 *                        stream capabilities. Updated documentation.
 *      05-Jan-2006  0.4  RKW - Partial port to 18F8722. Updated documentation.
+*      10-Jan-2006  0.4  RKW - Modified the #pragma interruptlow line to also
+*                        save the .tmpdata section.
 *
 *******************************************************************************/
 #ifndef _SERIAL_PORTS_H
diff -urNp -x *FRC* -x .svn* -x *.lkr -x *.hex ./../FIRST/tags/FRC-StandardCode-2006-[Kevin_Watson Camera]/serial_ports_readme.txt ./serial_ports_readme.txt
--- ./../FIRST/tags/FRC-StandardCode-2006-[Kevin_Watson Camera]/serial_ports_readme.txt Thu Jan 12 05:56:02 2006
+++ ./serial_ports_readme.txt   Tue Jan 10 21:17:20 2006
@@ -16,9 +16,10 @@ on-board serial ports. This software is 
 designed to work with the output stream functions included 
 with Microchip's C18 C compiler version 2.4  
 
-The source code in serial_ports.c/.h will work with the 
-Robovation (A/K/A EDU-RC) robot controller and the FIRST 
-Robotics robot controller without modification.
+This source code will work with the PIC18F8520-based FIRST 
+Robotics robot controller, the PIC18F8722-based FIRST Robotics
+robot controller, and the Robovation (A/K/A EDU-RC) robot 
+controller.
 
 Because you can now easily receive data from another computer, 
 you can interact with your nifty IFI robot controller in real-
@@ -137,7 +138,7 @@ correctly:
   1a) FRC-RC: As this software is intended to replace IFI's
   serial port driver, the call to Serial_Driver_Initialize()
   in user_routines.c / User_Initialization() should be 
-  removed or commented out.    In addition, all references to
+  removed or commented out. In addition, all references to
   "user_Serialdrv.c" and "user_Serialdrv.h" must be removed 
   from the project and all project source files.
 
@@ -211,7 +212,7 @@ correctly:
 This serial port driver can send output stream data to either 
 of the serial ports by setting the value of the global variable
 stdout_serial_port before calling output stream        functions like
-printf(). Setting the value    to "SERIAL_PORT_ONE" will send the 
+printf(). Setting the value to "SERIAL_PORT_ONE" will send the 
 output to serial port one. Likewise, setting the value to 
 "SERIAL_PORT_TWO" will send the output to serial port two. 
 Setting the value to "NUL" will send the output to the null 
diff -urNp -x *FRC* -x .svn* -x *.lkr -x *.hex ./../FIRST/tags/FRC-StandardCode-2006-[Kevin_Watson Camera]/user_routines_fast.c ./user_routines_fast.c
--- ./../FIRST/tags/FRC-StandardCode-2006-[Kevin_Watson Camera]/user_routines_fast.c    Thu Jan 12 05:56:02 2006
+++ ./user_routines_fast.c      Tue Jan 10 21:47:04 2006
@@ -55,7 +55,7 @@ void InterruptVectorLow (void)
 * RETURNS:       void
 *******************************************************************************/
 #pragma code
-#pragma interruptlow InterruptHandlerLow save=PROD /* You may want to save additional symbols. */
+#pragma interruptlow InterruptHandlerLow save=PROD,section(".tmpdata")
 
 void InterruptHandlerLow ()     
 {
__________________
My Blog!
  #9   Spotlight this post!  
Unread 12-01-2006, 17:52
maniac_2040's Avatar
maniac_2040 maniac_2040 is offline
Registered User
AKA: Matt
FRC #3302 (Turbo Trojans)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Clawson, Michigan
Posts: 34
maniac_2040 is infamous around these partsmaniac_2040 is infamous around these partsmaniac_2040 is infamous around these partsmaniac_2040 is infamous around these parts
Send a message via MSN to maniac_2040
Unhappy Re: 2006 CMUcam2 Code

Quote:
Originally Posted by Kevin Watson
If you recently downloaded the camera code, you may have noticed that it doesn't work. No, you're not going crazy, the code on my website was broken because the last time I built the code I forgot to change the baud rate on serial port two to the same baud rate the camera expects. To fix my gaff, open up serial_ports.c, and change line 450 to this: "SPBRG2 = BAUD_115200" and Line 452 to: "TXSTA2bits.BRGH = 1". Sorry 'bout the hassle and yes, Kevin is a doofus.

-Kevin
...Still doesn't work, even after making those changes. Not every single time, but often, there's a code error at initialization. Sometimes its more often than others, there's no real pattern as to how/when it comes, except that it only happens at the first power up(not a reset). Has the camera code been tested? It's not only the camera code though, it doesnt work even when I have the camera drive disabled. I turned off all of our software features except for the serial drive and I still get this 'random' code error....anyone else having this problem?
  #10   Spotlight this post!  
Unread 12-01-2006, 18:00
Vashts6583's Avatar
Vashts6583 Vashts6583 is offline
The sleepless
AKA: Rob Metzger
FRC #0007 (Team 007)
Team Role: Leadership
 
Join Date: Dec 2004
Rookie Year: 2005
Location: Parkville
Posts: 79
Vashts6583 is a name known to allVashts6583 is a name known to allVashts6583 is a name known to allVashts6583 is a name known to allVashts6583 is a name known to allVashts6583 is a name known to all
Send a message via ICQ to Vashts6583 Send a message via AIM to Vashts6583 Send a message via MSN to Vashts6583 Send a message via Yahoo to Vashts6583
Angry Re: 2006 CMUcam2 Code

look. i don't know jack squat on all of this, and i know this may not be the right thread to post this in, but I'm getting severely disappointed in my team in the fact that all they seem to be doing is yelling at each other and not being very smart about it. i don't mind the argument, but they're all being immature about it.

anyway, i have two questions regarding the camera and the sensor.

Question 1: I don't exactly understand how they want us to build a mock-up sensor target like the one they have on the field. I have the "instructions" (aka, the .pdf file), but I do not understand what the heck some of these pieces look like, how they're supposed to be connected to the base plate, etc.

Question 2: I like the fact that we have code, but what after calibrating the camera, what files would I need to add to the main workspace (MPLab IDE C18) that I am using for the robot?

Question 3 (ties in with question 2): Proving to the world the fact that I am a n00b programmer, how would I be able to re-program the code for the servos for another type of motor? I know that the code for servos differs from that of say a fisher price or a globe motor.

Any assistance is greatly appreciated, and please, pray for my sanity ..
__________________
/*********************
2005: Software Assistant
2006: Software Head
2007: President/Driver/Software Head/Temporary Safety Captain
*********************/

//2005: Chesapeake Regional - Finalist


Life is what you do outside of FIRST. No wonder it's so short.
  #11   Spotlight this post!  
Unread 14-01-2006, 03:41
Joe Hershberger Joe Hershberger is offline
National Instruments
AKA: jhersh
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 1997
Location: Austin, TX
Posts: 148
Joe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to all
Re: 2006 CMUcam2 Code

Quote:
Originally Posted by Vashts6583
Question 2: I like the fact that we have code, but what after calibrating the camera, what files would I need to add to the main workspace (MPLab IDE C18) that I am using for the robot?
Well, it would appear that at first glance the "streamlined" version of the camera software will be the most useful for use on a live robot. In that code you'll find a header file called camera.h. It should contain a whole string of constants that configure the camera. You can use the LabView CMU camera app posted in this thread to test the camera and figure out just what parameters you'de like to use. Then plug those numbers into the header file, and you should be good to go.

Quote:
Originally Posted by Vashts6583
Question 3 (ties in with question 2): Proving to the world the fact that I am a n00b programmer, how would I be able to re-program the code for the servos for another type of motor? I know that the code for servos differs from that of say a fisher price or a globe motor.
As for replacing a servo with a different type of motor, that is a bit of a challenge. Servos have internal feedback which allows you to tell it to go to a particular position. You may notice that if you have a servo powered and you try to turn it, it fights back to keep the position the same. The servo just has a small motor inside, a controller, and a sensor for feedback. If you want a globe or fisher price motor to act like a servo, then you need those other two components. You can use a sensor like the Gear Tooth Sensor included in the kit as your feedback. For the controller, you can use the FRC and write software! The motor controllers that have available, (victors, and of less usefulness, the spikes) only control the speed of the motors, not the position. This is because they don't know where they are, and therefore don't know where to go from there (where?). Hopefully the servos will work for you, but if not, it's possible to use other motors instead. It's just a lot more work. If you decide you do need a controller and motors, do some research/googling for PID control. It's a pretty straight forward method of control that gives good results. There's probably even code floating around out there if you look hard enough.

Good luck!!

-Joe
  #12   Spotlight this post!  
Unread 14-01-2006, 12:46
Cuog's Avatar
Cuog Cuog is offline
Registered Linux User: 390661
AKA: Alex
FRC #0422
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2004
Location: Richmond, Virginia
Posts: 852
Cuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond repute
Send a message via AIM to Cuog
Re: 2006 CMUcam2 Code

I have been using the camera_s downloaded from your site and i have a quick question as to how can i tell if the camera is searching for the green or if it is following it.
__________________
KK4KQO
http://voltair.us
Too many projects, too little time.
  #13   Spotlight this post!  
Unread 14-01-2006, 12:54
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: 2006 CMUcam2 Code

Quote:
Originally Posted by Cuog
I have been using the camera_s downloaded from your site and i have a quick question as to how can i tell if the camera is searching for the green or if it is following it.
If it's searching, the pan/tilt servos are swinging the camera around in the hope it can find the green thing. It also should say:

Searching...
Searching...
Searching...
Searching...
Searching...
...

on your terminal screen. If it's actively tracking, the camera will be pointed at the green thing, the little red LED on the camera should light up and you should be getting some statistics dumped onto your terminal screen.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #14   Spotlight this post!  
Unread 14-01-2006, 13:27
Cuog's Avatar
Cuog Cuog is offline
Registered Linux User: 390661
AKA: Alex
FRC #0422
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2004
Location: Richmond, Virginia
Posts: 852
Cuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond repute
Send a message via AIM to Cuog
Re: 2006 CMUcam2 Code

sorry i meant in code how do i tell, i am planning a function that needs to know if the camera has a target
__________________
KK4KQO
http://voltair.us
Too many projects, too little time.
  #15   Spotlight this post!  
Unread 14-01-2006, 13:39
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: 2006 CMUcam2 Code

Quote:
Originally Posted by Cuog
sorry i meant in code how do i tell, i am planning a function that needs to know if the camera has a target
Have a look at the code in terminal.c. Also keep in mind that just because the camera sees the green light doesn't necessarily mean it's pointed at it. The answer to this dilemma is also in terminal.c.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
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
Out of the Box Camera Code russell Programming 9 21-10-2009 05:28
CMUCam2 code (FRC and EDU?) Amber Programming 0 15-02-2005 22:23
Team THRUST - Kevin's Code and Camera Code Combine Chris_Elston Programming 3 31-01-2005 22:28
CMUCam2 Camera Code - Are important parts commented out? Mr. Lim Programming 4 14-01-2005 12:11
heres the code. y this not working omega Programming 16 31-03-2004 15:18


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

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