Log in

View Full Version : Problem with easy C CameraTracking function


mjveld1018
10-02-2007, 13:58
I calibrated the camera using Labview and then import the parameters into the easyC Camera Tracking Code supplied by First. However, the camera doesn't do anything once I build and upload the program. Using Print to Screen, I find out that CaptureTracking function returns all value as zero--including confidence, which explains why the servos don't move. The red light on the camera is also on, but everything was connected properly.

In short, I can't figure out why the CaptureTracking is returning everything as 0.

TubaMorg
10-02-2007, 17:54
Check to see if your TTL chip is connected properly AND plugged into the RC.

mjveld1018
11-02-2007, 13:59
We ran the IFI Dynamic Debugging tool. The TTL chip passed that, and it is plugged into the RC correctly. Any other ideas?

Alan Anderson
11-02-2007, 21:39
How are you powering the camera? We've seen symptoms that sound like what you describe when the backup battery gets low.

BradAMiller
11-02-2007, 22:18
In short, I can't figure out why the CaptureTracking is returning everything as 0.
It's possible that the camea is not being initialized properly. You can test this by turning on debugging output for the camera. To do this, call the function:
SetCameraDebugMode(1); just before the camera initialize block.

What you should see in the terminal window is a bunch of somewhat cryptic lines where easyC tries to send commands to the camera. For each command it sends you'll see a "->" at the front of the line indicating that it's going to the camera. You should see responses from the camera (mostly ACKs - acknowledge) with a "<-" in the front of the line. If you don't see that sequence then it means that the camera never received the initialization commands correctly.

I would also try to use the default camera parameters built into easyC just as a baseline. Those should work out of the box. After you see it working, then go back to LabView to tweak the setup.

mjveld1018
12-02-2007, 20:15
Yes, the camera is initilized (the terminal shows "->" and "<-"). We are still getting 0 for all values though. We're powering it off of the RC with a fully charged backup battery.

BradAMiller
12-02-2007, 20:33
Yes, the camera is initilized (the terminal shows "->" and "<-"). We are still getting 0 for all values though. We're powering it off of the RC with a fully charged backup battery.

Were there ACKs going by with a number of different commands being sent to the robot? Sometimes if the robot controller can't connect to the camera, you see a bunch of "->" and "<-" without and commands being sent. This is because the robot controller is waiting for the camera to reply and timing out.

If it is working it will finish the entire initialization sequence in less than a second.

ebmonon36
12-02-2007, 22:12
We got something that looked like this (I don't remember the directions of the ACKs):


<-
<-
->
<-
<-
<-
(then it started the printf statements we told it to make, returning zeroes for all functions)


Thanks for the advise so far!

Eric

BradAMiller
12-02-2007, 22:32
We got something that looked like this (I don't remember the directions of the ACKs):


<-
<-
->
<-
<-
<-
(then it started the printf statements we told it to make, returning zeroes for all functions)


Eric


If you are only seeing the arrows, then it means that the robot is not getting any data from the robot controller. When it works you should see a series of commands along with the arrows.

So, I would try one of the easyC camera demo programs that work for sure just to make sure that you are not having a software problem. If that doesn't work, then you might have some issue with the camera itself or the connections to it.

mjveld1018
16-02-2007, 19:36
->
<-TTTTTT
->
<-ACK
->RM 1
<-ACK
->DM 20
<-ACK
->CR 41 128
<-ACK
->CR 19 32
<-ACK
->CR 42 128
<-ACK
->CR 43 32
<-ACK
->CR 45 128
<-ACK
->CR 18 32
<-ACK
->CR 0 0
<-ACK
->CR 1 128
<-ACK
->CR 2 128
<-ACK
->CR 3 128
<-ACK
->CR 6 1
<-ACK
->CR 16 1
<-ACK
->ST 85 115 15 17 100 145
<-ACK
->NF1
<-ACK
->SM 12
<-ACK
->SP 16 8 5 30 15 5
<-ACK
->TC
<-ACK
Confidence 0
The Confidence value was from our Print to Screen code.