Good day ChucKists! I have finally purchased what looks to be a good motion controller for my particular needs. It is the Gyration Air Mouse Elite. It works great, though my first code attempt at varying a SinOsc produced more zipper than actual sine wave, lol. I know the zipper cannot be avoided in practice, so I'll work on ways to minimize it and /or make use of it. Now, to my question: How do I access all of the axes? This device has a 2-axis gyro and a 3-axis accelerometer, which IMHO packs a powerful punch missing only the roll gyro. I can do all sorts of stuff with it, but I need to get at that axis data. I'm sure it's very simple, how do i do it? Les
Les Hall wrote:
Good day ChucKists! I have finally purchased what looks to be a good motion controller for my particular needs. It is the Gyration Air Mouse Elite. It works great, though my first code attempt at varying a SinOsc produced more zipper than actual sine wave, lol. I know the zipper cannot be avoided in practice, so I'll work on ways to minimize it and /or make use of it. Now, to my question:
How do I access all of the axes? This device has a 2-axis gyro and a 3-axis accelerometer, which IMHO packs a powerful punch missing only the roll gyro. I can do all sorts of stuff with it, but I need to get at that axis data. I'm sure it's very simple, how do i do it?
You should be able to follow the ChucK HID examples, then just dump out all the messages received as you wave the thing about. Something like Hid hid; HidMsg msg; 0 => int device; hid.openJoystick(device); while (true) { hid => now; while (hid.recv(msg)) { ... inspect msg Hopefully that will give you enough to map the messages to the right parameters. That is how I did https://github.com/heuermh/lick/blob/9616ef1ea9b483771700903f7fa57d9ba530a63... though that device doesn't have an accelerometer. michael
On May 26, 2011, at 4:53 PM, Michael Heuer wrote:
Les Hall wrote:
How do I access all of the axes?
You should be able to follow the ChucK HID examples, then just dump out all the messages received as you wave the thing about. Something like hid.openJoystick(device); Hopefully that will give you enough to map the messages to the right parameters. That is how I did though that device doesn't have an accelerometer.
michael
Hi michael, yeah that's the thing here, we have a rodent species mouse, not a joystick. The joystick axes are enumerated, however the Mouse axes are called deltaX and deltaY, nothing else documented in the examples. I tried running the joystick and tilt sensor example programs to no avail, they do not recognize the mouse, meaning that this mouse isn't acting like two devices. I'm inclined to believe that it is in fact a 5-axis mouse, and even if deltaZ exists, well, we ran out of letters lol. I think the situation is that ChucK only knows about 2 (or maybe 3) axis mice, not 5 axis ones. So the question arises: why don't you just use the manufacturer's software to make it look like a joystick? Well, I would but I'm in the funny situation that I'm using the PC version of the product on my Mac computer (it's a Mac mini so it can do that) because I wanted the freedom to go with Linux as well. The manufacturer does not provide software for this special case of customer needs that I know, so I'm kind of stuck with an unconfigurable 5-axis mouse. Any further guidance from the Dancing Wu Li ChucKists out there? Les
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 i tried something very novel.i wrote to the tech support folks. if they give me something i can use, i might even buy one myself. the idea of a controller for chuck sounds great. On 5/26/2011 5:36 PM, Les Hall wrote:
On May 26, 2011, at 4:53 PM, Michael Heuer wrote:
Les Hall wrote:
How do I access all of the axes?
You should be able to follow the ChucK HID examples, then just dump out all the messages received as you wave the thing about. Something like hid.openJoystick(device); Hopefully that will give you enough to map the messages to the right parameters. That is how I did though that device doesn't have an accelerometer.
michael
Hi michael, yeah that's the thing here, we have a rodent species mouse, not a joystick. The joystick axes are enumerated, however the Mouse axes are called deltaX and deltaY, nothing else documented in the examples.
I tried running the joystick and tilt sensor example programs to no avail, they do not recognize the mouse, meaning that this mouse isn't acting like two devices. I'm inclined to believe that it is in fact a 5-axis mouse, and even if deltaZ exists, well, we ran out of letters lol. I think the situation is that ChucK only knows about 2 (or maybe 3) axis mice, not 5 axis ones.
So the question arises: why don't you just use the manufacturer's software to make it look like a joystick? Well, I would but I'm in the funny situation that I'm using the PC version of the product on my Mac computer (it's a Mac mini so it can do that) because I wanted the freedom to go with Linux as well. The manufacturer does not provide software for this special case of customer needs that I know, so I'm kind of stuck with an unconfigurable 5-axis mouse.
Any further guidance from the Dancing Wu Li ChucKists out there?
Les
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJN7F7dAAoJEIaKvi7tbzRHycwIAIjDv/bKbKqSXRU13+Gb3/Qk eNv6FLhekWPvZ44GvGx0p7qin3JamhJy+otDypd0HEuIELngwR8tCzi2lptWmJ7u 9c0NL8vzxH+319SGTOehYm76SNXPzrWkUXFSkjZ8/5A6lUYfche2MtGCa0SBhPLc 7GrIIAtyKeFfbyQu2ax/FIYnEfx/wSBuIyglcHh1vEmzI/rqGm2FH+ZMTIQOQUof y365qCtX/Jglk9bLFgkxxzBic/0CTKEEEclvwYjt26Xoesl8zA20F/L4DM5EiHhx vj0zIa5eTXLAfBunLkeXb5dx5CTomEU9ZJH9moLSoVnl1NL0a76UZsRNXXTWoKo= =nyPV -----END PGP SIGNATURE-----
Hey Les,
On 26 May 2011 14:25, Les Hall
Good day ChucKists! I have finally purchased what looks to be a good motion controller for my particular needs. It is the Gyration Air Mouse Elite. It works great, though my first code attempt at varying a SinOsc produced more zipper than actual sine wave, lol. I know the zipper cannot be avoided in practice, so I'll work on ways to minimize it and /or make use of it. Now, to my question:
The simple solution to zipper is to send to value to a Step, the Step to a LPF and that signal to either a osc straight or poll the .last once per samp. This is not especially cheap, but it will work and is simple and reliable.
How do I access all of the axes? This device has a 2-axis gyro and a 3-axis accelerometer, which IMHO packs a powerful punch missing only the roll gyro. I can do all sorts of stuff with it, but I need to get at that axis data. I'm sure it's very simple, how do i do it?
I think there are two potential long-term solutions. * Extend mouse support for a arbitrary number of axis. If the library that we use has that feature this should be fairly straightforward. * Create a generalised "raw" hid abstraction that can be polled for its number of buttons, axis, wheels, etc. This wouldn't have a "type" as such so that would immediately support all sorts of exotic stuff (magic carpet controllers, etc). Especially the first option may be within reach of a dedicated lone hacker. C++ is quite similar ot ChucK, at least similar enough to figure out what parts to copy, paste and modify. The nice thing about the second option (which is of course harder) is that it should solve all issues with all standard compliant HID devices. I'd advocate seriously considering it if/when Spencer has some time. We, as a group, tend to like more exotic devices more so this makes sense to me. We could even consider working together with the SC folks who also have the same question on the same range of platforms. It wouldn't be very easy but the benefits would be quite large. Yours, Kas.
On May 27, 2011, at 8:06 AM, Kassen wrote:
Hey Les, I think there are two potential long-term solutions.
* Extend mouse support for a arbitrary number of axis. If the library that we use has that feature this should be fairly straightforward. * Create a generalised "raw" hid abstraction that can be polled for its number of buttons, axis, wheels, etc. This wouldn't have a "type" as such so that would immediately support all sorts of exotic stuff (magic carpet controllers, etc).
Yours, Kas.
Kas, always great to hear from you! A generalized hid abstraction makes good sense for all the right reasons IMHO. I don't know what it would require, but I will say this. Spencer and the rest of the ChucK dev team must be very busy, as we all usually are, so what I have learned in these situations is that if we make it easy for them, they will be much more likely to accept our request. What that means is doing whatever is required such as defining the problem, identifying the file names and code line numbers to change, or other such up-front work that will help them. Personally, I love using languages like ChucK for my own small programs, but I am at a loss when it comes to compiling source code or setting up dependencies and such. Therefore I cannot really get into the nuts and bolts of this like I probably should or would like. I can, however help with defining the interface or thinking through some features. Kas, can we discuss some details in email and then present them to this list? I'd like to consider features related to hid such as auto-zeroing, anti-zipper, obtaining position and velocity from acceleration, and even possibilities like tracking, etc. that could be easily coded into such an interface. Best wishes, Les
participants (4)
-
Kassen
-
Les Hall
-
Michael Heuer
-
tempjayren@gmail.com