![]() |
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 |
Re: 2006 CMUcam2 Code
do you use the ifi loader to download the code to the cam via to the frc controller?
|
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. :) |
Re: 2006 CMUcam2 Code
Quote:
|
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 |
Re: 2006 CMUcam2 Code
Quote:
|
Re: 2006 CMUcam2 Code
Quote:
-Kevin |
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 |
Re: 2006 CMUcam2 Code
Quote:
|
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. :mad: i don't mind the argument, but they're all being immature about it. :mad:
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. :confused: 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 .. :( |
Re: 2006 CMUcam2 Code
Quote:
Quote:
Good luck!! -Joe |
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.
|
Re: 2006 CMUcam2 Code
Quote:
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 |
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
|
Re: 2006 CMUcam2 Code
Quote:
-Kevin |
Re: 2006 CMUcam2 Code
k thanks time to search,
Cuog |
Re: 2006 CMUcam2 Code
My team is having some problems using the camera code. When we used the code that came with the controller, we were able to get the LEDs to light up for y movement on the joystick, as well as the trigger and thumb button. When we loaded on the camera code, though, none of those did anything. We loaded on the default code provided at IFI's website, and that fixed things, but we can't use the camera with just that code. Any idea what we're doing wrong? The user_routines.c files look the same, so I don't understand why the joystick wouldn't work.
|
Re: 2006 CMUcam2 Code
in the method: Proccess_Data_From_Master_uP(), make a call to Default_Routine, then in Default_Routine comment out the pwm assignment for pwm01 and 02 and you're good to go, i spent all day trying to fix this and hit my head against the wall when i got it.
|
Re: 2006 CMUcam2 Code
Quote:
|
Re: 2006 CMUcam2 Code
Quote:
|
Re: 2006 CMUcam2 Code
Quote:
Code:
// By default, PWM output one is used for the pan servo. |
Re: 2006 CMUcam2 Code
I don't know if this has been answered in one of the above posts or somewhere, but does the camera code (the one for MPLab) interfere with other code that we programmers add in? I can't get any of my personal code, including printfs, to work even though all the camera code works perfectly fine, including printfs. Is there something I'm supposed to edit before I can edit the default code and have it work?
|
Re: 2006 CMUcam2 Code
The call to Default_Routine() is commented out in the camera code. If that's where you're putting your own programming, you now know why it doesn't seem to be doing anything. :)
Uncomment it and your code should run. |
Re: 2006 CMUcam2 Code
Quote:
Thanks, I hope I'm not repeating someone. |
Re: 2006 CMUcam2 Code
Quote:
-Kevin |
Re: 2006 CMUcam2 Code
Quote:
Code:
MPLINK 3.94, LinkerCode:
MPLINK 3.94, LinkerI HATE MP BLOB |
Re: 2006 CMUcam2 Code
Quote:
-Kevin |
Re: 2006 CMUcam2 Code
Quote:
What is the .map file and where can I find it? Thanks, Paul |
Re: 2006 CMUcam2 Code
Quote:
-Kevin |
Re: 2006 CMUcam2 Code
Code:
MPLINK 3.94, LinkerThanks |
Re: 2006 CMUcam2 Code
user_routines seems to be the largest so anticipating a request for it here it is:
Code:
/******************************************************************************* |
Re: 2006 CMUcam2 Code
Found the little sucker. I practically tore down the building with my screams of joy.
unsigned char lookTable[255] was causing a problem. I guess if I want that, I need to give it values from the start. That'll be a pain. Am I right about this fixing my problem? It allowed it to compile. |
Re: 2006 CMUcam2 Code
Quote:
-Kevin |
Re: 2006 CMUcam2 Code
The linker will only allow you to define a total of 256 bytes of global (or static) variables within any single project file. Individual routines within a file, such as user_routines.c, are each limited to 120 bytes of local variables.
If you want to create lookupTable[256], it'll need to be defined in another file off by itself and referenced from user_routines.c as an extern. Or as you implied define all the values up front and make it a rom const, then you can be as large as you have program space for. |
Re: 2006 CMUcam2 Code
Quote:
making it this Code:
final unsigned char lookTable[255] = {1,2,3,4,5,6...254};I wish I weren't taking Java, I get confused. in Java class I write printf s and in FRC I write System.out.println s. Anyway, thanks again for all the help and valuable instruction (and timely responses!) Paul |
Re: 2006 CMUcam2 Code
The C18 syntax (well, except for the ... part) is:
Code:
rom const unsigned char lookTable[256]={0,1,2,3,4,...255}; |
Re: 2006 CMUcam2 Code
Quote:
|
Re: 2006 CMUcam2 Code
Kevin,
Thank you very much for you elegant camera code. Took me a while to undertand it all, being I've never used "C" in my entire life (I'm an old time legacy mainframe assembly programmer). We do have it installed and running quite nicely. HOWEVER after reading camera.c, I see where you are performing all the nice initialization for the camera, and you are setting quite a few registers. Unfortunately, no where can I find the documentation for all those registers and what their value(s) actually mean. I have the CMUCAM documents from FIRST and a few others and it only has registers 5-6, 17-19 and vaguely defined, do you have more detailed specs, or know where I can get them? Thanks |
Re: 2006 CMUcam2 Code
Quote:
-Kevin |
Re: 2006 CMUcam2 Code
Thank you very much... Just don't ask me why I didn't think to look at your sight first. LOL! Again many thanks.
|
Re: 2006 CMUcam2 Code
With my teams CMU cam, I have run the CMU Cam GUI, and the GUI says that it is "searching for the camera" but it never finds the camera, therefore the camera cannot be calibrated. Does anybody know what to do in this situation?
|
Re: 2006 CMUcam2 Code
Quote:
Cheers! -Joe |
Re: 2006 CMUcam2 Code
We at team 533 are seeing two distinct intermittent startup error conditions that are unique to the frc_camera_s code. (haven't spent much time with the bells-and-whistles version). These are problems that do not occur with the IFI default code. The camera code we are using is the 1/11/2006 10:45 PM date stamp.
When the RC starts up correctly (about 90% of the time), the camera handler and servo tracker work perfectly. With the default_routine() call uncommented, we are also able to control other PWM putputs from the joysticks, etc. The other 10% of the time we get one of two kinds of errors. The first error is the "Code Error", similar to that reported by team 1216. The Code error only occurs at power-up, not after hitting a reset. When we see a Code Error, a robot reset clears the error. The second error, far more disturbing than the "Code Error" condition, is one in which there is no code error but the data the user uP receives from the master is corrupted - for example Joystick 1 X and Y data fields are reversed. The disturbing thing about this condition is that everything looks normal on the RC LED's so we would not know the problem is happening until the match starts. Also, the RC does not recover from this case by pressing the reset button. Only cycling power (and waiting another 5 seconds if the backup battery is connected) clears the problem. I disabled Tracking_Info_Terminal(), Camera_Handler() and Servo_Track() in Process_Data_From_Master_uP() and still get the startup errors. I spoke to Tom Watson at IFI and he said that if we can't duplicate this with the IFI default code then it must be something in the camera code. Any help would be appreciated. Thanks in advance. |
Re: 2006 CMUcam2 Code
You mention that the joystick x and y are inverted. Did you determine by checking the joystick x/y values and/or motor PWM variables via the dashboard or terminal window, or are you determining this because the robot is acting funny?
On Tuesday we discovered that PWMs 13,14,15, and 16 (i.e. the bit-banged PWMs) do not work with the default camera code. The interrupts in the camera code occasionally stretch the pulse widths causing the robot to jump around a bit. |
Re: 2006 CMUcam2 Code
The X and Y values were reversed, not inverted. I was using the "example printf" line in the default code that sends out p1_y, pi_x, p1_trig, and p1_top to the serial port for diagnostic purposes. In the fault condition, the X and Y values are reversed and I am getting garbage for p1_trig and p1_top as well, causing their associated relay outputs to go crazy.
|
Re: 2006 CMUcam2 Code
Quote:
-Kevin |
Re: 2006 CMUcam2 Code
It sounds like the problem is with communication, and most of that is handled by the master processor. Reloading the master processor firmware is worth a try.
|
Re: 2006 CMUcam2 Code
Thanks - I'll give 'er a try and let you know what happens.
Quote:
|
Re: 2006 CMUcam2 Code
Tried reloading master.bin, to no avail.
Quote:
|
Re: 2006 CMUcam2 Code
Our controller is en route to IFI as we speak. A swap was not possible; we're taking downtime and focusing on mechanical issues until we get our controller back.
Before sending it back I ran some more tests and made an interesting observation - I placed a light duty Pep Boys automotive switch in series with the HI-AMP circuit breaker and used the switch to turn the controller on and off. Still seeing intermittent failures but significantly less often than when powering up and down with the breaker. These observations were made with the 7.2 backup battery out of the equation. The only difference I can think of is the contact bounce characteristics of the switch versus the HI-AMP breaker. I looked at the turn-on transient of the breaker and the switch on a scope. They each exhibit about 5 ms of contact bounce before finally settling out to +12V. Tom at IFI thinks what I saw was coincidence. Wierd problem. Time will tell what the cause is. |
Re: 2006 CMUcam2 Code
the camera code is being a pain. tell us kevin, what could we edit so that the camera can scan smoothly instead of quick jolt-stop-quick jolt-stop, and so forth? just what was the purpose of having the camera being able to look directly at the ground.
|
Re: 2006 CMUcam2 Code
you can edit the tracking portion of tracking.c I changed ours to track smoothly and it first tracks where i tell it to(where i predict the light) then it searches a wider pattern until it finds the light
|
Re: 2006 CMUcam2 Code
We are having the same problems with the camera_s code as team 533. Except, the code fault on powerup occurs almost 95% of the time, and this is fixed with a reset. Also, instead of the p1_y and the p_1x being switched, the joystick's y axis is being read as p1_x in the controller and the joystick's x-axis and throttle are unresponsive. The joystick's buttons are also giving very flaky values, even when not pressed. We are watching these values with a printf in the Process_Data_From_Master_uP function with an otherwise fresh copy of the camera_s code that is dated 1/14/06.
|
Re: 2006 CMUcam2 Code
When we hit the reset button and the code error goes away, the p1_y still gets read as p1_x. Do you see the same?
It makes a difference how you power up the controller. We placed a toggle switch between the fuse panel and the RC. Sure enough, the power-up fault occurs much less often (but still happens occasionally) when we use the switch to turn the controller on. I think the difference is in the contact bounce of the switch vs the circuit breaker. Your description of the joystick's p1_y being read as p1_x is exactly what we're getting; my previous statement that x and y were reversed was inaccurate. I sent our controller back to IFI and they claim they cannot duplicate the problem at IFI. I spoke to Mark Lambert IFI's RC digital/software guru. He can't identify a mechanism that would explain what we're seeing. Since it does not happen with the IFI default code, they will not spend much time investigating. The only software they "support" is the IFI default code. Mark did give me some information that might help. The "reserved" word in the rxdata structure always contains the number 12, which is the firmware revision number for the master uP. When the rxdata gets misaligned (p1_y read as p1_x, etc), the reserved word will probably be wrong too. I can use this to detect the error, go into an infinite loop, and force the RC to crash. This way we can tell by looking at the RC LED's that something is wrong and try recycling power. Yes, it's just a band-aid but we don't have time to dig in and find the root cause. |
Re: 2006 CMUcam2 Code
Kevin,
Here is a follow up to my initial post on startup errors. Suspecting a questionable RC, I did the following: 1. Loaded unmodified hex file from the latest frc_camera_s release 2. Verified that we still see the intermittent code error 3. Sent the controller back to IFI. Tom Watson and Mark Lambert cycled power on the controller at IFI 150 times (75 with the backup battery and 75 without the backup battery) and they claim they can't duplicate the problem. Since then, another team, 1566, has reported the exact same problem on this forum. I have noticed that, strangely enough, when using a toggle switch instead of the HI-AMP kit breaker to power the RC up, the error becomes far less frequent. Any ideas? Thanks in advance. |
Re: 2006 CMUcam2 Code
You might try dumping the entire rx packet to a file so you can do a full compare of good packets against the bad packets. There may be further clues in what's getting corrupted. Since it may be one dropped value at the start causing a shift in all the other packet values (possibly double 255's?).
It would be handier if you have a OI pot/switch box to preset known values to make the proper contents more readily identifiable. I'll see if I can reproduce the errors you guys are seeing on our 2006 RC this evening. That'll give it third party confirmation. |
Re: 2006 CMUcam2 Code
Quote:
-Kevin |
Re: 2006 CMUcam2 Code
If you can replicate the problem on your RC then you will be the fourth team to my knowledge that has seek the problem first hand.
If you can try just loading the hex file from frc_camera_s (which can be found on http://www.kevin.org/frc) and try a few power cycles and let me know what you find it would be a tremendous help. I'm going to try the full packet dump idea this afternoon at the school. Quote:
|
Re: 2006 CMUcam2 Code
Once the corrupt data problem (p1_y being read as p1_x, etc), the reset button does not clear the problem; nothing works except cycling the power off and back on. I have not tried powering up with the reset button pressed as you suggested; I'll try that idea tonight at the school.
Another thing I will try is to put a cheap and dirty delay loop ahead of IFI_Initialization to stall the user processor for a few tenths of a millisecond after a reset. When I post an observation here at Delphi it is typically based on a collection of 50 trials or more. Quote:
|
Re: 2006 CMUcam2 Code
We have explored the problem a little more fully today and have found a few more details:
Powering up the robot with the reset button depressed, then releasing it, still results in a code fault. The processor results in a code fault only when the controller has been off for more than 5 seconds after running for more than a few minutes. We did some extensive testing and timing and a power cycle (with the breaker, not the reset button). When the processor has not been on as long, more time powered down is required to reproduce the code fault. We could not reproduce the code fault at all by holding down the reset button for an extended period of time (about a minute). Along with joystick 1's y-axis being mapped to p1_x, we have also noticed that joystick 3's x-axis is being mapped to p1_y. We have not yet explored all of the oi input mappings, but we will post it when we do. We also found that when we powered up the rc without a radio modem or tether connected, the program does not fault. When we reconnect the radio modem the program will fault again, but only after the processor has been powered down for a varrying period of time. Whether the code faults on startup or not, the OI input mappings are still messed up. This is all we have found so far. I will continue our exploration of the problem tomorrow and post anything new. |
Re: 2006 CMUcam2 Code
I have tried working with the camera GUI's (java and labview programs) and neither of them work. The java program freezes when i try to change a setting, and it always fails when i try to do a frame grab. The labview program gives me a crash message on startup. I am totally lost! :confused:
If anyone could give me a hand, it would be a big help. Thanks. |
Re: 2006 CMUcam2 Code
No luck (questionable usage I suppose) duplicating your issues with our RC.
I did power cycles of each of the following variations with preset values through Port 1. Tests were split between using the as-is default frc_camera_s camera.hex and a version modified to include Default_Routine() and a dump of the rx packet. I usually cycled rather quickly, restarting after a 10-count, but tried some varying time spent powered up and resting afterwards.
If you're up for a road trip Neil (maybe hard for the Alberta and Idaho folks) and think it could be beneficial you are welcome to try your code and tests on our 2006 RC and we can swap in various cameras as well. Try dropping by a nearby team and repeating your tests. |
Re: 2006 CMUcam2 Code
Here's what we found Thursday night
(1) Same observation on powering up with reset depressed. Doesn't seem to make a difference. (2) Tracing program flow with printf statements sprinkled throughout Process_Data_From_Master_uP(), we see that it always executes successfully the first time through. (a) In the no-fault case, Process_Data_From_Master_uP() continues to get called like clock work (b) In the CODE ERROR case, Process_Data_From_Master_uP() only gets called once. (or possibly it continues to get called but the printf's stop because of a serial port hangup) (c) In the garbled rxdata case, the first packet comes in OK but from the second packet forward the OI mappings are corrupted. Data fields are always mis-aligned in the same fashion but it's not as simple as a byte shift. I have incorporated a trap that detects five consecutive packets with 127 in the packet_num field and goes into an infinite loop if this occurs. This forces a code error if the rx packets are corrupted so we know to re-cycle the power. I plan to further refine the logic to only enable the trap during the first few cycles; once we get off to a good start we seem to run OK till the next power-up. Does your RC ever come up OK with proper OI mappings? Neil Quote:
|
Re: 2006 CMUcam2 Code
I tried holding the reset button while powering up. Still getting random code errors.
I sprinkled some printf's into Process_Data_From_Master_uP - one at the beginning of the module, one to print out the entire rxdata buffer, and one at the end of the module. When the code error occurs I am observing that Process_Data_From_Master_uP executes one time. When the mis-aligned rx buffer problem occurs, it looks like it's happening from the second message on; the first rxbuffer received after initialization looks OK. I also tried a simple delay loop before IFI_Initialization to give the oscillator a few tenths of a second to stabilize before trying to do anything. This did not help either. Another programmer from Team 358 loaded frc_camera_s on his RC and could not find a problem. I tend to believe there is a marginal timing problem somewhere that just doesn't occur with all RC's and does not occur with IFI default code. For now, my work-around is going to be: (1) if the LED's show a code error, cycle power and (2) if the packets get misaligned, trap on a lack of proper incrementation of packet_num and force a code error via an infinite loop, taking us back to step 1. This trap can be disabled after five consecutive good packets since the RC seems to behave OK once it gets off to a good start. Quote:
|
Re: 2006 CMUcam2 Code
ELATION!
The whole time we were trying to get the drive system working, we did not have the camera hooked up. Today I finally tried hooking up the camera while controlling drive. It worked. Silly me, I didn't realize that this code requires the camrea be connected... Once we hooked up the camera, we reduced our fault frequency to about 1 in 5 powerups as opposed to almost every time. To fix this, we connected a SPST bat-handle toggle switch in series with the power connection to the RC. After doing that, we have not had the processor fault at all. Hopefully this information can help any of you in fixing your problems. |
Re: 2006 CMUcam2 Code
Thanks for the tests and the offer to let us try our code on your RC.
Looks like I we're going to use the RC the way it is. IFI looked at it and said they can't find anything wrong. So whatever I find from this point looking forward, I'm stuck with it the way it is. I agree that it's a subtle timing flaw that does not manifest itself with the default code. I don't even think it happens on all RC's. (yours does not seem to have the problem) I came up with a test that waits for the first 16 packets to come in, verifies that the packet_num increments for the 11th through the 16th consecutive packets. (I noticed that on startup, with the OI getting its power through the tether cable, the packets don't start incrementing regularly until after the tenth packet.) Once this test passes, I never see a failure in the RC. If the test fails, I go into a trap that forces a code error. Now we always get either a good start or a code error, never a bad start that looks like everything is fine. Quote:
|
Re: 2006 CMUcam2 Code
Programmers from our team have reported similar observations.
I have not yet had a chance to help them investigate. This is a real shot from the hip, but here goes anyway. Default code does not turn on interrupt handling for serial communications to/from the camera. What about an interrupt processing issue? Does the UART have a funny state on power up (only some of the time)? Does the power up of the camera enter into the problem? Camera first then RC. RC first then Camera. Does this change the situation? How does data get from the master microprocessor to the user microprocessor? DMA, Dual ported ram, serial ???? How can the camera code affect this? |
Re: 2006 CMUcam2 Code
Hi There,
We seem to be having the same problem. Quote:
Quote:
|
Re: 2006 CMUcam2 Code
I agree that your observations on interrupt enables and UART state on power-up are on target.
We saw pretty much the same results with or without the camera connected. The camera gets power from one of the PWM outputs so it has to come up after the RC does. According to IFI the user uP gets data from the Master via a serial SPI interface. I don't know if there is any error checking in the user uP but I suspect not. Six weeks was not going to be enough time to run this investigation into the ground and still be able to perform our remaining tasks, so I elected to work around the problem as I described in my last post. |
Re: 2006 CMUcam2 Code
My RC has been behaving. However, I don't know what you guys have done to get this error to come up. I however have only used it with the Tether cable plugged in.
If someone could give me a rundown as to how this problem should be occurring, and what I should do to get it to show up, I will gladly help out, from previous posts I was unable to get exactly what I had to do to get this error to possibly show up. |
Re: 2006 CMUcam2 Code
Quote:
I know my last question was for more info, but I now know what the problem looks like. We have the exact same problems. The first case happens sporadically, as does the second, the second however was easy to find, just turn our belt system on, and then try to turn it back off. The robot would jump all over the place, as would the camera's servo's. I am going to redo my electrical, and will look through the entire code for possible things that could be going wrong. Ours probably does not have this problem with the default code either. However, what I have noticed, is that turning off the OI and then turning it back on, will ALSO solve the problem for me (unless it says code error). For now I am going to keep going with what I have, after we ship I am going to see what I can get done, possibly even trade in last years RC for a new one with $150 down (I believe this is what IFI has a deal going for or something, correct me if I am wrong, in which case we may purchase an entirely new one). |
Re: 2006 CMUcam2 Code
I've posted updated "bells and whistles" camera software here: http://kevin.org/frc. These are the changes:
tracking.c/.h: Provided two new functions to set the pan and tilt servo position. This was done to provide a level of indirection so that the servos could be controlled from the robot controller or the CMUcam2. Fixed bug in search initialization code where temp_pan_servo was initialized to zero instead of Tracking_Config_Data.Pan_Min_PWM. Altered tracking algorithm to use the t-packet confidence value to determine whether the code should track or search. Added Get_Tracking_State() function, which can be used to determine if the camera is pointing at the target. tracking_menu.c/.h: Added the ability to set the confidence threshold via the tracking menu. terminal.c: Added "no camera data" diagnostic information. user_routines.c: Added code to send tracking state information to the user LEDs on the operator interface. -Kevin |
Re: 2006 CMUcam2 Code
Quote:
|
Re: 2006 CMUcam2 Code
Quote:
-Kevin |
Problem with the past
We are currently experiencing a problem getting the 2005 RC to accept any code that uses the current default camera code. It won't accept, at all, and the hex is no larger than any of our other working code... infact, the hex is smaller! If anyone can help, it'd be muuuuch appreciated.
ps. we have set it up with the old linker and even the new ones to see if it will work... |
Re: Problem with the past
Quote:
to the 2005 controller. We started with the 2005 default code, version 2.2 without the camera code in it. We then added the 2006 camera code .c and .h files, and our own .c and .h files that handled other interrupt based functionality, to the folder and they to the project. You will have to delete the IFI serial driver and header from the folder and project, and you will have to change stdio to the correct printf_lib include. You then have to fold in your changes to user_routines and user_routines_fast. It will work if you catch all the nits, and there are a few. |
Re: 2006 CMUcam2 Code
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.
HELP!! :ahh: can we not avoid using the gear tooth sensor by setting our fischer motor, globe, etc. at a low enough speed? then when it finds the light to stop?? if this is possible, where in the code do i do this. i'm not the greatest programmer but i need to figure this one out!! if canybody can help that'd be great :) |
Re: 2006 CMUcam2 Code
Quote:
|
Re: 2006 CMUcam2 Code
ok where can i get the 2006 code for the camera i don't see in on the website. What is the file called?
|
Re: 2006 CMUcam2 Code
Quote:
JBot |
Re: 2006 CMUcam2 Code
well i went there and these are the four file frc_camera_s_21.zip, frc_camera_21.zip,frc_camera_s_2.zip, frc_camera_2.zip. i am looking for one with ends in ....._2006.zip and it has to be for Mplab
|
Re: 2006 CMUcam2 Code
Quote:
JBot |
| All times are GMT -5. The time now is 11:56. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi