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

Experience the transformation – subscribe to Synthiam ARC Pro and watch your robot evolve into a marvel of innovation and intelligence.

#9  

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

United Kingdom
#10  

No problem. That's David.:)

#11  

Make sure the that ReadHTTP is before the AVM Navigator in RoboRealm and the AVM Navigator is before the EZ-Robot Variables module.

From looking at it, that is the only thing that strikes me as possibly being configured wrong. Let me know and I will keep looking.

United Kingdom
#12  

@David.

That's exactly what it was. Many thanks. I moved it around and works great now, except...

User-inserted image

Every time I now launch Roborealm, I get the above message. It's not the end of the world as when I click "OK" it continues to launch and seems to work ok. Any ideas what's causing that?

#13  

I would change the port that you are using to something like 2080 instead of 8020. It is worth a shot. If something else is using that port, it could cause issues. If that doesn't fix the issue, post a message on the RoboRealm forum with the error. They are pretty good at letting you know what the issue is.

United Kingdom
#14  

Cool, will do. Thanks again David. I do have one more question regarding the original topic of this post I hope you can help with. I am running the following two scripts in two separate script controls...

$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)

and

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

and running it through a speech recognition control with the following...

say(" That is ")
sleep(2000)
ControlCommand("Sensors and Lights", ScriptStart, "Face rec 1")
ControlCommand("Sensors and Lights", ScriptStart, "Face rec 2")
sleep(5000)
ControlCommand("Sensors and Lights", ScriptStop, "Face rec 1")
ControlCommand("Sensors and Lights", ScriptStop, "Face rec 2")

The problem I'm having is when the robot says "That is" he will say the last object detected before he says anything else. Any ideas on how to improve that?

Thanks.

#15  

You really should only have to run one of these. They do the same thing. Remove the Say(RR_NV_ARR_OBJ_NAME[0]) command from the first two scripts.

I suspect the issue that you are having is that it is looping and catching the change in the recognized object. These scripts will currently say the name of the recognized object so I think what you are seeing is

"Bob, that is (wait 2 seconds) Bob. " I would even go as far as to say that the last script wouldnt be needed and just put the line SAY("That is " + RR_NV_ARR_OBJ_NAME[0]) in place of Say(RR_NV_ARR_OBJ_NAME[0]) and just let it run in a loop. I personally like the second script better as it is less typing:)

You could start this script with an init script that is launched when you connect to the V4. I would also add things like battery monitoring or check to see if there is a connection and if not, reconnect that would be launched from this same init script. These would be separate scripts that would also loop.

United Kingdom
#16  

Well I gave the changes a try, and now it doesn't work at all. confused

Also, I changed the port numbers as you suggested on Roborealm, and all is good now.:)