Award
Congratulations CochranRobotics, for answering the question and has received an EZ-Credit award! Share what you have learned and create a tutorial to help others by clicking here.

Help With Roborealm "saying" Detected Objects

Assistance Requested

Help Steve G with their question and receive $10 of EZ-Credit to get more robots and parts from our store. The following information was provided about their previous efforts searching tutorials for a resolution.

Steve G claims to have checked these sources:
 
#1

Hey guys.

I need a little help with some script. As the title suggests, I'm trying to get an EZ Builder script to speak an identified object using RoboRealm. It is all set up and passing variables to EZ Builder, and I have a couple of objects trained, but I'm having trouble writing a correct script. Here's what I've got so far...

Code:

if($RR_NV_ARR_OBJ_NAME[0])
say("Steve")
elseif($RR_NV_ARR_OBJ_NAME[1])
say("control")
endif



I would be grateful for any help with this to get me started.

Thanks.

I have found a few conversations, tutorials and activities that may help with your question. Take a look at these links. I've sorted them by what I believe to be most relevant but that is not always the case as I'm still learning.


Also, consider reviewing the Learn section for informative lessons and activities. Check it out!


#2

Code:


if($RR_NV_ARR_OBJ_NAME[0] = "Steve" )
say("Steve" )
elseif($RR_NV_ARR_OBJ_NAME[1] = "Control")
say("control")
endif




another way to do this is

Code:


:startofloop
waitforchange($RR_NV_ARR_OBJ_NAME[0])
Say($RR_NV_ARR_OBJ_NAME[0])
goto(startofloop)

#3

Thanks for replying David.

I tried the first script you cleaned up for me, but every time I press start it just keeps saying my name whether I'm in front of the camera or not. And when it detects the control object, I get a debug message saying "error on line 3. Index was out of the bounds of the array".

So I tried the second script and it doesn't seem to be doing anything. Any ideas?

Basically what I'm trying to do is when I different is detected on RoboRealm, is for EZ Builder to speak the name of that person (or object), but not having much luck so far.

#4

Use the second example. See if that works for you. The error is that you don't have 2 objects recognized when running the script.

The second script waits for a change. Let me get to a computer and I will write the script.

#5

First script change
This script will do the same as the second script but is written out.

Code:


$lastobject = ""
:Startofloop
if($RR_NV_ARR_OBJ_NAME[0] != $lastobject)
say($RR_NV_ARR_OBJ_NAME[0] )
endif
$lastobject = $RR_NV_ARR_OBJ_NAME[0]
goto(startofloop)


Second script should work when the object changes in the view of the camera.

Code:


:startofloop
waitforchange($RR_NV_ARR_OBJ_NAME[0])
Say($RR_NV_ARR_OBJ_NAME[0])
goto(startofloop)



im in the middle of doing some testing on EZ-AI so I haven't tested this, but it should work fine.

Also, I would suggest adding a variable watcher so that you can see what the $RR_NV_OBJ_NAME[0] variable is set to if you dont have that in your project yet.

#6

Thanks David.

That's working much better. I've got two seperate script controls and run the both together and so for it seems to be doing the job. At least that will give me something to build on (or at least try to Tongue).

Thanks again.

#7

@David.

Quick question. Can you learn new objects using the EZ-B camera with Roborealm? The problem I'm having is all the object learning is being done through my laptops webcam, and that's where the detection is happening, but even though I'm getting the EZ cameras feed, I cannot train new objects or do any recognition with it. I thought I had it working before but can't honestly remember now (stressfull week and all).

Thanks.

#8

Yes, you can do this. You need to use the custom Web service in EZ-Builder to feed the stream to roborealm. There is a video I had showing How to set this up. Let me find it. I'll add it to this post.

https://www.google.com/url?sa=t&source=web&rct=j&q=roborealm%20with%20ez-builder%20youtube&ei=__8sVZ_3AYSpgwSHvYKgBA&url=http://m.youtube.com/watch%3Fv%3DmefpiqKiMYE&ved=0CBwQtwIwAA&usg=AFQjCNFwfbqJ_ekmYgxVVNAHo03tBCOclg

I'm not at a pc right now. Copy and paste this into a browser.

#9

@Dave.

I already used your video to set it up initially. I do have the custom web server already set up, and when I click "ReadHTTP http://127.0.0.1:8020/CameraImage.jpg?c=Camera, I can get the same feed through the v4 camera. But when I go back to AVM, it reverts back to the webcam.

#10

Let me get to a computer. It will take me about an hour to get to one.