The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 94 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 573 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 573 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $can_access_moderationqueue - Line: 752 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 752 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $awaitingusers - Line: 34 - File: global.php(959) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(959) : eval()'d code 34 errorHandler->error
/global.php 959 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 1024 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 1024 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5308 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5308 errorHandler->error
/global.php 1024 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1429 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Forums
how to extract the speed of the car in runtime - Printable Version

+- Forums (https://www.vdrift.net/Forum)
+-- Forum: Community (https://www.vdrift.net/Forum/forumdisplay.php?fid=3)
+--- Forum: Help (https://www.vdrift.net/Forum/forumdisplay.php?fid=5)
+--- Thread: how to extract the speed of the car in runtime (/showthread.php?tid=1635)



how to extract the speed of the car in runtime - kraessig - 05-03-2012

Hi,

I am a technical assistant of the University of Salzburg and my current task is to setup up a car simulation with the special condition that we need the current speed in runtime sent to an external program for evaluation purposes.

Sadly my knowledge of C++ is not really well, so i thought i asking four help could be my best alternative.

What would be my best choice to get to these data?

An co-worker of mine found the following post in the forum but the link seems to be broken. Would this be an option?

http://vdrift.net/Forum/viewtopic.php?t=1625&highlight=speed

Thank you in forward for your input.


- NaN - 05-03-2012

Hi kraessig.

What is going to be your receiver? The most simple way would be to write the velocity into an output stream I think. Then you would redirect it for further processing.

The only catch is that on windows stdout/stderr are redirected to stdout/stderr.txt by default.

In game.cpp line 898 is the cars update loop. If you are only interested in the values of the first car just do something like(to get velocity magnitude)
std::cout << cars.begin().GetSpeed() << std::endl;

To get the velocity in car space(forward direction is y-axis) you have to add a function to calculate it. Something like: quatRotate(-GetOrientation(), GetVelocity());


Maybe we should add it to the public interface.


- kraessig - 05-03-2012

The receiver will be an contextual experience sampling server (written in java). This server communicates with xml-stanzas sent over TCP.

So basically i am searching for a way to send the current speed of the car to this server, so we can process the received data for an study.

VDrift itself will most likely run on a Windows machine.


- NaN - 05-03-2012

Just had a look. You have to recompile SDLmain.lib with NO_STDIO_REDIRECT. Then you can use the line I've posted to output current car speed. Just add the xml bits to it.

Use netcat(I think there is a windows version) to send it over tcp to your server.

VDrift log info(between game runs) is also fed into stdout. Make sure to ignore it.


- kraessig - 05-10-2012

first of all i want to thank you for your great support in my case Smile

Right now i am struggling to build the project the first time (i didn't alter any code at the moment).

Building the project throws some warnings (39 times) but no errors.

The loading screen starts (but plain black) with all the options, but it wont load a race. It just shows the loading bar and exits back to the practice race start screen.

stderr.txt:

ERROR: You don't have an NVIDIA or ATI/AMD card. This game may not run correctly or at all.
ERROR: Couldn't load spinning car: 350Z
ERROR: Loading log: 350Z.car.camera.0, 0.55, 1.type not found.

ERROR: 350Z.car.camera.0, 0.55, 1.type not found.
ERROR: Error loading car: 350Z
ERROR: Unable to load car 350Z

I have switched the shaders on off because my Graphics Cards is Intel Onboard. My normal installation of the games runs this way.

Thanks for your input in advance.


- NaN - 05-10-2012

When compiling from source make sure to pull the latest vdrift data.

And maybe also delete the settings folder .vdrift or C:\Users\{user}\Documents\VDrift after update.


- kraessig - 05-10-2012

thanks for the advice ... it seems as if i accidentally downloaded the wrong data sets. Now it works Wink Finally i can start working on the problem itself Big Grin


- NaN - 05-10-2012

The stdout stuff seems to be a bit more involved as you have to create a console.

I think it might be simpler to use an existing socket wrapper/implementation like this one(just follow the client example): http://www.adp-gmbh.ch/win/misc/sockets.html#header


- kraessig - 05-10-2012

thx for the advice. actually i am searching right now for a good socket example Wink. Gonna look at it.


- kraessig - 05-10-2012

so, once again thanks for your support NaN.

It's working totally fine. My quick-and-dirty-built-java-server receives everything Wink.


- NaN - 05-10-2012

You're welcome. Nice to see it being of use.


RE: - cac1234 - 02-22-2017

This was so helpful- thank you!