Welcome to Synthiam!

The easiest way to program the most powerful robots. Use technologies by leading industry experts. ARC is a free-to-use robot programming software that makes servo automation, computer vision, autonomous navigation, and artificial intelligence easy.

Get Started
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 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.


ARC Pro

Upgrade to ARC Pro

Experience the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

#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.

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
#25  
do you have Team Viewer installed? If so, I can connect to your computer and see what is happening. If not, I will get something working here and post it for you.
#26  
I do have it on my main computer but not the robot which has a onboard computer.
#27  
okay, let me slap together a project real quick. I will post a link shortly.
#28  
Actually, I just tested the script and it is working. Can you send me a screenshot of your ARC with the variable list being displayed?

This is the code that I am running without any issue. This will say the value of the first item in the array. Roborealm can identify a lot of objects so it is possible to have more items than just the one in position 0. These would be 1 and up. Can you see the value of the variable changing as you show the camera different objects? If the original object is in the view of the camera, it will hold position 0 and the new object will get position 1. if the old object is not in the view of the camera any longer, the new object will be in position 0. It would be possible to modify the code to say the name of multiple objects but we need to get it saying the name of one of them first.

Code:


:StartOfLoop
WaitForChange($RR_NV_ARR_OBJ_NAME[0])
say("I see " + $RR_NV_ARR_OBJ_NAME[0]+ ".")
Goto(StartOfLoop)


Another option is to connect to your robot from your main machine, but my assumption is that roborealm isnt installed on this computer so it wouldnt work. If it is on your main computer, I could connect and check it out from start to finish for you.
#32  
Look at 1 of the tutorials see if they have information. I do have a code.
#33  
if($RR_NV_ARR_OBJ_NAME[0])
say("Steve")
elseif($RR_NV_ARR_OBJ_NAME[1])
say("control")
endif
#34  
this is working fine for him with the code that was supplied. The port wasn't enabled in ARC.

The code mentioned in the previous post isn't what should be used and is not good code. It won't do what you want it to do.

This code is working code that allows the name of the object, as specified in RoboRealm to be said. There is no need to do what is being done in the code above.

Code:


:StartOfLoop
WaitForChange($RR_NV_ARR_OBJ_NAME[0])
say("I see " + $RR_NV_ARR_OBJ_NAME[0]+ ".")
Goto(StartOfLoop)
#35  
@Aidan Your code in post #34 won't work.... Your comparator has no exact match.... What your code says is that if $RR_NV_ARR_OBJ_NAME[0] contains any text string, say Steve... What if $RR_NV_ARR_OBJ_NAME[0] = Fred or Frank or rubber chicken? Part of your code would sort of work if you only trained one object (Steve in this case) in RoboRealm, but what if you had many trained objects? Look at David's code in post #35.... that's how it should be done....
#38  
Wait I know this go to learn on ez robot.com there is a tutorital for this
United Kingdom
#39  
@Aiden.

The script you supplied in post #34 was copied from what I originally posted in post #1. This script, as already mentioned by others and tried by the poster, does not and will not work. That is the reason why I started this thread, so I could get the correct script from somebody and compair where I went wrong to help others facing the same issue. 10 out of 10 for your willingness to help which is great, but be sure any advice you offer is tried and tested and correct. My advice for what it's worth is to study the tutorials in depth and learn what ARC has to offer. That way you will have great fun building and controlling robots and you will become a great asset to the community.:)

@Herr Ball.

Sorry I couldn't reply to you sooner to offer some help. I've been away from the forum for a while dealing with life's little problems it seems to be throwing at me at the mo. I'm pleased David got you sorted out and you finally got it working.