• Welcome to PiBoSo Official Forum. Please login or sign up.
 
March 28, 2024, 06:37:14 PM

News:

GP Bikes beta21c available! :)


UDP Proxy

Started by PiBoSo, July 18, 2018, 04:01:57 PM

Previous topic - Next topic

h106frp

I have just been looking into this and it does appear feasible as 'processing' has support for android and the code is consistent across platforms. I will give it a go and report results .......

davidboda46

Awesome. Thanks man.

Cheers,

/David "Gonzo" Boda #46
"THE EDGE... THERE IS NO HONEST WAY TO EXPLAIN IT BECAUSE THE ONLY PEOPLE WHO REALLY KNOW WHERE IT IS ARE THE ONES WHO HAVE GONE OVER"

h106frp

Well after a crash course in processing/android I have it running on my phone via wireless  :)   :o

Fixed up the code so that it handles the various game states without issues.

Iissue to resolve;
Scaling the display to fit the phone(s)
Deciding on configurable features

Working out how you can distribute the app.


My first android application  ::)

Many thanks to maggikk for pointing me towards processing - very useful language.

matty0l215

Package the APK as an .apk. People can just download and install manually

Great work guys :D
For faster responses, please visit the discord server- HERE

maggikk22

glad I could help!
I'm looking forward the android app!

matty0l215

Quote from: maggikk22 on November 03, 2018, 10:46:49 PM
glad I could help!
I'm looking forward the android app!



Thank H106FRP he's the one doing all the work ;D
For faster responses, please visit the discord server- HERE

HornetMaX

That's some nice work h !

I feel bad for being lazy and never wanting to look into this stuff (dash on other device).

h106frp

Cheers MaX,
Getting close to something that can be released and to be honest, now the LAN communication framework are working the coding for an application is fairly simple and 'processing' already has very powerful graphical capabilites.

The biggest headache on android is making everything scale to the huge range of display sizes.

As far as further development it is probably best to wait for the next beta as Pib has already indicated additions to the UDP interface.

matty0l215

I've just had a mad idea to hack apart an old phone and mount its sceen to the HS2 bars.... :o ;D
For faster responses, please visit the discord server- HERE

h106frp

Im sure some 'Blue Peter' type cardboard skills you could soon knock up something resembling a 2D or AIM dash.....

You will need 2 toilet roll centre, a cornflake packet and of course a washing up liquid bottle - just get an adult to help with the scissors  ;D

matty0l215

I will get the "Stick Back Plastic" out ;) ;D
For faster responses, please visit the discord server- HERE

davidboda46

November 07, 2018, 09:08:41 PM #26 Last Edit: November 07, 2018, 09:14:06 PM by davidboda46
@Piboso So it's not possible to copy the proxy_udp and use it with Beta 13? Along with the files in the plugin folder (I know it's 64, but I thought it was worth a query)?

Cheers,

/David "Gonzo" Boda #46
"THE EDGE... THERE IS NO HONEST WAY TO EXPLAIN IT BECAUSE THE ONLY PEOPLE WHO REALLY KNOW WHERE IT IS ARE THE ONES WHO HAVE GONE OVER"

PiBoSo


First post updated to add information about the extra packets that it is possible to enable starting with Beta15.
"La perfezione non è il nostro obiettivo, è la nostra tendenza".

D4rw1n

April 07, 2019, 07:34:56 AM #28 Last Edit: April 08, 2019, 09:52:45 PM by D4rw1n
Hi,

I'm trying to figure out how to read/understand following data from UDP payload:

float m_aafRot[3][3]; /* rotation matrix of the chassis. It incorporates lean and wheeling */

When reading data at offsets 73,77,81,85,89,93,97,101,105, I get such matrix (motorcycle idle, perpendicular to ground, 0 km/h):

Rotation chassis matrix
[-0.53] [-0.05] [0.85]
[-0.04] [1.00] [0.03]
[-0.85] [-0.02] [-0.53]

I'm not an expert in algebra but I have some knowledge though. Reading through Wikipedia page (https://en.wikipedia.org/wiki/Rotation_matrix), I'm unsure whether I'm decoding the values in the wrong order (rows/columns) or whether it's a special matrix shape I don't see in wikipedia.

Could someone clarify how to:
1) read the 9 values in the correct order for display it in 3x3 matrix (like shown in wikipedia)
Does that reflect Ry in following picture?

If so, how could this be lean + wheeling? My current understanding is that lean would be one of the 3 R{x,y,z} and wheeling another one of them.

2) how to summarise the meaning of such values? I'm looking to know whether this can be handful for a motorcycle simulator platform (6DOF or something else) or is it just a different way to express values already gathered in a different shape, such as:
float m_fYaw,m_fPitch,m_fRoll;                           /* degrees, -180 to 180, offsets 109,113,117 */

Thanks in advance for any information!


FYI this is my python code that displays the matrix:

tm_rot_chassis = struct.unpack_from("fffffffff", data, offset=73)
print("Rotation chassis matrix\n"\
"[{v1:.2f}] [{v2:.2f}] [{v3:.2f}]\n"\
"[{v4:.2f}] [{v5:.2f}] [{v6:.2f}]\n"\
"[{v7:.2f}] [{v8:.2f}] [{v9:.2f}]\n"\
.format(\
v1=tm_rot_chassis[0], v2=tm_rot_chassis[1], v3=tm_rot_chassis[2],\
v4=tm_rot_chassis[3], v5=tm_rot_chassis[4], v6=tm_rot_chassis[5],\
v7=tm_rot_chassis[6], v8=tm_rot_chassis[7], v9=tm_rot_chassis[8]\
))

PiBoSo

April 16, 2019, 10:20:49 PM #29 Last Edit: April 18, 2019, 11:00:07 AM by PiBoSo
The rotation matrix is made of three orthogonal axes:
x axis = [0][0], [1][0], [2][0] ( 73, 85, 97 )
y axis = [0][1], [1][1], [2][1] ( 77, 89, 101 )
z axis = [0][2], [1][2], [2][2] ( 81, 93, 105 )
Where X+ is right, Y+ is up and Z+ is forward.

It is a different way to represent the same chassis rotation in space as with m_fYaw, m_fPitch and m_fRoll.
"La perfezione non è il nostro obiettivo, è la nostra tendenza".