PDA

View Full Version : [Project] Chasing a LASER pointer



Adrenalynn
04-27-2008, 03:05 AM
I've been playing off-and-on with using RoboRealm to get a 'bot to chase a LASER pointer.

It's tougher than it looks at first-blush. Lighting plays a huge part, and it's amazing how much red light there is out there. The pointer I have is [never thought I'd say this] too collimated - the dot is too small.

I've had limited success in a primitive sort of way. My algorithm for speed/direction control is written in the built-in BASIC interpreter - and it works a lot better turning than going straight, go figger. Just about the time the algorithm is working at the same time the vision system is bounding the pointer, the lighting changes, and I have to start over with the image processing chain.

I'm too frustrated at the moment to continue debugging it, so I'm posting instead... Normally I wouldn't post a video of something this "unpolished". If I ever get it really working reliably - I'll see about posting some code.

Windows Media 8, 500kbit/sec, ~5MB download or stream.

http://www.jlrdesigns.com/robovids/robo-071.wmv

LinuxGuy
04-27-2008, 03:12 AM
Normally I wouldn't post a video of something this "unpolished". If I ever get it really working reliably - I'll see about posting some code.

Windows Media 8, 500kbit/sec, ~5MB download or stream.

http://www.jlrdesigns.com/robovids/robo-071.wmv
This is still impressive! I think part of the problem might be the contrast between the laser pointer dot and the ground. Try it on a darker floor and see if your tracking doesn't improve. :veryhappy:

8-Dale

Adrenalynn
04-27-2008, 03:47 AM
Thanks, Dale!

The surface in this case is a deliberate choice. I need to optimize to it.

There are some newer features in the latest roborealm that are documented on the website but not, apparently, in the docs. Filters -> Flatten looks really promising as its a much more advanced averaging than what I've been doing.

I've made some decent progress. I suspect that if I sleep on it, I'll get something figured out tomorrow. I'm always so impatient and expect my code will just work perfectly the first time. ;) It's probably not all that bad for a first real attempt.

New video after I have a nap. :)

Thanks again!

--- A

Sienna
04-27-2008, 08:03 AM
Its been a while since I built a vision system (college in fact!), so I might be off. Have you looked into the types of physical filters that you can put over the camera? I have tried to find filters for red laser pointers, but can't seem to find anything myself <$200.

What about taping a IR laser next to your visible, and have the robot track the IR laser with a visible cutoff filter on the camera?

Alex
04-27-2008, 08:35 AM
thread moved - Brains of my Robot is for SBCs, Laptops, Computers, etc.:)

Adrenalynn
04-27-2008, 10:30 AM
Thanks Sienna - I was recommending bandpass filters to someone awhile back - wasn't it you? Sorry to here you didn't find one. They're out there, though!

Bandpass is one way that might help, but this is NTSC - Never Twice Same Color. IR is crazy noisy, especially in commercial lighting. If this next idea doesn't work out, I'll consider both, though.

I did wake up with an idea: modulating the laser. If I put a small microprocessor on the laser and pulse the laser in some known fashion, I should be able to junk everything that isn't laser, right?

-----

Sorry Alex, I didn't see anyplace fitting better. Machine Vision runs on PCs, and is the robot's "optic nerve" into the PC Brain.

Adrenalynn
04-27-2008, 02:10 PM
Man, what a difference using a LASER that ... doesn'tsuck makes!

I have a commercial Hilti laser measuring system. Switching to that instantly resolved my lighting issues. I could just threshold and be done. Very fast processing.

I'm contemplating taking a hike up to OfficeStaplesDepotMax (tm) and seeing if they have a decently beefy pointer...

I should probably move this to my blog, huh? ;)

Sienna
04-27-2008, 08:41 PM
I did wake up with an idea: modulating the laser. If I put a small microprocessor on the laser and pulse the laser in some known fashion, I should be able to junk everything that isn't laser, right?

I was thinking the exact same thing, but what worried me was that a camera system at 30Hz might not be able to see a modulation scheme, because its too slow. (don't they usually modulate IR at over 30kHz?)

I have looked at the 50mW+ lasers on ebay... if you really wanted a powerful one, they aren't that expensive!

Adrenalynn
04-28-2008, 12:31 AM
29.974ish Hz, as memory serves... :)

I could modulate the laser as slow as I wanted, so as long as I kept the max rate in mind, it wouldn't really matter other than being unfortunately slow...

I did switch to a stronger LASER (Class 4b), but my design requirements spec use in school, so that's just not gonna fly longer term, I'm afraid. I need to get it back down to a Class 2.

Thanks, Sienna!

Adrenalynn
04-28-2008, 04:59 AM
Baby steps...

Forward tracking is working (drive rate was slowed down for debug)

~3MB MP4 AVI: http://www.jlrdesigns.com/robovids/laser-forward.avi

Next up: Reverse. Although it's probably not required since turning works...

Note: LASER pointer upgraded to the Hilti laser measuring/ranging system. I'll try a new pointer soon, but this does solve 100&#37; of my lighting issues...

Adrenalynn
04-28-2008, 05:04 AM
Hey Alex - that embedding is pretty cool! Just a broken thumbnail to figure out, and I'll start posting everything in mpeg4... [insert thumbs-up and beer emoticons here]

[edit: Woohoo! I'm a multi-core processor! Look out SkyNet - here I come! :D]

Alex
04-28-2008, 11:39 AM
Hey Alex - that embedding is pretty cool! Just a broken thumbnail to figure out, and I'll start posting everything in mpeg4... [insert thumbs-up and beer emoticons here]

That is really cool to see it working for videos off your site:D It's always good to see something unexpectedly working without any extra effort on my part;)

I'll have to look into the thumbnail problem...

Adrenalynn
04-28-2008, 12:00 PM
You're so good, you fix things you didn't even know you fixed.

Alex
04-28-2008, 03:21 PM
I'm contemplating taking a hike up to OfficeStaplesDepotMax (tm) and seeing if they have a decently beefy pointer...

you want beefy laser pointer? I'll give you beefy laser pointer:D

http://www.wickedlasers.com/

http://www.thinkgeek.com/gadgets/lights/5a47/
http://www.thinkgeek.com/gadgets/lights/8a39/


oh yeah...
http://www.thinkgeek.com/gadgets/lights/896a/

:D


or... if you ever wanted a light (I know, it's not a laser, but still) that you can literally cook an egg with:

http://www.youtube.com/watch?v=wsIHyRyETKg

Adrenalynn
04-28-2008, 03:30 PM
I got an Elite 125 for a gift last Christmas. Great little pointer, but I suspect the school would frown on a Class 4 laser in the hands of middle schoolers on a public campus. ;)

I've never considered my flashlight getting THAT hot to be a positive thing, but you just know I've gotta go check it out. I take it it's brighter than my little led flashlight? :P

fish123456
06-05-2008, 03:13 PM
This may be a little expensive, but if you can afford it, I would recommend getting a black & white camera and removing the IR filter. I don't know whether a laser light will show up, but an infrared light such as an IR-LED (say, from a remote control) will show up very brightly. You could then use that as a source. I actually did this (not for robots) several years ago. It was fun. I recently bought a nice logitech webcam to try out something similar again, but I got lazy and haven't done anything since then... :(

Adrenalynn
06-05-2008, 03:29 PM
Thanks!

Actually, it chases it quite nicely with a low-res color camera. The downside to just using an IR LED is range. There's no way a little IR LED is going to put a recognizable spot down from 50 or 100ft away. The laser is collimated and will operate the robot from several hundred feet.

Give it a shot! It's actually pretty easy!

ooops
06-05-2008, 05:57 PM
I was recommending bandpass filters to someone awhile back


Can you be more specific on the bandpass filters?

Adrenalynn
06-05-2008, 06:13 PM
I could, but then I'd have to kill you. :p

Seriously, though, it turned out for me that I didn't need them. They are crazy expensive, but can improve ones [robot vision] life substantially.

I had some pretty good success using the glasses that come with my Hilti Laser range finder.

I don't have time right now, but they're red glasses from Hilti. They're a much wider pass but really improve the seeing of a red laser dot in daylight, many tens of magnitude.

I'll go re-research the bandpass filters and find the Hilti glasses later this afternoon once I get this code fixed for work...

ooops
06-05-2008, 06:16 PM
Ok, I saw bandpass and thought I had a solution ... you probably see where I was going ... but wrong bandpass.

Adrenalynn
06-05-2008, 07:07 PM
Don't see where you were going?

I was referring to optical bandpass of something like 620-690nm.