Kart Racing Pro Official Forum

Mods => Plugins => Topic started by: SimRacer on January 07, 2011, 02:23:10 AM

Title: Visual C++ Telemetry Sample Project
Post by: SimRacer on January 07, 2011, 02:23:10 AM
Here is a sample project for those who would find it useful. It basically wraps up the sample code provided by Piboso into visual c++ and compiles the dll.

I was thinking that this could be modified/contributed to by other members to create some sort of proxy so that the sim only has to serve one dll, then other callers can grab it at their own rate from a memory map or other suitable device. This has a few advantages, firstly it would reduce the possibility that somebody writes a dll that is not right and causes a drop in frame rate, and also it means KRP only has to process the task of passing the telemetry to one dll which would have a good effect if there ends up being a lot of plugins made for the software over time.

Would like to hear other people thoughts.
Title: Re: Visual C++ Telemetry Sample Project
Post by: maxhurtz on August 03, 2011, 11:58:54 AM
Many thanks SimRacer, just what I was looking for.
Title: Re: Visual C++ Telemetry Sample Project
Post by: SimRacer on August 03, 2011, 06:03:56 PM
Your welcome! Hope you find it useful!
Title: Re: Visual C++ Telemetry Sample Project
Post by: maxhurtz on August 21, 2011, 04:42:32 PM
OK, I've got around to trying it, but am having no luck.
I have built the project with Visual C++ Express 2010 on 32 bit Windows Vista SP2.
Copied the dll into the KRP plugins directory and ran KRP and carried out a short testing session.
No sign of the log file (telemetry_output.txt) being created. Looked in the install folders and Documents\PiBoSo\Kart Racing Pro\.
Using ProcessMonitor I can see that it finds the dll, but it does not seem to successfully be calling any of the functions.

I even tried moving the install folder out of Program Files, in case it was a permission problem. Still no output.
The telemetry.dll supplied with KRP works fine - creates the logdata.csv file in Documents\PiBoSo\Kart Racing Pro\.
I removed that dll before testing the new one.

I noticed that this example returns 4 from a call to Version(), whereas the proxy example that PiBoSo has supplied returns Version 5. I assume that KRP beta 3 can handle either.

thanks for any light you can shed on the matter,

John
Title: Re: Visual C++ Telemetry Sample Project
Post by: PiBoSo on August 21, 2011, 04:49:10 PM
Quote from: maxhurtz on August 21, 2011, 04:42:32 PM
I noticed that this example returns 4 from a call to Version(), whereas the proxy example that PiBoSo has supplied returns Version 5. I assume that KRP beta 3 can handle either.

For a plugin to be loaded by Beta3, Version function must return 5.
Title: Re: Visual C++ Telemetry Sample Project
Post by: maxhurtz on August 21, 2011, 07:13:04 PM
OK, I changed it to 5, but still no luck.

Would posting a copy of my dll help?

thanks

John
Title: Re: Visual C++ Telemetry Sample Project
Post by: PiBoSo on August 21, 2011, 08:38:58 PM
Quote from: maxhurtz on August 21, 2011, 07:13:04 PM
OK, I changed it to 5, but still no luck.

Would posting a copy of my dll help?

thanks

John

It sure wouldn't hurt :)
Title: Re: Visual C++ Telemetry Sample Project
Post by: maxhurtz on August 21, 2011, 11:02:29 PM
Here you are.
The file created should be "telemetry_output.txt".

Thanks for taking a look.

John
Title: Re: Visual C++ Telemetry Sample Project
Post by: PiBoSo on August 21, 2011, 11:41:13 PM
Quote from: maxhurtz on August 21, 2011, 11:02:29 PM
Here you are.
The file created should be "telemetry_output.txt".

Thanks for taking a look.

John

It is correctly loaded, but it crashes.
Please make sure the structures and functions are updated to the latest version.
The sample project is probably using the old interface, instead of the new one, that can be found in "krp_example.c": http://www.kartracing-pro.com/?page=downloads
Title: Re: Visual C++ Telemetry Sample Project
Post by: maxhurtz on August 22, 2011, 12:21:32 AM
It works!

You were right, the structures were out of date (specifically the Event struct). Just copied the ones from krp_example, and removed the code that referred to the missing field (m_afLimiter[]) and it now works perfectly.

Thank you very much,

John
Title: Re: Visual C++ Telemetry Sample Project
Post by: SimRacer on August 22, 2011, 01:23:15 AM
Yep, the project needs to be updated as new versions of the interface become available. If you get around to using it and update it, please think about attaching a copy for others to download. Sorry that I have not had a chance to update it myself.
Title: Re: Visual C++ Telemetry Sample Project
Post by: jarowww on February 14, 2012, 03:04:00 AM
I was trying to play with live telemetry data representation, but well this didn't work out. I'm left with MVS2010 project so i thought someone may find some parts of it useful. I'm also attaching piboso example code inserted into project.
If someone want to check how program works there is dll. Program creates window that displays kart speed and speed of best lap so game need to be in windowed mode.
Title: Re: Visual C++ Telemetry Sample Project
Post by: dibu on February 14, 2012, 05:18:58 PM
Very nice toy jarowww, I like it. ;D

I used a second monitor for the diagrams and so I still could drive KRP fullscreen on my beamer.

Hehe, but it doesn't make me faster because it draws off my attention... ;)

Title: Re: Visual C++ Telemetry Sample Project
Post by: jarowww on February 14, 2012, 06:16:17 PM
QuoteHehe, but it doesn't make me faster because it draws off my attention...
This is exactly why this won't work. You can't look at window in corners or short straights you need to wait for long parts to check data, even then you can deconcentrate. And most importantly higher speed through corner doesn't always mean faster (i can drive on outside edge of corner and carry more speed). I was thinking about dividing track in maybe 1000 places and displaying difference to best lap (something like racing ghost) but still same problems apply.
Title: Re: Visual C++ Telemetry Sample Project
Post by: dibu on February 14, 2012, 06:47:59 PM
For a real time system it would be interesting to use the dashes of the onboard display. They are easy and fast readable.
If we could define multiple small splits which include the braking point to a corner and the following straight until the breaking point to the next corner, this would help very much. ATM each split contains multiple corners and it's hard to say where you really lost the time.

Title: Re: Visual C++ Telemetry Sample Project
Post by: jarowww on February 14, 2012, 06:59:22 PM
QuoteIf we could define multiple small splits which include the braking point to a corner and the following straight until the breaking point to the next corner
Next version of telemetry analyser will have window for displaying sector times (look attachment)
Quoteit would be interesting to use the dashes
You are really reading my mind. I bought graphic LCD and i will try to attach it to wheel and display some data on it. It just came today and still i have to check if it works because it looks like someone was sitting on it through whole delivery :) i even made small version (with cellphone LCD) http://www.youtube.com/watch?v=70RHrEdj3Ak
Title: Re: Visual C++ Telemetry Sample Project
Post by: dibu on February 14, 2012, 07:18:59 PM
Both, the LCD video and the preview to the next analyzer version are impressive, thanks.  :)
Also can't wait for the results with your new graphic LCD.
Title: Re: Visual C++ Telemetry Sample Project
Post by: tubefactor on February 14, 2012, 10:36:44 PM
Maybe an app in the future, so I can click my Iphone in the wheel as a display :)
Title: Re: Visual C++ Telemetry Sample Project
Post by: jarowww on February 15, 2012, 12:08:05 AM
Quote from: tubefactor on February 14, 2012, 10:36:44 PM
Maybe an app in the future, so I can click my Iphone in the wheel as a display :)
Well sorry but i don't think it will happen. And surprisingly me don't owning iphone isn't biggest problem. As i understand most developer tools are released only for mac and most of all writing apps for iphone isn't free (and price for writing app would be i think 5 times bigger than buying parts for LCD).
EDIT:
Also LCD works well so i think i will put it to use soon.

EDIT2:
I read your post once again dibu and it seems i have missed your point. You were talking about using in game dashes. But i don't think it is possible to modify value of displayed data, to make it work piboso would have to add some sort of function that could modify displayed value (but i may be missing something).

http://www.youtube.com/watch?v=hwImyAmp33U Bigger screen is so much better.