
fredebec
Hi,
I have written a script using the camera for face tracking, which used to work ok. But now, at the begining of the script I have the following error message : "ControlCommand" is not supported for this control (Camera). When i click OK, the script continues, but face tracking is not activated.
I think that the ControlCommand sentence is ok, so i don't unserstand the issue.
Here is a screen copy with the script and the error:
Edit: copy of the script :
ControlCommand("Camera", CameraFaceTrackingEnable) ServoSpeed(d10, 4) ServoSpeed(d11, 4)
:LOOP IF ($CameraIsTracking = 0) ServoRandom(d10, 30, 70) ServoRandom(d11, 40, 75) Sleep(1000) ELSEIF ($CameraIsTracking = 1) ControlCommand("Camera", CameraSnapshot) MP3TriggerPlayTrack(d5, 38400, 5, 2000) ServoSpeed(d10, 1) ServoSpeed(d11, 1) Servo(d10, 50) Servo(d11, 60) ControlCommand("Camera", CameraFaceTrackingDisable) Halt() ENDIF Goto(LOOP)
Great! I had a problem something like that a while ago. I had variables named the same in a few scripts and things seemed broken.
Glad it worked out.
@DJ: I read the help from the manual a lot (in fact, everytime I try a new feature) but I didn't make the link between my problem and this aspect of the ControlCommand feature.
So I have a question: when there is 2 or more windows with the same name (like in my case), which one is chosen by the ControlCommand function ?
Maybe it would be interresting to add an alert in ARC when trying to re-use a name for a new window, to prevent this kind of issue for beginners like me...
In any case, thanks for your help and for the EZ-Script, I really love to use it....
No alert - because you may want two windows with the same name to perform the same function with one line of code.
If there are two or more controls with the same name, all are used until an error is received.
Oh, I see now the interrest !
Just one more question, and I stop bothering you:
In my case, I have the Camera window and the Digital called "Camera". I try to initiate face recognition with ControlCommand("Camera", CameraFaceTrackingEnable). So, I see now why ControlCommand don't recognize the Digital (and give me the error message), but I don't understand why, in the same time, face tracking is not activated in the Camera windows. Is ControlCommand function blocked for all the windows when one send an error?
For future reference, here is the bit about ControlCommand from the manual in case you missed my earlier post
Also, reference the last sentence if my most previous post.
Ok, thanks. I got it.
Excellent