Ubuntu: Reading /dev/input/mouse0 for mocap data


I want to read raw multi-mouse input at a high sampling rate for DIY mocap. I got a Python script based on this https://github.com/JohnRoach/Multiple-Mouse-Movement-Data to read data from /dev/input/mouse0 and /dev/input/mouse1, but I'm not 100% clear on what the mice actually write to these files and how fast. That is, I'm not sure how "raw" this data is.

AFAIK, dx, dy are in pixels somewhat corresponding to screen pixels (summing them as I move my mouse from the bottom left of the screen to the top right yields totals roughly equal to screen resolution), but are also independent of cursor position since non-zero dx, dy's still output even after reaching the edge of the screen. So are these pixels seen by the mouse rather than the screen?

Another question is sampling rate. Are /dev/input files being updated at mouse polling rate or more slowly, say at screen refresh rate? I'm inclined to think the former as running a timer in my script yields values close to 0.008 seconds, which is close to the 125 Hz actual value given by the nominal default polling rate in Ubuntu of 100 Hz. If this is the case, should changing the polling rate increase the sampling rate for these /dev/input files?

I'm also open to any alternative suggestions for high sampling rate multi-mouse motion capture.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »