Motion Control
hi everyone. this is my first post.
i'm just getting into maxmsp and i'm looking for some advice about motion control.
i'm starting a project at uni where i want a person's position in a given space to control my max patch.
so far, i think my best option is to use an arduino and a couple of ping))) ultrasonic sensors.
i found this tut, would it be easy to connect this up to max?
http://www.arduino.cc/en/Tutorial/UltrasoundSensor
basically, i'm just after some advice or better ideas on how to do this. does anyone know of a cheaper/simpler/more reliable way?
any advice would be much appreciated.
thanks.
k
Wide-angle camera and cv.jit are your friends
-----Original Message-----
From: maxmsp-bounces@cycling74.com [mailto:maxmsp-bounces@cycling74.com]
On Behalf Of mister k
Sent: Thursday, November 08, 2007 1:22 AM
Subject: [maxmsp] Motion Control
hi everyone. this is my first post.
i'm just getting into maxmsp and i'm looking for some advice about
motion control.
i'm starting a project at uni where i want a person's position in a
given space to control my max patch.
so far, i think my best option is to use an arduino and a couple of
ping))) ultrasonic sensors.
i found this tut, would it be easy to connect this up to max?
http://www.arduino.cc/en/Tutorial/UltrasoundSensor
basically, i'm just after some advice or better ideas on how to do this.
does anyone know of a cheaper/simpler/more reliable way?
any advice would be much appreciated.
thanks.
k
thanks or the fast reply.
yeah, that would be pretty cool. think it might be a bit expensive though, as i'd need to buy a wide angle camera and jitter. i'm an impoverished student, so the lower the cost, the better.
i'll look into it tho, anyone know where to get a cheap wide angle camera?
cheers
k
not sure about the range
but i use the built in camera on macbookpro for this purpose
start with benson'e recipe #32 for motion detection
https://cycling74.com/story/2006/2/17/153427/406
then use [jit.submatrix] to divide the area for separate triggers
I have the ping))) and haven't gotten it to work, but I know it's something very simple I'm missing, so don't take that as a final word. I do have a infrared distance sensor that works great, it uses an analog pin of the Arduino. The ping))) is better in that sense because it uses a digital pin, but you need to send it a pulse, wait, then read the result pulse / value. Not difficult but the docs are for Basic Stamp. I use Arduino... like I said, the infrared one worked right away with an analogRead(), and is about the same price. The range is less, I think. It has a surprisingly narrow beam / acceptance angle.
If you are using Arduino, do yourself a favor and look up the Arduino2Max object / patch, it will save you hassles coding your incoming readings (parses for you into send and receive objects). You can do it yourself in C / Wiring, of course, but I ran into trouble with getting it to work right with (zl group) and indexing properly. The A2M is a nice time-saver and gets you to the fun stuff faster.
--CJ
downloaded the jitter demo and cv.jit. been using it with the webcam on my macbook pro, but i'm not sure it's gonna be stable enough for what i'm doing. either way i'm a bit confused about how to get the output from cv.jit.track into my max patch. i'm just using the demo from the help file to test it out, it brings up the number in a jit.cellblock box. how do i get the number out of here?!
cj* i'm really interested to see if you have any joy with the ping))) as it seems like my most likely option at the moment.
if you go to the url in my original post there's a tut on how to connect it to the arduino, and a link to some code for the arduino.
might look into infra red, where did you get the parts and what was the range like? (i'm probably going to be using a 10' square space, and accuracy isn't *that* important)
cheers
k
EyesWeb is a great software for motion control by mean of a videocamera.
(even webcams..)
Check it out at http://www.infomus.dist.unige.it
You might use eyesweb to control a Max Msp patch.
best
Carlo
----- Original Message -----
From: "mister k"
To:
Sent: Thursday, November 08, 2007 12:22 AM
Subject: [maxmsp] Motion Control
>
> hi everyone. this is my first post.
> i'm just getting into maxmsp and i'm looking for some advice about motion
> control.
> i'm starting a project at uni where i want a person's position in a given
> space to control my max patch.
> so far, i think my best option is to use an arduino and a couple of
> ping))) ultrasonic sensors.
> i found this tut, would it be easy to connect this up to max?
> http://www.arduino.cc/en/Tutorial/UltrasoundSensor
>
> basically, i'm just after some advice or better ideas on how to do this.
> does anyone know of a cheaper/simpler/more reliable way?
>
> any advice would be much appreciated.
> thanks.
> k
Oh! That's just what I needed. I didn't know that code was there on the Arduino pages, thanks! I think it should be all fine now. I'd say run with that. With the 4-pack of those, perhaps, and a space like you're talking about, you'll have all kinds of data to mess with... vertical, horizontal, combinations. Also since you have multiple points you can do some trickery through geometry manipulations. Maybe look into OpenGL through Jitter and you could map out / visualize people's motion, distances, etc. Turn your people into wireframe spheres that move around in 3D space? Very simple to implement once you understand how an object like jit.gl.gridshape works, and you have your tracking data coming in.
Am pretty swamped at the moment (happily it's all to do with Max!) but am eager to try that out. I don't remember where the infrared sensor came from, could look it up, they're common. It was about $25. I think you should go with the ping))) though.
Let me (us!) know how it goes with getting the Arduino going with Max. There's a number of previous threads on here with some caveats about it, as there are a few things to keep in mind. However, overall it was pretty straightforward. You just have to keep the ports organized (one application at a time)... have the latest serial object if you're on Windows (4.6.2 Max has it)... and unfortunately, at least on my machine, the Arduino environment has been a little buggy. Nothing terrible but a few quirks... like having to re-save as a new project name on occasion when it claims "File Access Denied" when compiling etc. ?? For the price and the performance, though, I'll let that go.
Good luck!
--CJ
cheers. you guys have been really helpful.
i'm on my way to getting it working, still need to try it out in a proper space tho.
i'm gonna keep trying with the webcam and cv.jit option for the moment. it's the cheapest option (until my jitter demo runs out)
*cj i'll let you know what happens when i order my arduino.
anyone have any webcam recomendations? (cheapest, widest angle lens, cheapest, best resolution, cheapest, etc.)
k
Cheapest trick: we mounted a door peep-hole lens on a wide angle cam.
Managed to cover a whole room from 2.5 M roughly height.
Don't get cheaper than that..
Z.
-----Original Message-----
From: maxmsp-bounces@cycling74.com [mailto:maxmsp-bounces@cycling74.com]
On Behalf Of mister k
Sent: Thursday, November 08, 2007 11:12 PM
Subject: [maxmsp] Re: Motion Control
cheers. you guys have been really helpful.
i'm on my way to getting it working, still need to try it out in a
proper space tho.
i'm gonna keep trying with the webcam and cv.jit option for the moment.
it's the cheapest option (until my jitter demo runs out)
*cj i'll let you know what happens when i order my arduino.
anyone have any webcam recomendations? (cheapest, widest angle lens,
cheapest, best resolution, cheapest, etc.)
k
Are you trying to plot your position in 3D space in 2D space? In the latter
I mean as if someone is looking down on a room you are in and plotting it as
an X/Y coordinate.
I can't think of a simple way. Most accurate would be using 3 distance
sensors of some form, then using the distances from there to triangulate
your position.
Your subject "motion control" suggests the use of G-force sensors. You can
buy online g-force sensors mounted on a small circuit board that gives a
proportional output which you can put through arduino or CUI.
On 08/11/2007, Eran Sachs wrote:
>
> Cheapest trick: we mounted a door peep-hole lens on a wide angle cam.
> Managed to cover a whole room from 2.5 M roughly height.
> Don't get cheaper than that..
> Z.
>
> -----Original Message-----
> From: maxmsp-bounces@cycling74.com [mailto:maxmsp-bounces@cycling74.com]
> On Behalf Of mister k
> Sent: Thursday, November 08, 2007 11:12 PM
> Subject: [maxmsp] Re: Motion Control
>
>
> cheers. you guys have been really helpful.
> i'm on my way to getting it working, still need to try it out in a
> proper space tho.
> i'm gonna keep trying with the webcam and cv.jit option for the moment.
> it's the cheapest option (until my jitter demo runs out)
> *cj i'll let you know what happens when i order my arduino.
> anyone have any webcam recomendations? (cheapest, widest angle lens,
> cheapest, best resolution, cheapest, etc.)
>
> k
>
>
>
>
*joe it's 2d space. doesn't need to be over complicated. don't even really need to triangulate the position, just need a few sets of values that changes as the user walks around the space. yeah, i'd pretty much decided on distance sensors (ultrasonic), but i'm gonna keep trying with a webcam till i can afford the sensors and arduino.
k
You could try a top-down camera, and if the person's wearing a brightly
coloured hat then that should be easy to use with cv.jit.
You could even try working with some infra red long (can get pricey with
long distance sensors) or theramin type sensors.
On 09/11/2007, mister k wrote:
>
>
> *joe it's 2d space. doesn't need to be over complicated. don't even really
> need to triangulate the position, just need a few sets of values that
> changes as the user walks around the space. yeah, i'd pretty much decided on
> distance sensors (ultrasonic), but i'm gonna keep trying with a webcam till
> i can afford the sensors and arduino.
> k
>