Infrared beacon guidance for the arducopter

3689426094?profile=originalFollowing Leon's great blog post showing the use of a camera from a WII remote as a 3D position sensor for his helicopter, I've been tinkering and now have a Wii remote camera working as a sensor on my Arducopter. Thanks to Chris for encouraging me to blog this work that was previously described in the forums

Why bother
Currently the only sensor we have that tells us where we are relative to something else in our environment is the sonar. Some of the other sensors tell us where we are relative to a theoretical datum (eg GPS), or a variable datum (eg air pressure) these could both see you trying to land your aircraft below ground or off in a tree somewhere if your unlucky. The accelerometers tell us how we are oriented relative to gravity but nothing about where we are. The gyros tell us how we are moving. The recent work on optical flow which senses the surroundings also tells us how the aircraft is moving but not where it is.

My hypothesis is that a combination of an optical sensor such as the wii camera and ground based beacons could be used for accurate relative position determination to allow for precision navigation. This could be useful for landings, take offs, indoor navigation and loitering without GPS.

The Theory
The Wii Camera can track up to four infra red blobs. By sensing the location of a set of predefined IR beacons we can, through simple trigonometry, determine our height above the beacons, our displacement from the beacons and our rotation (yaw) relative to the beacons. This information could then be used to control the navigation algorithms to control the aurducopter. An example, would be to a precise landing on a 'helipad'.

Something similar to this has been done before by the University of Tubingen - have a look at their video

The Wii camera has its limitations.

  • You have to sacrifice a Wii remote to obtain one - there is no known alternative source for the camera - mine cost $1.99 on ebay.
  • The Field of View is quite narrow (+/- 20 deg). Leon has hot glued a small lens on his camera to get a wider field of view.
  • The camera has an I2C interface - great - at 3 volts - not so great. It also needs a 24Mhz clock signal - all do-able with off the shelf components.

The calculations required to determine position from camera data are relatively simple - less complex than the optical flow calculations by the look of them.


3689426115?profile=original
The results
I've mounted a wii camera to my arducopter, created an arduino library to communicate with it, modified the arducopter code to work with it and done some test flying. The test flying so far is "hand flying" (with and without motors running) as the back yard is too small for free flight and it was getting late.

The "flights" are above a simple IR target that is just two IR leds approx 15cm apart. (Cost per target is less than a dollar). I've logged Sonar, Baro and Wii camera altitudes. Here is the graph of the three altitude/range sensors - click for a bigger view
3689426162?profile=original
The blue line is the Wii sensor output - note when the algorithm can't see both the target leds it outputs a zero value. The only "calibration" required is to know the distance between the target LEDs.  - in theory this could be eliminated if you used sonar range to 'calibrate' the target when you first see it.

The correlation between sonar and IR ranging is pretty darn good! In fact one could argue that - in this very limited test - the sonar shows noise (probably due to the BBQ cover flapping in the AC down wash) while the Wii altitude is either rock steady or nil.

The code also calculates x/y displacement from a position vertically above the target in millimetres and rotation (yaw) relative to the target. I'm not using any of this just yet.

I need to do some further work to cope with aircraft roll and pitch effects (currently the code assumes the aircraft is always level) I assume I can use the optical flow code as an example of how to sort this out.

Next steps for me
* free flying and Alt-hold tests
* clean up the code
* have a look at modifying loiter to use the targets
* find and use a lens to get a wider field of view
* come up with an precision guidance to landing concept and convince someone to help me code it

 

What do you think?

I'm keen to hear what people think of this type of sensor being used with arducopters.

Is it useful? How could you use it?

A couple of outside the box ideas to kick you off:

1) fit the aircraft with an IR illuminator (from a security camera) and use IR reflective markers on the ground.

2) get the aircraft to carry IR beacons and drop them when it wants to loiter for precision loiter ability. Or drop a trail of cheap beacons Hansel and Gretel style to find its way 'home' without GPS

 

APM_WiiCamera.zip

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Distributor

    That is a very cool use of your Arducopter quad, what is the range like of the wii cameras?  because it would be cool to put a bunch in a room, then just have 1 IR beacon on arducopoter and have a very cheap setup of the vicon tracking system?

  • just US$6.40, Standard M12x0.5 thread and f-stop of 2.0

  • Reg. the lens - What about this one? http://www.dealextreme.com/p/2-1mm-160-degree-wide-angle-lens-for-s...

  • This would be great if it works in full daylight. Those little infrared controlled toy helies don't work outdoors in the sun. With the camera looking down this may not even matter.

  • Developer

    Re the lenses and lens mounts.  An M12x0.5 lens mount is the standard and you can get both these and a collection of lenses from peauproductions.

         http://peauproductions.com/store/index.php?main_page=product_info&a...

         http://peauproductions.com/store/index.php?main_page=product_info&a...

    The cost of the lens mounts are close to highway robbery but the lenses themselves aren't too bad.

     

    I guess the accuracy will go down if you make the the lens too wide but presumably there will be some middle ground that works best.

     

    Please tell me if you'd like any help with coming up with a 3d printed case (including the lens mount).  I'm getting good with google sketchup and/or with any other ArduCopter code questions.

     

    P.S. you know that nintendo probably throws out dozens of wii remotes including the cameras each day.  There's a room somewhere full of perfectly good cameras that we sadly can't get our hands on.

  • 100KM

    This is mighty interesting !  I think I found my next modification to my copter :-)

  • Amazing, as Chad I would love to see trackig based on a (set of) beacons on an object! Well done and congrats on the progress so far!

  • Great work.  I love it for precision landings!  You could also use it for tracking objects of interest.  Say I want to video myself riding my dirt bike through a track...just put an IR beacon on the fender.  AWESOME!  Please keep up the good work.

  • At the very least this could be used as a landing pad marker.

     

    Can the geometry be scaled up somehow so that a deployment of IR becaons on the ground could create a 'precision hover zone' that extends several 10s of meters?

  • I was thinking about it also. the only problem i see is sun reflections.

This reply was deleted.