HARPLab / DReyeVR

VR driving πŸš™ + eye tracking πŸ‘€ simulator based on CARLA for driving interaction research
https://arxiv.org/abs/2201.01931
MIT License
139 stars 37 forks source link

Measuring a time interval via button presses #149

Closed StijnOosterlinck closed 5 months ago

StijnOosterlinck commented 7 months ago

Hi,

I want to perform a time production task where a certain participant has to time a certain interval (e.g. 30s). Ideally, the participant should press a button on the logitech wheel, which starts the timer and then he/she needs to press again when he/she thinks the time interval has ended.

So I want to register these button presses and measure the time interval between them (and print the result or something). For registering the button presses, I believe I can change the LogitechWheelUpdate method in DReyeVRPawn.cpp to map one of the rgbButtons to be the timing button (since these are all reverse buttons right now).

What would then be the best way to register the time & print the result? Can i use the chrono library to monitor the time interval and at the end just print the result or is this not possible?

I also want to use this with a packaged version (for optimized driving conditions for the participants), so ideally it has to work with a packaged version as well.

Thanks in advance!

ajdroid commented 7 months ago

I would recommend using our recording mechanism (described here). The run_experiment file will produce a recording of your scenario which can be parsed with our parser. The resulting parsed file contains the state of user inputs like throttle/turn signals at every simulator timestep. You can then change one of the face buttons or the turn signal paddles behind the wheel to be the timing button.