Results 1 to 9 of 9

Thread: Stream data over network?

  1. #1
    Join Date
    Aug 2007
    Beans
    58

    Stream data over network?

    Hey all

    This is going to be a fairly open ended question. I have a Windows-only application that is connected to a motion tracking camera. The output of this application are the X,Y coordinates of the object that is being tracked. The API for the camera is Windows-only, but I want to be able to stream the data recieved by the camera over to a Linux machine. I'd be developing a program on Linux that would make use of the coordinate data.

    So the question is how would I accomplish such a thing? The windows application is basically outputting data to a command line. It's minimal to reduce processing load. How could I send the coordinate data from the Windows app to a Linux machine (it would be over a network)?

    I'm really not sure where to begin and would appreciate any ideas!


    Thanks,

    KF

  2. #2
    Join Date
    Oct 2005
    Location
    Seattle, WA
    Beans
    494
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Stream data over network?

    Have you looked into winsock? This might be a place to start. You could do something lame like store the raw text in a file and ftp it over
    www.runtime-era.com - Blog About My Journey as a Developer

  3. #3
    Join Date
    Aug 2007
    Beans
    58

    Re: Stream data over network?

    I'll check out Winsock, thanks. I don't want to dump to a text output from the command line and FTP it since this application needs to be as close to 'real-time' as possible. I want to take every step to ensure minimum latency.

  4. #4
    Join Date
    Aug 2008
    Location
    Brunei & Australia
    Beans
    24
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Stream data over network?

    Yep have a look at using sockets (winsock). Basically wrap up the data output from you're device's Windows API and pump out as ASCII on to a socket. Write your app in Linux to connect to the socket on your Windows machine and parse the ASCII sentence.
    A few other ideas:

    * Wrap up the output from the device and send to a web service running on your Linux box (could be a simple URL with arguments or even an XML service). You could get it to post to the web server every 10 seconds or so.

    * Set up a database and write the XY data to a table. Get your Linux app' to poll the database every so often.

    * Simply write from your Windows app in append mode to a file on the Linux box.

    Out of curiosity what motion capture system are you using?

    Regards,
    Nick Lake

  5. #5
    Join Date
    Aug 2007
    Beans
    58

    Re: Stream data over network?

    I'm using a SmartNAV camera from NaturalPoint along with their OptiTrack SDK.

  6. #6
    Join Date
    Aug 2007
    Beans
    58

    Re: Stream data over network?

    So I think I've got the basics of WinSock down. I have a small TCP client set up as a test built with Visual C++. I was able to successfully send data to remote hosts with it...

    Now the issue is the Linux program, which I want to act like a server. I have a few questions about this (and linux programming)...

    * What API (like WinSocks for Windows) do I use to build socket applications on Linux

    * Will an app I build with Ubuntu be compatible with other Linux distros (popular ones, anyway)

    * Is there a way to build the app so that it will be cross compatible with OS X?

    * Are there any IDEs that work well with Ubuntu?

    Thanks!
    KF

  7. #7
    Join Date
    May 2007
    Beans
    4,513
    Distro
    Ubuntu

    Re: Stream data over network?

    I'll try and answer some...

    * sys/socket.h for socketing

    * yep, high chance that it'll work just fine

    * maybe if you use some 'pure' C libraries, yeah

    * there's a ton actually, but give Geany a try.

  8. #8
    Join Date
    Oct 2005
    Location
    Seattle, WA
    Beans
    494
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Stream data over network?

    Quote Originally Posted by kachofool View Post
    * What API (like WinSocks for Windows) do I use to build socket applications on Linux

    * Will an app I build with Ubuntu be compatible with other Linux distros (popular ones, anyway)

    * Is there a way to build the app so that it will be cross compatible with OS X?

    * Are there any IDEs that work well with Ubuntu?
    If you are doing the server end in C, it comes with socket libraries built in.

    I'm thinking your server will run on any linux distro assuming it has the proper libraries you plan to use.

    Yes there is a way. Are you using a GUI?

    Anjuta, Eclipse, etc. There are many.

    Goodluck!
    www.runtime-era.com - Blog About My Journey as a Developer

  9. #9
    Join Date
    Aug 2008
    Location
    Brunei & Australia
    Beans
    24
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Stream data over network?

    Why not try and use Mono? And then develop it in C#.NET... Just one way to support multiple OS.

    You will need to use System.Net.Sockets

    Regards,
    Nick Lake

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •