Script With Controlcommand And Camera - Error Message

 
#1

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:
User-inserted image


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)

#2

It's hard to see that script with this screen capture. Can you post it by it's self?

Did you try to activate the face tracking and then try the script? You may have to have it active for the script to run properly.

Install the DeBug control and then run the script. Watch the readout in the window and it will tell you what line the problem is on and maybe what the problem is.

#3

Dave,

I have edit my first post with a copy of the script.

If I activate face tracking I have the same message. In fact there is no error, neither in the script debug console, neither in a Debug Control... just this message and then the script continues, but the ControlCommand function don't work.

#4

How are you sending the $CameraIsTracking variable to the script? You need to get that info to the script somehow.

I installed your script in my EZ Builder and it ran without error once I placed $CameraIsTracking = 0 or $CameraIsTracking = 1 above the :Loop

#5

Ok, so I think the problem is more complicated than i thought, because when I close and open EZ-Builder many times, sometimes (but rarely) the script works perfectly (with face tracking activation), without no message.
So it seems that it is a random issue...



@dave
The $CameraIsTracking variable is present in the "Variables" tab of script settings, so I think it's ok.
Nevertheless, I tried to place $CameraIsTracking = 0 or $CameraIsTracking = 1 above the :Loop, but no effect.

#6

OK, that variable thing makes sense.

Maybe you have a Windows problem? Your script works nicely on my laptop using it's built in web cam. However I was not connected to the EZ-B board.

#7

In fact, I think that it is a problem with my EZ-Builder project. I have created a new test project with only the script, the camera and the mp3 Trigger and everything works well.

So it seems that there is some control or something in my project that enter in conflict with the ControlCommand & Camera in my scripts....

#8

I have found where is the issue :

I have a Digital Control to swith-on the camera and I have called it: "Camera".
It seems that the script confuses the real Camera Control with the Digital Control called "Camera"... Since I have renamed the Digital control "Camera01", everything is OK.

Maybe it happens since the last update, with the new feature: "Digital Controls display custom text instead of ON/OFF", but I am not sure...

#9

For future refence, here is the help from the manual regarding ControlCommand() or CC(). I marked the parts in bold that are of interest to you Smile

Quote:


ControlCommand( windowName, ControlCommandParameter, [values])

. Sends a command to the window by its name. Look further down in this document for available ControlCommand() parameters under the ControlCommand Parameter section.

. This command has a shorthand alias which is "CC" (See examples below).
. Example: ControlCommand( "ADC Graph", pauseOn )
. Example: ControlCommand( "SoundBoard", Track_3 )
. Example: ControlCommand( "Camera", CameraTweet, "This is an Image Description" )
. Example: ControlCommand( "Script Manager", ScriptStart, "MyScript" )
. Example: ControlCommand( "Speech Recognition", PauseMS, 3000)
. Example: cc("Auto Position", AutoPositionAction, "Action Name")
. Example: cc("Auto Position", AutoPositionFrame, "Frame Name")
. Example: cc("Auto Position", AutoPositionFrame, "Frame Name", 50, 3)
. Example: cc("Speech Recognition", PauseMS, 2000)

#10

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.