• Welcome to PiBoSo Official Forum. Please login or sign up.
 
July 22, 2019, 04:00:28 pm

News:

World Racing Series beta14 available! :)


Data output

Started by J Ostrowski, September 11, 2018, 04:16:25 pm

Previous topic - Next topic

J Ostrowski

Hello everyone,

I have been playing GP Bikes for about a month now. Alongside the game, I am developing a 6 DOF mini simulator. Therefore the live data being sent from the bike in game to my motion software is of great interest to me.

Does anyone know how I can view the raw data being sent. I understand that this data is being sent from a DLO file (which I also understand is just a renamed DLL).

I am also aware of the example output plugin on the downloads page. I pasted this into codeblocks and compiled it as a DLL and tried to use that instead of the DLO already in game (Which I believe is called proxy64). However, that did not work as my motion software failed to read any data. Any suggestions?

As you might have guessed from the above, I am by no means an experienced programmer, so please excuse my idiocy.

Thanks for your help guys.

HornetMaX

You have to give your .dlo its own name, not rename it to proxy64.

Never used codeblocks, hence won't be able to help too much in configuring it. In Visual Studio it's fairly easy (even in the free edition).

The .dlo receives data from GPB in a C structure: what you do with that is up to you (for example, the defuult telemtry plugin just writes some bike data to a text file).
If you want to use the data in the C structures with your motion software, you'll have to send the relevant data (roll/pitch/yaw angles, I guess) to your motion software/hardware.

If you have not enough experience in coding, sending data to mechanically dangerous hardware is a bit risky (but that may depend on how many protection your hardware/software has, like max torque, max rates etc).

h106frp

If your struggling with DLLs have you thought of using the new UDP proxy instead?

J Ostrowski

Thanks for the reply guys!

QuoteIf you want to use the data in the C structures with your motion software, you'll have to send the relevant data (roll/pitch/yaw angles, I guess) to your motion software/hardware.


So would I have to write my own plugin based off the example output one for that?

QuoteIf your struggling with DLLs have you thought of using the new UDP proxy instead?


I know even less about the new UDP than I do about DLL's. I've spent a little bit of time getting used to them and I understand the DLL's a little better because of it. My struggle now is writing my own plugin.

I appreciate any help I can get. Thanks all.

Gibbon

Quote from: HornetMaX on September 12, 2018, 08:01:02 pm
Never used codeblocks, hence won't be able to help too much in configuring it. In Visual Studio it's fairly easy (even in the free edition).



True. I had problems with CodeBlock and DLLs. It worked perfectly with Visual Studio.

J Ostrowski

I've switched to Visual Studio now.

Also, since you're here wkp. Do you have any guidance on making the DLL write a text file as well? I'm looking to do what you did in this post (http://forum.piboso.com/index.php?topic=3925.0).

Thanks

J Ostrowski

I've managed to simply make a plugin that writes a line of text to a txt file when GP Bikes is launched. Now I just need to figure put how I can write some bike data to that file. I want to write data that isn't on the logdata.csv file. Any thoughts?

Thanks.

h106frp

I think you may have a conceptual issue on how the example works.

Caution... very simplified model  ;)

You can call the dll and start it but all it does is create a collection of variables and positions them in a (shared) memory space.

When you called the dll it basically passes back the 'pointer' to the shared memory space so that you can copy that memory block into your program and re-create the collection of variables so that you can access all the values. This is why the calling procedure must use exactly the same variable declarations as the values are just a collection of bytes.

Its a c thing......


HornetMaX

Quote from: J Ostrowski on September 14, 2018, 01:07:55 pm
So would I have to write my own plugin based off the example output one for that?

Yes. The main callback you are interested into is RunTelemetry.

Quote from: J Ostrowski on September 14, 2018, 03:49:34 pm
I've managed to simply make a plugin that writes a line of text to a txt file when GP Bikes is launched. Now I just need to figure put how I can write some bike data to that file. I want to write data that isn't on the logdata.csv file. Any thoughts?

Not sure why you woul dwant to write to a file (except for learning purposes).
Anyway, you have all th ebike data in the structure SPluginsBikeData_t that is passed to RunTelemetry().
If you want to write stuff out, then well, just do that.

BTW, the default GPB telemetry plugin does just that, write data to a .csv: http://forum.piboso.com/index.php?topic=19.0

J Ostrowski

September 17, 2018, 08:04:19 am #9 Last Edit: September 17, 2018, 08:20:59 am by J Ostrowski
Thanks for the response guys.

QuoteBTW, the default GPB telemetry plugin does just that, write data to a .csv: http://forum.piboso.com/index.php?topic=19.0


Yeah I have seen that but I noticed it doesn't write all of the bike states such as roll velocity, CG accelerations and steer torque. Is there an easy way to get the plugin to include these?

Also is there an example code for the GPB telemetry plugin that I can have a look at?

Thanks again

HornetMaX

Quote from: J Ostrowski on September 17, 2018, 08:04:19 am
Yeah I have seen that but I noticed it doesn't write all of the bike states such as roll velocity, CG accelerations and steer torque. Is there an easy way to get the plugin to include these?

Also is there an example code for the GPB telemetry plugin that I can have a look at?

The plugin example source code is only missing a few lines to do what you want to do: open file, fprintf, close file.

My own plugin for telemetry can also output the data in .csv (http://forum.piboso.com/index.php?topic=1151.0)

J Ostrowski

QuoteMy own plugin for telemetry can also output the data in .csv (http://forum.piboso.com/index.php?topic=1151.0)


Thank you Max. I hadn't realised that your plugin was able to create a csv file.

Is the source code for your plugin available anywhere?

HornetMaX

Quote from: J Ostrowski on September 17, 2018, 03:22:33 pm
QuoteMy own plugin for telemetry can also output the data in .csv (http://forum.piboso.com/index.php?topic=1151.0)


Thank you Max. I hadn't realised that your plugin was able to create a csv file.

Is the source code for your plugin available anywhere?

Not really. But again, for something as simple as outputting bike data to a text file, the plugin example provided by Piboso is 90-95% of the code needed. You are only missing a few lines.

No intention to discourage you but if you can't write the necessary lines to write bike data to a text file, then the work necessary to interface to some hardware platform is probably too much anyway.

J Ostrowski

QuoteNo intention to discourage you but if you can't write the necessary lines to write bike data to a text file, then the work necessary to interface to some hardware platform is probably too much anyway.


I understand what you mean, which is why I have a piece of software that writes to the 6 actuator platform. This was bought from someone else and it does work.

I just wanted to know the exact values that GP Bikes was sending the software.

HornetMaX

Quote from: J Ostrowski on September 18, 2018, 07:41:51 am
I just wanted to know the exact values that GP Bikes was sending the software.

GPB sends to the output plugin all the values you see in the output plugin example.
In particular, for your usage, the relevant structure is SPluginsBikeData_t: all the (available) bike state values are there.
Have a look at it, it's commented.