
3dGuy
Hello, I need some code help. I realize this is super simple but can't get my head around it.
In the following code once "Master" or "Milady" has been identified and the ControlCommand has been executed,
I would like the CameraObjectName subject to be ignored for say, 1/2 hour.
To try and be clear, once it sees you it won't execute the ControlCammand repeatedly .
Thanks in advance.
TonyCode:
SayEZB(("I see " + $CameraObjectName))
if ($CameraObjectName = "Master")
sleep(2000)
ControlCommand("Script Manager", ScriptStart, "Fist Bump")
elseif ($CameraObjectName = "Milady")
sleep(2000)
ControlCommand("Script Manager", ScriptStart, "Royal Wave")
else
endif
1) where does this script live? Is it in the camera control OnTracking event?
2) What do the scripts "Fist Bump" and "royal wave" look like? A lot of the script you're asking to be reviewed is missing
3) What do you mean the ControlCommand() executes repeatedly? I think this question would be answered with question #1, because we're not sure where this script lives
4) Lastly, i'm not sure i'm following the goal because I'm confused by the mention of repeatedly ControlCommand() and waiting 30 minutes for something - but i see no reason why either of those things would happen in the partial code snippet posted. To clarify, are you wanting the script to WAIT 30 minutes before reacting to the detected object?
($CameraObjectName = #Master or Milady)
Code:
Code:
I think my last script should work. However to make it simpler you should find a way to pause the script for your wanted 30 minutes in place of the Pause() command I show. Maybe have the script use the computer's clock?
You see, the sleep() command can delay for a period of time, but 30 minutes is a long time - specifically if the script is in the camera control On Tracking Start event. There's no reason to hold an event active in the compiler. Having a stand-alone script would be fine, it can wait for ever... but in an event, such as Tracking Start, is a bad idea.
The original poster needs to explain a bit more about what they're trying to do because there's too many unanswered questions at this time.
Sorry for the confusion. Writing English is difficult for me and the use of proper terminology eludes me.
Perhaps I will just say what I want to do:
When someone enters the room and is recognized by the camera object tracking and is spoken to, and waved to, I would like that to happen only once. Then (their face but not other objects) ignored for awhile. So the same person isn't being continually spoken to, and waved to.
But after that event, I would like other objects to be recognized in the within the same script and acted upon.
I hope this is clear enough.
To answer the below questions,
1, this is a script in the camera control. like in this episode http://www.ez-robot.com/Tutorials/Lesson/106
2, fist bump and royal way are a script to activate an auto positions from different ezb's.
3, I really don't know I meant.
4, i hope the explanation above answers this.
1) where does this script live? Is it in the camera control OnTracking event?
2) What do the scripts "Fist Bump" and "royal wave" look like? A lot of the script you're asking to be reviewed is missing
3) What do you mean the ControlCommand() executes repeatedly? I think this question would be answered with question #1, because we're not sure where this script lives
4) Lastly, i'm not sure i'm following the goal because I'm confused by the mention of repeatedly ControlCommand() and waiting 30 minutes for something - but i see no reason why either of those things would happen in the partial code snippet posted. To clarify, are you wanting the script to WAIT 30 minutes before reacting to the detected object?
In your camera control script, I would check for the contents of a variable and only execute the command if the variable was 'true' or whatever you set it to. after running the command, set the variable to 'false'.
Then you need another script that watches for that variable to change, and sets a timer when it does, and changes it back when the timer expires. That one can run in a loop.
Alan
You shouldn't give up, just run the loop outside the camera control, like I describe above. In a few weeks I expect to finally have time to spend on robots again (3 year project at work coming to an end) and if you haven't solved it by then, I will write examples.
Alan
Code:
Camera script :
Code:
Code:
1) Copy the code that i posted
2) load ARC
3) PASTE the code into the camera device TRACKING START
voila