Our resident expert on all things
robotic is merely an email away.
roboto@servomagazine.com
Tap into the sum of allhumanknowledge and get your questions answered here!
From software algorithms to material selection, Mr. Roboto strives to meet you
where you are — and what more would you expect from a complex service droid?
by
Dennis Clark
Update from Last Month’s
Column on Optical Mouse
Navigation
When last we met, I was going on about using a PS2
mouse for assistance with robot navigation. I was pretty
sure that you could do some simple math with rectangular
to polar coordinate transforms to get distance and heading
information that would be more accurate than using simple
dead-reckoning. I’m still pretty sure this is possible, but ...
Mr. Roboto has to-date failed to get a PS2 mouse to listen
and talk back. So, either my mouse is not fully functional,
or, the lack of a datasheet for this model has put a serious
crimp in my understanding of the protocol. Regardless, I
have been humbled by a lowly mouse!
I don’t give up easily, but I don’t bang my head
against the wall either. Since using PS2 mice is a bit tricky,
they are getting old and hard to find, cost $5 or so, and
finally, since there are Avago sensors available that you can
talk to using simple SPI hardware, I’m going that route.
Here is my plan and Parts List to get an optical mouse
sensor to be a navigation aid:
PARTS LIST
Part #
Digi-Key
Cost
Avago ADNS-5050 Optical Sensor
Avago ADNS-5100-001 Trim Lens
Avago HLMP-ED31-SV00 Red LED
Avago HLMP-5029 LED Clip
516-2261
516-2300
516-1372
516-1395
$1.60
$0.57
$0.77
$3.78 (for 10)
14 SERVO 06.2011
As you can see (except for having to buy 10 of the LED
clips), I could get the entire sensor setup for less than a
cheap mouse — much less. Plus, I get the ability to take low
resolution pictures and do lots of cool stuff with the chip
directly. I’m going to mount this on a small proto board
and get back with you next month with a status report on
how well this works. I’m also going to recycle this optical
mouse (with obsolete parts in it) before I lose any more
sleep!
Q. I want to use a laptop with one or more USB joysticks to control my underwater ROV. But, I have no idea how to code the actual reading of the
joystick axes and buttons. Once I can get the raw data into
a C program (preferably using gcc and public libraries), I
can write the code to convert axis movement in forward,
reverse, rotate, up, down, arm move, ballast, etc. Can you
point me to the interface library and a sample interface
code?
— Mike
A. A joystick is a USB HID device and every computer has libraries to handle communications with a HID device. The tome on handling this interface is, of
course, Jan Axelson’s USB Complete. Get a copy of this
book or check it out from your local library; everything you
need is in there. If you are an old hand at PC programming,
then you will have no problem interfacing with a set of
USB joysticks.
There are a few sites out there that can help without
the book of course, but you’ll get a lot more mileage from
your work with USB Complete. Start by looking here:
http://www.lvr.com/hidpage.htm.