
mgodsell1973
United Kingdom
Asked
— Edited

Hi guys and galls,
I am writing a script for K9, that depending on which glyph he sees first determines what he does next. now I am taking this step by step to increase my learning of ez script, so the plan is as follows.
When asked to "patrol", he wanders off and looks for glyph 3, then moves on looking for glyph 4, then glyph 2, then back home to glyph 1, with actions at the stops.
Now I have written what I believe to be the code and uploaded to the cloud, but, I just want a sense check to see if this is the right direction, or is there a better way to do this.
Thanks in advance for your patience whilst I am learning :-)
@mgodsell1973 Found it
you may want to use
to enable the camera and glyph tracking from within the script. That way you won't have to manually enable the camera and start glyph tracking each time you want to run the script.
Also
won't execute correctly since there isn't a ControlCommand that returns which glyph has been found.
I'm not sure exactly how to know in a script which glyph is being detected but what you can do is create a separate script for each glyph and then in the camera settings -> script -> glyph you have each script run when each specific glyph has been detected.
Thanks @VGosine, I missed the fact that I needed to start the camera (doh). I do have so scripts operating when K9 "sees" a glyph, also I have added an augmented view for each one. Trust me to pick a project idea so complex, it looked so simple on paper (lol) Am I trying to achieve too much, is it possible?
I think you can accomplish your goals for this project. What you might need to do is create small scripts that do a simple task, then have one main one that calls each smaller script. The only thing I think would be a little challenge is getting it to return to the home position. Maybe you can just use your patrol script to look for the first glyph. The augmented view was a nice touch :-) Let me know if you need any further assistance, I'll try my best to do what I can. I look forward to seeing this in action when you are all finished :-D
Thanks dude,
This is where my knowledge is lacking, how do I "call" other scripts to a main one? I am I right in thinking that the scripts to be "called", would be written in the glyph section of camera tracking. Sorry I tend to have ideas outside my abilities :-)
It's all in the same place ... the control tab in every script...
Thanks @Richard R, when you put it like that it's obvious i will investigate on that.
Do you know how i would ask K9 to look for a specific Glyph and ignore others until he has found the requested one?
You have 4 glyphs right? So k9 would wander around until he stumbles upon one of the glyphs.... Remember you have also 4 scripts that can run under each glyph being recognized... So, say K9 stumbles onto #2 glyph... In your code in that script you can have him execute what you want him to do.... That would apply to the rest of the 3 glyphs...
Now if you need to execute the glyphs in a certain order you could code into each script to check if K9 has encounter say glyph # 3 prior... If not he can keep looking until he hits #3... When he sees #3 (in the #3 script) you would set a flag (variable) that tells the rest of your scripts that he has indeed found #3 first and can move to the next one... repeat the flagging as required...
Seems kind of complicated, but if you break it down piece by piece it will start to make more sense...
Liking the process Richard and have drawn out what i want to do. can i be cheeky and ask for a teaser code, for me to start with. not the full thing as i want to learn, just need a foot up.
;)