UDP as Input?

Gtuner IV general support. Operation, questions, updates, feature request.

UDP as Input?

Postby DeviateSquirrel » Wed Jan 27, 2021 4:49 pm

Is it possible to use a UDP stream (format below) as an input? This is head tracking data from https://smoothtrack.app/ (phone app). On the PC it then uses https://github.com/opentrack/opentrack to control head movement in games (or whatever). Since it's just XYZ and angle data I'm wondering if we can parse out that data and use it ACCEL and GYRO input/output. Any thoughts?

Code: Select all
byte[] buf = ByteBuffer.allocate(48)
                  .order(ByteOrder.LITTLE_ENDIAN)
                  .putDouble(x)
                  .putDouble(y)
                  .putDouble(z)
                  .putDouble(yaw)
                  .putDouble(pitch)
                  .putDouble(roll)
                  .array();
 
          DatagramPacket packet
                  = new DatagramPacket(buf, buf.length, address, port);
          socket.send(packet);
User avatar
DeviateSquirrel
First Sergeant
First Sergeant
 
Posts: 46
Joined: Sun Jan 17, 2021 11:07 pm

Re: UDP as Input?

Postby Scachi » Wed Jan 27, 2021 6:48 pm

I think for such custom project its is better to use an arduino board and let that do the conversion as the T2 has only limited memory for its firmware and implementing all kind of custom protocols won't fit in.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: UDP as Input?

Postby DeviateSquirrel » Wed Jan 27, 2021 9:18 pm

That's the direction I'm heading now.

Opentrack can be installed in Linux so I'm thinking of installing it on a Raspberry Pi. Then the phone with SmoothTrack would connect to the RPi where the translation happens and then it, hopefully, gets output as a game controller that I can plug into the T2.

Right now I can get gTuner to read the input from Opentrack using KMG Capture so I think I'm on the right track.
User avatar
DeviateSquirrel
First Sergeant
First Sergeant
 
Posts: 46
Joined: Sun Jan 17, 2021 11:07 pm

Re: UDP as Input?

Postby J2Kbr » Sat Jan 30, 2021 4:49 pm

Xbox 360 and PS3 controller emulators are available for development boards (such as Arduino and possible for Raspberry Pi). You should have no problem implementing this solution. ;)
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm


Return to Gtuner IV Support

Who is online

Users browsing this forum: No registered users and 195 guests

cron