United Kingdom
Asked — Edited
Resolved Resolved by CochranRobotics!

Help With Roborealm Saying Detected Objects

Hey guys.

I need a little help with some script. As the title suggests, I'm trying to get an ARC script to speak an identified object using RoboRealm. It is all set up and passing variables to ARC, 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...

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.


ARC Pro

Upgrade to ARC Pro

Subscribe to ARC Pro, and your robot will become a canvas for your imagination, limited only by your creativity.

#17  

:startofloop
waitforchange($RR_NV_ARR_OBJ_NAME[0])
Say("That is " + $RR_NV_ARR_OBJ_NAME[0])
goto(startofloop)

This should work. Is the script started?

#18  

Try this with a variable watcher up


:startofloop
waitforchange($RR_NV_ARR_OBJ_NAME[0])
$TheNamePhrase = "That is " + $RR_NV_ARR_OBJ_NAME[0]
goto(startofloop)

See if the name changes when different things are recognized.

United Kingdom
#19  

Yep, that's working now. Thanks very much for your help David. Most greatful.:D

#20  

Thought I would reopen this tread as I'm having the same problem as the poster. It would be easier that way as I would not have to rewrite everything that was tried in it.

I want to have EZB say the name of the object that RoboRealm has detected. First off (if you see this) thanks David for the great video about setting up RoboRealm it helped me a great deal.

Where to start ... I have 3 different items detected by RoboRealm. The variable ($RR_NV_ARR_OBJ_Name) does show in the variable watch list in EZB. Have tried all the scripts that were mentioned in this post and none seem to work for me. I must be missing something easy but can't seem to figure out just what it is.

Any help would be greatly appreciated.

#21  

I just saw this. Let me get work squared away this morning and I will see if I can't help you get it going.

It may be an hour or so.

#22  

Its great that the variable is showing up in the watcher list. This means that everything is configured correctly and we just need to figure out the script. Can you give me exactly what the name of the variable is? For example, is there a [0] at the end of it or some other number?

Thanks David

#23  

Make a script called something like SayNameOfObject or whatever you want it to be with this code.


#Replace $RR_NV_ARR_OBJ_NAME with the name of the variable in all of the lines below.
$RR_NV_ARR_OBJ_NAME[0] = ""
:startofloop
waitforchange($RR_NV_ARR_OBJ_NAME[0])
#use Say or SayEZB in the next line
Say($RR_NV_ARR_OBJ_NAME[0])
goto(startofloop)

This can run by itself and just loop. it will say the name of the object when the name of the object changes. The variable initialization in the first line could be moved to an init script that launches when the robot first starts up. This is there because the script will probably fail if you haven't yet launched RoboRealm to identify an object yet as the variable wouldn't exist yet. Once RoboRealm has been launched, the variable is initialized and set by RoboRealm so it wouldn't be needed anymore. This is why it is outside of the loop.

The WaitForChange line will wait for the object name from RoboRealm to change before it continues so you shouldn't have to worry about this script consuming many resources.

If this script fails, please send me the error message it returns.

Thanks David

#24  

Can you give me exactly what the name of the variable is? For example, is there a [0] at the end of it or some other number?

Yes there is a [0]

#Replace $RR_NV_ARR_OBJ_NAME with the name of the variable in all of the lines below. $RR_NV_ARR_OBJ_NAME[0] = "" :startofloop waitforchange($RR_NV_ARR_OBJ_NAME[0]) #use Say or SayEZB in the next line Say($RR_NV_ARR_OBJ_NAME[0]) goto(startofloop)

I still must be doing something wrong or miss understanding this. Can you give me a example, say with the variable name of "box".

I have been getting nowhere ... lol

Thanks