ideas for getting NetworkSend data into stand-alone app

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
jeffmun
Posts: 3
Joined: Mon Oct 04, 2010 5:23 pm

ideas for getting NetworkSend data into stand-alone app

Post by jeffmun » Mon Oct 04, 2010 5:39 pm

Using 0.3.7.r1462

So far EventGhost has been great. I have just one more hurdle...

I am a reserach psychologist studying children with autism and I am trying to automate the calibration procedure for my eye-tracker. What I have is a Panda3D app (written in Python running on PC1) that displays a scene that the child views. An eye-tracking system (PC2) is monitoring the child's gaze. I am using EventGhost to fill in some gaps in the UI from the eye-tracking system. I am essentially controlling the calibration process on PC2 remotely via calls from PC1 to execute EventGhost macros on PC2, then sending the info the macro gathers back to PC1.

I am able to use the "NetworkSend.py" class directly within Python on PC1 to initiate the EventGhost macro on PC2. Then I send the values collected as the payload in the NetworkSend on PC2. This works except that I only have access to these values within EventGhost on PC1 and what I need is to get these values into my Panda3D app. I'm not sure how to set up a socket to read these values from within my Panda3D app.

The Panda3D app does read a UDP connection from the eye-tracker to get all the eye-tracking data. I assume I need to do something similar for EventGhost, but I'm not sure the best way to go about it. I realize there are likely a variety of solutions, but I'm looking for some direction and especially some sample code that can set up a connection to read an EventGhost NetworkSend event from within a stand-alone Python app.

I'm not a programmer, but I'm getting around in Python and I get the gist of socket communications. It's not clear to me whether the NetworkEventReceiver plugin code can be adapted to use in this setting. The only EventGhost functionality I need on PC1 is to NetworkSend (which is working) and something to read a NetworkSend from PC2.

Any help would be greatly appreciated.
Thanks,
Jeff Munson, PhD
University of Washington

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: ideas for getting NetworkSend data into stand-alone app

Post by krambriw » Mon Oct 04, 2010 7:08 pm

Your Panda3D application is written in Python and you have the source code for this?

If so, I'm sure it would be possible to "integrate" a network send/receive functionality like you need. As you already write, looking at and partly using the already existing code is the approach I would use as well

I would leave the EG installation on both PC's (good for verification that the network messaging is working fine) and then I would try to figure out how your Panda application could get the recieved information either directly or indirectly from EG in PC1

Idea/suggestion: have a look at the Network Broadcaster plugin
http://www.eventghost.org/forum/viewtopic.php?f=9&t=724
This might be more convenient because you add the same plugin to both EG configurations in both PC's and the author states that it can send network messages using UDP (I havent tried it). It might be that your Panda application can listen to those events if you configure it for the correct port number

At least worth a try

At the end just a feeling I have about your request; I believe this community is willing to provide help, especially for a good sake if this can help young children as you mentioned, but the major focus is to improve the functionality of EvenGhost itself.

However, your request is not really going to improve EventGhost itself, instead it will improve your application itself and therefore feels a little bit biased towards a commercial application unless it "stays forever at the university"

I have personally nothing against if users are using my few contributions commercially because I basically made them for my own needs and sharing is just fine for me.

Maybe it would be fair from your side to describe a little bit more about the goals and targets of the research work you are doing (some projects at universities are sponsored by bigger companies that are later entitled to have access or even ownership of the results and they should then also finance the thing)

Best regards, Walter

jeffmun
Posts: 3
Joined: Mon Oct 04, 2010 5:23 pm

Re: ideas for getting NetworkSend data into stand-alone app

Post by jeffmun » Mon Oct 04, 2010 9:25 pm

Thank you for the suggestion of Network Broadcaster, this may be helpful.

Regarding your other points, I understand your concerns. Panda3D is an open-source real-time graphics engine that I am using for my research. I am a research assistant professor at the University of Washington and the projects I work on are funded from a variety of sources, primarily from various institutes of the National Institutes of Health and private foundations focusing on autism. I'm using Panda3D and the eye-tracker to develop activities to help measure visual attention in children who have very little communication skills. For these non-verbal children, traditional assessments of cognition yield very little information as these children use very little language and tend not to use nonverbal gestures (e.g., pointing) to communicate either. I hope, that by measuring gaze in real-time and having that information available to the graphics display program, that there is some "signal" in eye movements from which we can infer aspects of the child's understanding of the scene. These activities are being developed by myself and the students working with me. I am at the earliest stages of this work and there are no plans for any commercial development at this point. I have the eye-gaze data integrated into Panda3D and we are working some other pieces of the infrastructure (like calibration). I just want to help these kids and their families. I'm using as much open-source software as I can for this project to facilitate student involvement in my lab: Panda3D (real-time graphics engine), Blender (modeling and animation), R (data visualization), SQLite (persistent data storage).

Working with these children, I don't have the luxury of simply telling them to "look at the dot on the screen" in order to calibrate the eye-tracker using the built-in procedure. Thus, I am building an interface (EventGhost is one part of it) to present a more child-friendly and semi-automated calibration procedure. I am in contact with the developers at the eye-tracker I use and this level of remote access to calibration is not supported so I'm trying to build my own.

Thanks again for the quick response.

Sincerely,
Jeff Munson

jeffmun AT uw DOT edu

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: ideas for getting NetworkSend data into stand-alone app

Post by krambriw » Tue Oct 05, 2010 5:29 am

Dear Jeff,
Thank you for this introduction to a very interesting and important topic. I wish you good success in the research and I will try to help as much as possible if needed

Best regards, Walter

jeffmun
Posts: 3
Joined: Mon Oct 04, 2010 5:23 pm

Re: ideas for getting NetworkSend data into stand-alone app

Post by jeffmun » Tue Oct 05, 2010 3:41 pm

Thanks Walter. Your comments and link have been helpful.
Take care,
Jeff

damage
Posts: 40
Joined: Thu Nov 27, 2008 6:39 pm

Re: ideas for getting NetworkSend data into stand-alone app

Post by damage » Sat Oct 09, 2010 7:42 pm

i have actually pulled the NetworkReceiver plugin code out into a stand-alone python script as an interim step of removing EG from my system. this particular version has added xPL functionality that would broadcast networkreceiver messages as xPL messages, but that can easily be removed. if you search the code for "state3", that's where you would put your code to deal with the received messages. maybe this can be of use to you. link to script here http://goo.gl/iD19

NetworkSender plugin also extracted http://goo.gl/yIV9

Post Reply