|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#61
|
|||
|
|||
|
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!
If anyone could give me a hand, it would be a big help. Thanks. |
|
#62
|
|||||
|
|||||
|
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. Last edited by Mark McLeod : 02-02-2006 at 23:14. |
|
#63
|
|||
|
|||
|
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:
|
|
#64
|
|||
|
|||
|
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:
Last edited by nheft : 03-02-2006 at 11:41. |
|
#65
|
|||
|
|||
|
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. |
|
#66
|
|||
|
|||
|
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:
Last edited by nheft : 05-02-2006 at 09:45. |
|
#67
|
|||
|
|||
|
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? |
|
#68
|
||||
|
||||
|
Re: 2006 CMUcam2 Code
Hi There,
We seem to be having the same problem. Quote:
Quote:
|
|
#69
|
|||
|
|||
|
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. |
|
#70
|
|||
|
|||
|
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. |
|
#71
|
|||
|
|||
|
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). |
|
#72
|
||||
|
||||
|
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 |
|
#73
|
|||
|
|||
|
Re: 2006 CMUcam2 Code
Quote:
|
|
#74
|
||||
|
||||
|
Re: 2006 CMUcam2 Code
Quote:
-Kevin |
|
#75
|
|||
|
|||
|
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... |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |