Store › Forums › Video Experimenter › Bugs/Problems › objectTracking
- This topic has 10 replies, 4 voices, and was last updated 13 years ago by Michael.
-
AuthorPosts
-
April 10, 2011 at 3:18 pm #437bennyMember
Hi,
I’ve build the videoExperimenter and loaded the objectTracking code, it worked at the first attempt!!
Unfortunately I’ve noticed a strange thing, after about 15- 20 seconds, the surrounding box disappears and the only thing I can do is a reset where it works again for about the same time.
Any hints ?
PS The only thing I changed in the code was the format, in Europe we use mainly PAL.
April 10, 2011 at 8:17 pm #948bennyMemberI did some more testing:
It lookslike it always hangs after calling tv.resume(); in the mainloop of objectTracking.
I looked into the code but cannot figure out how it works, anyone a bright idea ?
-ben
April 11, 2011 at 6:25 pm #952MichaelKeymasterBenny, I’m not sure why you are experiencing this issue. I have not experienced that. Sometimes the LM1881 chip seems to lose the sync, and I’ve restored it by flipping the overlay switch. You might try adjusting the small potentiometer R4 slightly to see if you get better stability.
I’m almost sure this is not a code problem, but an issue with the LM1881 losing track of the sync from the composite input.
April 11, 2011 at 7:50 pm #865bennyMemberHi Michael,
Thanks for the reply, I will check the LM1881 to see if it losses sync.
I’ve put in some debug statements and it ALWAYS hangs when calling tv.resume().Serial.print(“2”);
tv.resume();
Serial.print(“3”);If it hangs (I thought it was after 15-20 seconds but sometimes it is much more or much less), it prints 2 at the serial output and never 3 ….
I’ll keep you posted.
-ben
April 11, 2011 at 8:11 pm #866MichaelKeymasterOk, here’s a question for you: have you been trying to use the Serial interface in your program (before using it for debugging)? Serial communication won’t work well with TVout because it is interrupt driven. So, the absence of the “3” may not mean that the program is hung (although your use of interrupt driven serial communication may cause it to hang).
TVout comes with a polling version of serial communication in the “pollserial” library. There is an example called NTSCserialTerm.pde. Basically, declare an object like this:
pollserial pserial;
and then use it just like Serial:
pserial.print("3");
Question 2: When the bounding box disappears, do the coordinates written in the upper left of the screen also stop displaying?
It’s hard to imagine tv.resume() freezing because it just sets a variable. What hardware are you running on (ATmega328?) and what resolution are you using?
September 17, 2011 at 10:21 pm #1309chuckcrunchMemberim have the same problem board losing sync and i can’t use servos, interrupts i gess?. is there a work around?
September 18, 2011 at 7:54 pm #1310MichaelKeymasterCorrect, if you are using interrupts, that will definitely interfere with the timing of the video generation which depends on timer interrupts.
October 11, 2011 at 1:16 pm #1143twerffMemberHi there,
I have exactly the same problem. I did not know about the problems in combination with the Serial, but I did find an odd thing happening. When I run the program with Serial Monitor it works fine, but at a certain point the output of the board to the TV is only black. Also the Serial printing stops. When I close and open the Serial Monitor the Arduino seems to reset itself and it works fine again.
Fiddling with the R4 doesn’t change a thing unfortunately.Kind regards,
ThomasOctober 11, 2011 at 1:33 pm #1144MichaelKeymasterIf you are using the ordinary Serial library, then yes, you are going to have problems like that. You need to use the polling serial provided by the TVout library.
October 11, 2011 at 3:57 pm #1145twerffMemberI read that. But without the Serial printing I have the same problem.
December 22, 2011 at 9:03 pm #1293bennyMemberHi,
I restarted my object tracking project, trying to solve this ‘hanging’ issue.
Unfortunately I cannot find the source of the problem, I removed the serial debugging statements to make sure this was not interfering with the rest of the code.
Sometimes the code runs for more then 20 minutes, next time it seems to hang after 15 seconds, it is certainly not repeatable but VERY random.
I adjusted R1 but this did not make any difference, as far as I can debug the code, it seems to hang in the tv.capture routine.
If syncselect0 has been toggled, the system works again, do not know if it was restarted or continued from the place where it ‘hung’.If there is anyone who can help, this would be great!
-
AuthorPosts
- You must be logged in to reply to this topic.