Asked — Edited
Resolved Resolved by Rich!

Help With Variable Input And Output For Faces

Well, I was working on a surprise for the group, but I need some help first. I have a nifty multiple face detection program working in C#.net. So far I have it programmed to recognize my face, DJ Sures, Sarah Connor and Alan Turing. Minus my face, I figure all EZ-robots should know who the other three people are.

My C# app generates a change in variable and displays this in a label in the form to show who's name it is for the face it sees. For this to be useful for integration with ARC I need to get this variable out of my app an into ARC.

I see two ways to do this, one is write the data to a .txt file, have ARC keep checking this text file, read the text file, if the text changes then act on that. - This seems sloppy and slow.

Option 2 seems better which is to use TCP/IP and Telnet. I've viewed the tutorial here: https://synthiam.com/Tutorials/Help.aspx?id=159 and I fundamental understand it. I can connect to ARC with Telnet. I I'm sure I can tell my C# app to send telnet data. What I can't wrap my head around is how to I make a script in ARC to look for an incoming variable on the TCP/IP port such as "$Face_Name" so that ARC can then act on that data?

Can someone help me with that? Or is there a 3rd option I'm not thinking of yet that would be better? I'm looking forward to get this figured out so I can share my app with the group.

Thank you! -Justin


ARC Pro

Upgrade to ARC Pro

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.

United Kingdom
#1  

WaitForChange is the command you are looking for.

Give me a minute or two and I'll knock up a quick script example for you.

United Kingdom
#2  
# Make sure the variable exists and is reset
$FaceName = "null"

# Make an endless loop
:loop

# Wait until the variable changes
WaitForChange($FaceName)

# Script commands to be run on change of facename variable

# Loop back to the start
Goto(loop)

It's that simple:) No sleep should be required since the face probably wont change too quickly.

#3  

Ok, I added that as a script, ran it and I get Error in line 2 variable not defined $FaceName

United Kingdom
#5  

Updated the script a little ;)

All variables need to exist before using them in commands otherwise it'll throw that error. I usually define all variables as "null" or as 0 in the init script.

And yes, I changed it before you posted as I saw the potential problem :)

#6  

@JustinRatliff

This is an awesome thing.... How are you adding faces to the recognition engine? Will it be something users will be able to easily (or not easily, but without C# programming skill) do?

I would love to have my robot recognize me, my wife, my cat, and a couple of friends, and treat everyone else as stranger (or when in "security mode" potentially hostile).

I also love your choice of default recognized faces. I would suggest adding Issac Asimov.

Alan

#7  

@Rich - You Da MAN!

I'm getting so close I smell it. Thank you Rich!

#8  

@thetechguru It's an application that runs on its own. I am making it to share with everyone - anyone should be able to use it as a standalone app. If I get lucky I'll have the very pre-beta version ready to share tonight or tomorrow.

#9  

That is so cool of you. Way (way way way) down on my todo list was a plan to start learning OpenCV and build something similar, but if you have done the work already, it is one less thing I need to do :)

Alan

#10  

You rock Justin.:D People have been wanting multi facial recognition for long time. I haven't played with facial rec much but, I not gonna lie and say I won't be checking this out. ;)

#11  

If you can accomplish this dude... Yes, you rock :D

#12  

Man! That is sweet! I would love to have that capability on my sentry bot.

Brazil
#13  

Just can't wait to try it! How do you plan to share that? Will us be able to download it From here ? Thanks!

#14  

I'll upload it on my site and make a project page here with the link, info and so updates can be posted. I think everyone will like it and hopeful help me improve it with your input and feedbacl. I got the ARC communications side straitened out but now I'm having issues issue sending data from the C# app side. I posted another thread with my issues for that.

#15  

Cha-Ching! I found the issue for the c# I needed use Tutorial 52 for Scripting for the correct example of how to connect via TCP and send a variable. It all works. My App sees faces and you can add new one, opens a port to ARC, sends the name of the face seen, ARC script gets the variable and can act on it, in the demo I have it speak the name.

Soon I'll upload it with source code and start a project page. I'm going to call it EZ-Face.

Thank you Rich and DJ! I'm looking forward to hearing the groups thoughts on it.

#16  

I think this is awesome! When you get everything worked out, could you do a tutorial to show us how to do all this? This is so neat! Thank you so very much for this. This is a giant step forward for everyone.

Australia
#17  

Absolutely Awesome ,

I think everyone has been thinking about when something like this would be here...

Cant wait to play with it.

Still waiting for my Roli to be shipped , but will have a play on ARC to get familiar with it.

Hais.