MRInfected101
Canada
Asked
— Edited
I've recently started working with Ez-robot and have been having some troubles with the following error:
1: $Allowed = "name1", "name2"
Error on line 1: Missing String Quotes or Invalid Expression at index 7: ,
I'm trying to make it so JD recognises someones name, and with variables, and decide if that person should be admitted to where ever one's going.
$Allowed = "name1", "name2"
$Blacklisted = "name3", "name4"
# Camera Tracking will not function without a Camera Control added to the project. Project->Add Control->Camera
# Wait For Face will not function without a Camera Control added to the project. Project->Add Control->Camera
SayEZBWait("who goes there")
if ((WaitForSpeech(10, "name1", "name2")) = $Allowed)
SayEZBWait("Hello please enter my friend")
ControlCommand("Auto Position", "AutoPositionAction", "Wave")
sleep(500)
waitfor($AutoPositionStatus = 0)
elseif ((WaitForSpeech(10, "name3", "name4")) = $Blacklisted)
SayEZBWait("Get out you hooligan before I call the cops")
ControlCommand("Auto Position", "AutoPositionAction", "Kick")
sleep(500)
waitfor($AutoPositionStatus = 0)
else
SayEZBWait("Who are you?")
endif
Any help with the error is greatly appreciated.
This is incorrect... Your syntax is wrong
This will work. Variables can only hold one value at a time......
or you can use an array
or you can append two together
The learn section has a complete tutorial activity on how to do something like this using the robot program. Here is a link to the tutorial: https://synthiam.com/Tutorials/Lesson/106?courseId=1
You can also click the ? (question mark) on any control to view help, which includes relevant activities. For example, if you were to click the ? (question mark) on the Camera Control, you would see a link to that tutorial.
Find more information in the learn section to begin using your ez-robot.
ALSO - i highly recommend starting with Blockly and not diving directly into EZ-Script. Blockly makes programming a lot easier, and even i use it.
Maybe this is what you want to do? considering that you have objects trained for the faces of Jeremie and DJ Sures. You do not use face detection, you use Object detection. You can read about the differences - as face tracking doesn't know a single face, it only knows EVERY face.
OTHERWISE if you want to prompt with audio and wait for a speech response...
... you can start along the lines you were beginning with. This example queries and waits for a response once the face is detected. See how the logic works? There is a good episode on The Robot Program that teaches how to use logic here: https://synthiam.com/Tutorials/Lesson/119?courseId=1
This post is certainly educating me. Thanks!
I'm not sure if I like this code example. LOL
Hahahah jer! Was wondering when you'd see that!
Thank you very much for the help.