Asked — Edited
Resolved Resolved by Rich!

Get Data In/Out Of ARC

I have not ran accrossed this topic yet. Is there anyway to pipe data into and out of the ARC software? My goal is keep the ARC software as is and have a pipe to my own AI software. I realize I could use the SDK to encorporate function, but the ARC is just too pretty the way it is. :D

An example of what I want to do is, lets says I speak the command in the ARC to "track the ball"; I'd like the ARC to pipe out something like "track ball" where my own software can grab that command string and do what ever with it (like store it in a memory database). And likewise if my software issued the command "track ball" the the ARC should read "track ball" coming into the pipe and the ARC software would react to it as if I spoke to the command.

In the controls I'm not seeing a clear way to pipe data to/from ARC. Is there a way achive this? Any suggestions?


ARC Pro

Upgrade to ARC Pro

Stay on the cutting edge of robotics with ARC Pro, guaranteeing that your robot is always ahead of the game.

United Kingdom
#1  

Yes. Telnet is one method, I am in the middle of changing all of mine to telnet. You can also use HTTPGet to get and send data. RSS feeds can be read from ARC also. Look in the examples, I also posted a news reading example.

For your example I would suggest using telnet and the server option, on running a command set a variable i.e. $activity = "track ball".

Using telnet you can then connect to ARC (via localhost:port - the options are in the connection settings) and send script commands, more importantly, have your software save $activity as it's own variable.

This is just one method. It's not very well documented so far as few have used it and less have discussed it from what I can see.

I'm running short on time so this is a bit brief, rough and vague but if you need more info I will post more when I get home.

United Kingdom
#2  

I feel that is not a good enough response so I will add to it... with pictures :)

I will assume you know how to use Telnet with your software since to guess at it not knowing the language used to write it or the software itself etc. would be a pointless task.

On the ARC side of things you need to set up for the Server.

First click the icon to set up the connections. User-inserted image

Next click on the server tab at the top User-inserted image

Finally, check the Enable Server boxes as required, set the ports and passwords (if needed) User-inserted image

Now ARC is all set to send and receive script commands over Telnet on the port set.

Use your software to connect to the machine running ARC, i.e. localhost:6666 or 192.168.2.182:6789, whatever it's set up as.

ARC and your software are now connected. All ARC variables are available through EZ-Script. All connected devices are controllable through EZ-Script.

#3  

Last year there was mention from DJ that we would be able to use VBScript or C#script within ARC script window, but the only threads I can find on it now are people asking if it is working yet, so I am not sure of the current status.

That would allow developers to put virtually any capability into ARC as an add-on that they wanted and utilize 3rd party application SDK/API's.

Alan

#4  

Rich, thank you so much for the detailed directions! This is exciting! :D "Goody, Goody, Goody!" Now I can link my software with ARC. Thank you, thank you!

United Kingdom
#5  

There are other ways also. ARC can execute programs, send HTTP commands etc. but really, telnet is the cleanest method IMO.

I'm literally going through this myself to link ARC with EventGhost through python scripts. EventGhost can control ARC which means anything in my house can control ARC, heck I could phone in commands now :)

Good luck with the project.

#6  

@Rich - How mad are you gonna be when you call your house and it puts you on hold until the next representative is available? ;)

#7  

One more method of exchanging data with other apps. EZ-Script can do file IO, so you could have an app write a variable to a file and read it in ARC and Vis-Versa.

Rich's examples of using Telnet are probably best for event driven activities since you can essentially always listen for commands from the external app via Telent, but using HTTP Get or File I/O you could do periodic (even several times per second) look-ups.

Alan

#8  

@thetechguru File IO sounds interesting, is that an option under controls? I don't see a controlled named that?

#9  

No, it is script functions. I am not in front of my computer now, but the commands are something like read line, read file, write line, write file (maybe append file). If you don't see something obvious, i'll boot up the computer later and give you the specifics.

Alan

#10  

DOH! I see there are a ton of script commands for file writing/reading. Thank you @thetechguru

United Kingdom
#11  

The file reading and writing functions are a good alternative to telnet and simple to implement.

HTTPGet is another that is pretty simple and great for APIs like Weather Underground, LastFM, IP webcams etc. for reading, writing and controlling.

I did have a file which had just the battery level of Melvin in it, it was updated every 2 seconds, this was checked by another application and the variable/information was in both applications. If you need an example of this I'll see if I have an old copy of Melvin's project.

I also use HTTPGet to pick up the current weather conditions, temperature etc. Again, if an example is needed I can post one. I have also used HTTPGet to pass information from ARC to another application via a PHP based web page, details of that are somewhere on here but again, if you need examples just ask.

I don't want to get in to too much detail without knowing any specifics so if you do need more information post up some specifics about what you want to do and I can tailor it to your needs.

PRO
New Zealand
#12  

I've used the file method mentioned to retrieve, update and rewrite variables as a storage and sharing of data method for a number of my ARC installations.

Each of the installations were in geographically different locations, my portable tablet PC, my desktop workshop PC, and school classroom PC, and not all connected by a LAN but connected to the WWW.

I tried storing the file in Google Doc's but it didn't like the frequent update of data. Dropbox however worked well.

I did have difficulty keeping mental track of all the variables though...

#13  

@Rich Thank you for your help and advice. Right now I don't have a list of proper specifications. I'm just happy knowing there are so many different ways to pipe information in and out of ARC. As I experiment I'm sure I'll have a few questions I could use your advice on.

But since you mentioned a battery level checker, how did you wire yours up? Did you use an ADC port (I assume not a digital port)? Did you use an external circuit to limit the battery voltage going into the EZ-B?

United Kingdom
#14  

LiPo Battery Monitor Tutorial

It should be all pretty clear to understand in that tutorial topic. But the key points; ADC ports read the voltage of the LiPo Cells A voltage divider is used to divide the voltage to a level which the EZ-B can accept, scripts multiply it back up.

The circuit can be adapted for other battery types easily. For instance, if you use a 12v SLA battery you can just change the divider to supply 1/3rd voltage to the ADC, max4v. A 7.2v NIMH a half divider. Etc.

Then just adjust the script to suit the number of batteries/cells and voltages.

#15  

@Rich Has helped resolve my questions. Thank you Rich!

#16  

Rich is SOOOO helpful. If the EZB was the starship Enterprise, Rich would most definitely be Spock! (meant as a compliment,Rich). I don't know what we would do without him.

#17  

Another option is to use the EZ-DB module that I wrote. It will allow you to store a variable in a database table, and retrieve a value from a database table. As you are a programmer, this could then be used by an external process to do whatever you want it to do. DJ was working on a way to export an array of all of the variables from ARC. I haven't had time to look to see if this was put into production yet. My plan is that when I have time, I will use this feature to grab all of the variables and store them, still allowing you to retrieve the one that you want by passing command line arguments to the EZ-DB.exe. I've been busy on other projects, but if you would like the code that I have written so far, let me know.

#18  

I'm actually working on my own database for ARC and other 3rd party robotics applications. My goal is to create one that will not require a SQL install.

#19  

That's great. I manage a bunch of DB admins at work so I personally like using MSSQL, but understand the desire not to have to have MSSQL running in an environment. For me, its just convenient.

#20  

Yes indeed SQL great. I too work with SQL. If it was for my own use I'd run a SQL db and be done with it. My goal is to create something that takes database storage and retrieval and make it easy for anyone to use along with having the smallest possible foot print. Not asking for much from my design, am I?

#21  

Its a great idea. Perl and Python would be great for this. C would also be good. Gotta be able to query the data quickly. This is an ambitious project. I cant wait to see how it goes for you. I guess I am not that ambitious at this point. :)

#22  

I have created a small telent sender for .net. you are welcome to it and it is very easy to use. EZ-Telnet.zip

it's very easy to use

Just make a reference to the DLL in your project then use a command like this to send data to ezb after setting up the TCP like sinstructed above.

EZ_Telnet.EZBTelnetClient.SendCommand("192.168.1.124","6666", "$thisvar = 1")

if you are looking at the variable watch you will see the new variable show up with its value. you can also send commands that trigger scripts or other ex-scripting command.