Touche icon indicating copy to clipboard operation
Touche copied to clipboard

Timing question

Open ncaccamo opened this issue 4 years ago • 4 comments

Looking at touche.h, line 65 (as of Jun 13th commit), the double touch time is set to 300ms. Above in the comments, it is explained that there is ~260ms of processing time when both tips are pressed. For clarification, does this mean that the system cannot meet the rules timing requirements to distinguish between a single touch or double touch due to processing/communication delays?

I am also wondering what are good methods to measure these timings across the whole system given the various factors?

ncaccamo avatar Aug 18 '21 19:08 ncaccamo

Yes, the rule says that a double hit must be made within 50ms but the minimum timing I got when pressing the two buttons at the exact same time was 260ms, so by setting 300ms I give a little more tolerance to this timing and it works better. From what I tested the difference is almost not noticeable.

I don't have any 'good' method to test the timings, I just press the two buttons at the exact same time and read the millis() difference of the two when the server receive it

Yohannfra avatar Aug 30 '21 16:08 Yohannfra

Hi, There is also the question of how long the tip is depressed before a hit will register (I think 17ms for foil?) - I found in the client where it appears to be hard-coded to 2ms - is that correct - maybe I'm looking in the wrong place?

Riposte63 avatar Sep 19 '21 23:09 Riposte63

You can look at client/lib/Weapon/src/Weapon.cpp and client/src/main.cpp

If the tip is pressed the hit will register instantly. where did you find 2ms ? Actually It should wait a few ms but it was causing some latency so I removed it for now until I find a solution.

Yohannfra avatar Sep 23 '21 08:09 Yohannfra

It was me looking in the wrong place regarding the 2ms - sorry ;-) In terms of a solution - just an idea - would it help if the server's only function was to manage the virtual ground for the piste and any other communication was directly between the clients and with LEDs clipped to inside of mask?

Riposte63 avatar Oct 09 '21 04:10 Riposte63