Author Topic: Data output  (Read 690 times)

J Ostrowski

  • Newbie
  • *
  • Posts: 11
    • View Profile
Data output
« on: September 11, 2018, 04:16:25 PM »
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

  • Hero Member
  • *****
  • Posts: 5939
    • View Profile
Re: Data output
« Reply #1 on: September 12, 2018, 08:01:02 PM »
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

  • Hero Member
  • *****
  • Posts: 1859
    • View Profile
Re: Data output
« Reply #2 on: September 12, 2018, 08:12:19 PM »
If your struggling with DLLs have you thought of using the new UDP proxy instead?

J Ostrowski

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Data output
« Reply #3 on: September 14, 2018, 01:07:55 PM »
Thanks for the reply guys!

Quote
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.

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

Quote
If 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

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Data output
« Reply #4 on: September 14, 2018, 01:16:24 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

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Data output
« Reply #5 on: September 14, 2018, 02:05:53 PM »
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

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Data output
« Reply #6 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?

Thanks.

h106frp

  • Hero Member
  • *****
  • Posts: 1859
    • View Profile
Re: Data output
« Reply #7 on: September 14, 2018, 07:02:07 PM »
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

  • Hero Member
  • *****
  • Posts: 5939
    • View Profile
Re: Data output
« Reply #8 on: September 14, 2018, 07:11:21 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.

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

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Data output
« Reply #9 on: September 17, 2018, 08:04:19 AM »
Thanks for the response guys.

Quote
BTW, 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
« Last Edit: September 17, 2018, 08:20:59 AM by J Ostrowski »

HornetMaX

  • Hero Member
  • *****
  • Posts: 5939
    • View Profile
Re: Data output
« Reply #10 on: September 17, 2018, 09:49:35 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

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Data output
« Reply #11 on: September 17, 2018, 03:22:33 PM »
Quote
My 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

  • Hero Member
  • *****
  • Posts: 5939
    • View Profile
Re: Data output
« Reply #12 on: September 17, 2018, 06:05:57 PM »
Quote
My 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

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Data output
« Reply #13 on: September 18, 2018, 07:41:51 AM »
Quote
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.

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

  • Hero Member
  • *****
  • Posts: 5939
    • View Profile
Re: Data output
« Reply #14 on: September 18, 2018, 09:36:55 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.