multiple USB mice data acquisition
RJS
I would like to acquire mouse position data from two USB mice at the same time, in a continuous fashion (e.g. for 10 seconds).
I am looking at GetInputState XOP, which looks like it could easily be modified to do this, but this seems to be limited to one mouse (even when I plug in two mice, it will just report the value of the "cursor").
I am also trying VDT2 operations, but this does not seem to recognize my usb mice at all. Instead it gives me only "bluetooth-incoming-port" and "bluetooth-modem" as available ports (using VDTPortList2).
Plus, I can't actually open two ports using the standard VDT2 GUI dialog (i.e. VDT settings). It gives me "error opening bluetooth-modem" [unix error 16: resource busy]
Anyone have any ideas?
Cheers,
Ruud
Mice do not appear as serial devices so you can't use VDT2. If you can find a mouse driver that makes it appear to be a serial device, you could use VDT2 but I have never heard of such a driver.
You would have to write your own XOP but even then I don't know how you would proceed. There may be OS calls that distinguish one mouse from another but I am not aware of them.
June 9, 2015 at 01:16 pm - Permalink
Dear hrodstein,
thanks again for your help.
With regard to GetInputState extension, do you think is there a way to "disengage" MousePosition from the coordinate systems (local and global)?
I would like to allow horizontal and vertical movement along the mouse sensor into infinity to track motion of an object that moves above the IR sensor of the mouse. The actual horizontal and vertical values wouldn't matter too much, since I can calibrate these to known distances travelled.
Thanks for any input.
Ruud
June 10, 2015 at 08:12 am - Permalink
I'm not sure what this means. If you mean that you want to know how much the mouse is moved even it if hits the edge of the screen, then no, MousePosition can not do this. MousePosition calls an OS routine that returns the position of the mouse on the screen. I don't think the information that you are looking for, if I understand it, is available from normal OS mouse routines.
June 10, 2015 at 09:24 am - Permalink
good to know that it cannot be done with Mouse position
The quest continues.
Cheers
Ruud
June 10, 2015 at 10:04 am - Permalink
Maybe there is some other hardware device better suited than a mouse.
Thomas
June 10, 2015 at 10:29 am - Permalink
Hi Thomas,
Actually, I am trying to build a infrared based motion tracker using infrared mice with as little adjustment to the mouse sensor as possible.
The aim is to accomplish something similar to what is described here: http://labrigger.com/blog/2011/05/27/destroying-the-curve/
I have tried some arduino driven ADNS sensors, but with mixed results.
Ruud
June 10, 2015 at 01:15 pm - Permalink
This is the first thing comes into my mind when you mention tracking two mice. May I ask why you don't use matlab? It is the thing most people use in the field
June 10, 2015 at 05:39 pm - Permalink
Have you considered to cannibalize the USB ends of the mice, feed the inputs in to a dual-port A/D converter, and read the data that way?
post edit: I just realized, a USB mouse is probably not a simple, one-channel I/O position -> intensity device.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
June 11, 2015 at 01:36 pm - Permalink
https://msdn.microsoft.com/en-us/library/windows/desktop/ee418864(v=vs…
https://msdn.microsoft.com/en-us/library/windows/desktop/ms645543(v=vs…
You would need to write your own XOP in order to take advantage of this functionality.
June 11, 2015 at 10:30 am - Permalink