Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Send & get data from an external program in real time

Jean Seminario
Registered User
Join date: 16 Jan 2009
Posts: 3
01-20-2010 17:35
Hi am going to use second life as part of my dissertation project and it will be very usefull to know wheter i can send and recieve data in real time from SL using lind script in second life and some other external prog lang.

For example my player is interracting with an object and as soon as he click on it i want to send in real time some information related to that object to an external program on the same (or another computer if possible) work on that information and send back to second life some data(could be a text format or something else) which i could use in many ways such us change or move the object somehow. All this should be done in real time.

Is what i mentioned before possible, if yes in what extent,using what technogies and any suggestions of how would be very useful.

Thanks
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
01-20-2010 17:47
Take a look at http://wiki.secondlife.com/wiki/LlHTTPRequest and http://wiki.secondlife.com/wiki/LlHTTPResponse, both of which handle external communication. So long as you have a server where you can put a program (in PHP or PERL, for example) to take care of handling the data outside of SL, you can do what you want.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-20-2010 19:57
depending on how simple or complex the communications need to be, you can at the very least do it at web speed, which may be effectively real time for your purposes...

the easiest solution to implement would be an external web server, accesible to the internet

(inword SL http requests originate from LL's end not locally in this case, so a private network web server would need to be exposed to the internet, though it could be address filtered)

the technologies involved on the external to SL side would be an http server, some sort of scripting solution for that (php probably), and perhaps a database (like mySql). pretty basic stuff for any web developer.

in SL you'll want someone familiar with LSL (the Linden Scripting Language) as other languages are not yet supported, and it has... quirks. specifically someone that is familiar with the in's and outs of http communications in LSL, and at least some understanding of PHP (so that they can either communicate effectively with, or assume the role of your web server programmer)

before anything you'll want to talk with your LSL person and lay out your precise intended interactions, as SL doesn't yet have integration for some things, and they'll be able to point out an difficulties and provide you with possible alternatives if necessary.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
01-20-2010 20:25
This link might be helpful too, it was given to me by an avatar named Opensource Obscure.

http://alisl.org/chromutate/
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
01-20-2010 22:54
Make sure you read this if you plan to do real time with HTTPRequest:

http://lslwiki.net/lslwiki/wakka.php?wakka=llHTTPRequestThrottle1

There might be plans to change that soon but in the meantime it will save you some headaches.
Jean Seminario
Registered User
Join date: 16 Jan 2009
Posts: 3
Move objects by looking at them.
01-21-2010 04:39
Thanks for all the answers, are going to be a great help. And i apologize for the long message but please go through it and i promise you will find it quite interesting.
I have some knowledge of sl scripting and interaction since i created a simple interractive learning environment in another project,
I ll describe exactly what i am going to do, and based on your experience, regarding to Second life capabilities and limitations, let me know your opinion whether is physable or not. Also your general feeling of how good this idea sounds to you in the case that i succeed.

The idea is to put an eye tracker device on me(physically me) and connect it to a computer. What the eyetracker does, it looks in my eyes and can return me really fast the exact point in space of where am i looking at.

Having that, ill use my avatar in not sure how u name it in personal view, like viewing the scene from the avatars eyes without viewing the avatar body.

So the plan is while looking at the computer screen(which will display the sl enviroment from the avatar point of view), ill wear the eye tracker which will return me the point in sl space that my avatar is looking.

Then first aim is to send this information to sl through some program-network(or local program like java), then using sl scripting and the point identify the exact object(and point) my eyes was looking at and send information about the object back to the server.

The second aim, is since i manage to find out the object am i looking at, try to modify it or move it and in general interract with it.As soon as my eyes and gazed moves to something else the whole procedure will be repeater.

As u understand, this will give me the power to move and interact with object only by looking at them, without having to click on any of these. Also information will be gathered on how our visual system works and how it respond to sudden changes on something we are looking at. So its absolutely neccesary that the data exchange will be in real time, in order to make that realistic.

Thanks
Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
01-21-2010 04:51
It's called mouselook. I would recommend minimal scripting on this. You could modify the client source to get most of the infos then issue a simple command, for instance a chat command.

It's a great project hope you'll get it done.
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
01-21-2010 05:24
Is this something that'd work better using a modified viewer?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-21-2010 06:36
sounds very similar to a motion tracking rig, like for a speech synthesizer.

getting the eye tracking to do movement commands will obviosioly need to happen on your end, but the camera position memorization could easilly be done via lsl's camera tracking (which can track both where you are, and where you looking at)

interaction with the object from there may be a little difficult... you can easily fire what amounts to a sensor bullet (that doenst have to be visible) at the centered object and get details about it. but much of the editing requires the edit menu. you can script quite a few edit actions via dialog, or various touches and hud type communications, and probably even http (the specialized touch or "bullet" can trigger a http request, which can be processed on an interactive web page, and then another request goes back to the object)

I'm thinking you'll need both httprequest, and http-in, along with permissions and camera tracking/controls, and handlers for whatever actions you'll want to actually have the object do. if you intend all actions to be automated you can probably get away with just http reqeuest.

sounds like a fun project, and for the large part very doable.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
01-21-2010 11:44
I agree with Void 100 percent, and it does sound like a very interesting project. I hope you are able to share your progress with us here in the forums as you work on it, and, as usual, the scripting gurus here in the forums will be glad to help you out should you get stuck. Good luck with your project!
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
01-21-2010 14:47
It's worth trying before hacking into the viewer. I am unsure how many events per second you could handle that way, 5 to 15 I guess.
Jean Seminario
Registered User
Join date: 16 Jan 2009
Posts: 3
Power of eye tracking
01-21-2010 16:51
Thanks for the replies, and inspirations.
To make clear my aim again is to understand the exact object(whatever object,even an avatar) that my real eyes are looking in the virtual world(using external eyetracker system) and then get info of the particular object and interact with it, only using my real eyes(not using any mouse to point to something nor to click). Just by looking at my screen witch will disply the virtual world. To get info about the object should be easy for any object but of course i know in order to interact-make an object move it that does not belong to me its impossible since requires first authorization of whoevers it belongs and most importanly script embedded in that object. So the interraction will be tested on objects i create giving them the neccessary script.If this succeed then the interraction with anything else in the world could come to later stage with support from SL. The project will try to explore these things so it can open new ways for communication and interrcation. Imagine disabled people been able to communicate and give commands to their computers only by looking at them.

Anyway back to the technical thing if am not wrong all this scripting should be done in SL and php would only be used to work with the eyetracker and send info about the geometrical point am i looking at to sl in order to recognize it in sl.

The only problem is that i mighg face is the need for a quick respond time, since my eyetracker does 2ms sampling rate of the eye movements and sl is not that fast as i found,
"llHTTPrequest throttle has been changed to “once per second per object per sim”, enhancing SLweb integration " from this website :
https://blogs.secondlife.com/community/features/blog/2006/09/02/second-life-1121-release-on-september-6.
This is not very sufficient but i think i will still manage to get info and interact with some of the objects i look with a small delay.
Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
01-21-2010 17:33
That's why viewer integration would save some precious seconds. You can map the camera moves to keyboard keys and probably determine which prim you are looking at from the viewer. You can also issue chat commands. I don't think you can issue a touch from mouselook, but Void's idea of sending bullets would still work.

Oh and from the viewer you can also interact with the UI, you'll probably have to make your own as the standard one would be impractical.

The source code is available here:

http://secondlifegrid.net/technology-programs/virtual-world-open-source/code

The farther you stay away from LSL the less you will lag the sim anyway. There are also some open source 3rd party viewers which might give you inspiration, like RLV, Emerald and such.

Is it part of a cognition experiment?